Modelfusion
StaleDescription
TypeScript multi-modal AI library that unifies text, voice, and image model APIs.
Key Features
- Multi-modal — Same API for text, voice, image, and embedding models
- Multi-provider — OpenAI, Anthropic, Mistral, Replicate, HuggingFace, etc.
- Type-safe — Full TypeScript; model and function signatures checked at compile time
- Agent support — Built-in function calling, tool loops, and memory abstractions
- Streaming — First-class streaming output
- Local-friendly — Lightweight API; runs on Vercel Edge / Node / Bun
Use Cases
💡 Add chat, image generation, and STT to a Next.js app via a single SDK.
💡 Wire LLM tool calls into a TypeScript backend quickly.
💡 Build multi-modal web apps (screenshot -> LLM explanation).
Categories
Quick Start
# Install
npm install modelfusion
# Text generation
import { generateText, openai } from 'modelfusion';
const text = await generateText({
model: openai.CompletionTextGenerator({ model: 'gpt-4o' }),
prompt: 'Describe Modelfusion in one sentence',
});
console.log(text);