Providers & Models
VoltAgent is built directly on top of the Vercel AI SDK. You can either:
- Pass a
LanguageModelfrom an ai-sdk provider package, or - Use a model string like
openai/gpt-4o-miniand let VoltAgent resolve it with the built-in model router.
Both approaches are fully compatible with ai-sdk streaming, tool calling, and structured outputs. For the router, VoltAgent ships with a registry snapshot generated from models.dev.
Model Strings (Model Router)
Model strings remove the need to import provider packages in your app:
import { Agent } from "@voltagent/core";
const agent = new Agent({
name: "my-agent",
instructions: "You are a helpful assistant",
model: "openai/gpt-4o-mini",
});
Other examples:
const claudeAgent = new Agent({
name: "claude-agent",
instructions: "Answer with concise reasoning",
model: "anthropic/claude-3-5-sonnet",
});
const geminiAgent = new Agent({
name: "gemini-agent",
instructions: "Respond in Turkish",
model: "google/gemini-2.0-flash",
});
If you need provider-specific configuration or want to use the ai-sdk APIs directly, pass a LanguageModel instead.
See Model Router & Registry for how strings are resolved and how env vars are mapped.
For the full provider directory, see Models.
Installation
Install the AI SDK base package (required):
- npm
- yarn
- pnpm
npm install ai
yarn add ai
pnpm add ai
If you plan to import ai-sdk providers directly (for embeddings or provider-specific helpers), install those packages too. If you only use model strings such as openai/text-embedding-3-small, you can skip them:
- npm
- yarn
- pnpm
# For example, to use OpenAI:
npm install @ai-sdk/openai
# Or Anthropic:
npm install @ai-sdk/anthropic
# Or Google:
npm install @ai-sdk/google
# For example, to use OpenAI:
yarn add @ai-sdk/openai
# Or Anthropic:
yarn add @ai-sdk/anthropic
# Or Google:
yarn add @ai-sdk/google
# For example, to use OpenAI:
pnpm add @ai-sdk/openai
# Or Anthropic:
pnpm add @ai-sdk/anthropic
# Or Google:
pnpm add @ai-sdk/google
If you only use model strings, you can skip installing provider packages.