Skip to content
Projets

À propos

A Typescript library to use LLM providers APIs in a unified way.

IA et apprentissage automatique

Comment ces chiffres sont mesurés

What you can do

  • Universal API - Single interface for all providers
  • Streaming - Real-time token-by-token responses
  • Function Calling - Let models invoke tools and plugins
  • Vision - Analyze images with vision-capable models

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

multi-llm-ts

A TypeScript library to use LLM provider APIs in a unified way.

📚 Full Documentation

Features

  • Universal API - Single interface for all providers
  • Streaming - Real-time token-by-token responses
  • Function Calling - Let models invoke tools and plugins
  • Vision - Analyze images with vision-capable models
  • Structured Output - Type-safe JSON responses with Zod schemas
  • Multi-turn Conversations - Build complex chat applications
  • Abort Support - Cancel operations gracefully
  • Usage Reporting - Track token consumption

Quick Start

npm install multi-llm-ts
import { igniteModel, loadModels, Message } from 'multi-llm-ts'

// Load models and create an instance
const config = { apiKey: process.env.OPENAI_API_KEY }
const models = await loadModels('openai', config)
const model = igniteModel('openai', models.chat[0], config)

// Generate a response
const messages = [
  new Message('system', 'You are a helpful assistant'),
  new Message('user', 'What is the capital of France?')
]

const response = await model.complete(messages)
console.log(response.content)
// Output: "The capital of France is Paris."

→ Continue with Quick Start Guide

Supported Providers

  • Anthropic
  • Azure AI
  • Cerebras
  • DeepSeek
  • Google
  • Groq
  • Meta/Llama
  • MistralAI
  • Ollama
  • OpenAI
  • OpenRouter
  • xAI

→ See detailed feature coverage

Examples

Check out the demo project for a real-world implementation.

# Run basic example
npm install
API_KEY=your-openai-api-key npm run example

# Run with different provider
API_KEY=your-anthropic-key ENGINE=anthropic npm run example

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Maintainers: see the npm publishing guide for the manual release workflow and credential-free trusted publishing setup.

License

MIT License - see LICENSE for details

Explorer des projets similaires

Chargement…