Skip to content

Custom LLM Providers

By default, OpenAI and Anthropic are pre-registered. The ProviderRegistry lets you add any Vercel AI SDK-compatible provider at runtime — no engine code changes required.

import { createGroq } from '@ai-sdk/groq';
import { createProviderRegistry, configureProviderRegistry } from '@mcai/orchestrator';
// Start with built-in OpenAI + Anthropic
const providers = createProviderRegistry();
// Wire into the engine
configureProviderRegistry(providers);

Once registered, agents can reference the provider by name:

{
"id": "fast-researcher",
"model": "llama-3.3-70b-versatile",
"provider": "groq",
"system_prompt": "You are a research specialist...",
"tools": [{ "type": "mcp", "server_id": "web-search" }]
}

Once registered, agents can reference the provider by name:

{
"id": "fast-researcher",
"model": "claude-opus-4-20250514",
"provider": "anthropic",
"provider_options": {
"effort": "max",
"thinking": {
"type": "enabled",
"budgetTokens": 12000
}
},
"system_prompt": "You are a research specialist...",
"tools": [{ "type": "mcp", "server_id": "web-search" }]
}

Each provider declares a list of known models during registration. When an agent config omits the provider field, the engine infers it by exact match against these lists:

Model NameInferred Provider
gpt-4-turboopenai
claude-sonnet-4-20250514anthropic
llama-3.3-70b-versatilegroq

If no match is found, the default provider (anthropic) is used.

Use addModel() to register new model names at runtime without re-registering the entire provider:

providers.addModel('openai', 'gpt-5');

Use supportsModel() to check if a model is in the known list:

providers.supportsModel('openai', 'gpt-4o'); // true
ExportDescription
ProviderRegistryClass — register, unregister, list, resolve models, validate
LanguageModelFactoryType — (modelId: string) => LanguageModel
ProviderOptionsType — { models: string[] }
createProviderRegistry()Returns a registry with built-ins pre-registered
configureProviderRegistry(registry)Wires a registry into the global agent factory