Skip to main content

LLM Providers

OpenMolt supports three LLM providers out of the box. Select the provider with the model string prefix.

OpenAI

const om = new OpenMolt({
llmProviders: {
openai: { apiKey: process.env.OPENAI_API_KEY },
},
});

Supported models:

Model stringNotes
openai:gpt-4oDefault choice — fast, capable
openai:gpt-4o-miniCheaper, great for simple tasks
openai:o1 / openai:o3Reasoning models — no system prompt, no temperature
openai:o4-miniCompact reasoning model

Reasoning models (o1, o3, o4-mini, …) are detected automatically. They use max_completion_tokens instead of max_tokens and the system prompt is merged into the user message.

Custom base URL (proxies, Azure OpenAI):

llmProviders: {
openai: { apiKey: '…', baseUrl: 'https://my-proxy.example.com/v1' },
},

Anthropic

const om = new OpenMolt({
llmProviders: {
anthropic: { apiKey: process.env.ANTHROPIC_API_KEY },
},
});
Model stringNotes
anthropic:claude-opus-4-6Most capable Claude model
anthropic:claude-sonnet-4-6Balanced speed / capability
anthropic:claude-haiku-4-5-20251001Fastest, lowest cost

Enable extended thinking via modelConfig:

const agent = om.createAgent({
model: 'anthropic:claude-opus-4-6',
modelConfig: { thinking: true, maxTokens: 16000 },
});

When thinking: true the response's chain-of-thought is exposed on LLMResponse.thinking.

Google Gemini

const om = new OpenMolt({
llmProviders: {
google: { apiKey: process.env.GOOGLE_API_KEY },
},
});
Model stringNotes
google:gemini-2.0-flashFast, multimodal
google:gemini-2.5-proMost capable Gemini model

Enable web search grounding via modelConfig:

const agent = om.createAgent({
model: 'google:gemini-2.0-flash',
modelConfig: { search: true },
});

Using multiple providers

Instantiate one OpenMolt with all keys configured; each agent picks its own model:

const om = new OpenMolt({
llmProviders: {
openai: { apiKey: process.env.OPENAI_API_KEY },
anthropic: { apiKey: process.env.ANTHROPIC_API_KEY },
google: { apiKey: process.env.GOOGLE_API_KEY },
},
});

const planner = om.createAgent({ model: 'openai:o3',});
const writer = om.createAgent({ model: 'anthropic:claude-opus-4-6',});
const searcher = om.createAgent({ model: 'google:gemini-2.0-flash',});