Skip to main content

ModelProvider Interface

Every model in Agentium implements this interface. You never implement it directly — use factory functions like openai(), anthropic(), google().

ModelConfig

Options passed to generate() and stream(). Also used as per-request overrides on the agent.

Factory Functions and Provider Configs

Each provider has a factory function that creates a ModelProvider. Here are the config options for every provider.

openai(modelId, config?)

Common models: gpt-4o, gpt-4o-mini, o3, o3-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano

anthropic(modelId, config?)

Common models: claude-sonnet-4-20250514, claude-haiku-4-5-20251001, claude-opus-4-20250514

google(modelId, config?)

Common models: gemini-2.5-flash, gemini-2.5-pro, gemini-2.0-flash

vertex(modelId, config?)

ollama(modelId, config?)

Common models: llama3.2, llama3.1, codellama, mistral, phi3, gemma2

deepseek(modelId, config?)

Common models: deepseek-chat, deepseek-reasoner

mistral(modelId, config?)

Common models: mistral-large-latest, mistral-medium-latest, codestral-latest, pixtral-large-latest

xai(modelId, config?)

Common models: grok-3, grok-3-mini, grok-2

perplexity(modelId, config?)

Common models: sonar-pro, sonar, sonar-reasoning-pro

cohere(modelId, config?)

Common models: command-r-plus, command-r, command-light

meta(modelId, config?)

awsBedrock(modelId, config?)

awsClaude(modelId, config?)

azureOpenai(modelId, config?)

azureFoundry(modelId, config?)

vercel(modelId, config?)


OpenAI-Compatible Providers

Any API that follows the OpenAI API format can be used with the openai() factory by setting baseURL:

Environment Variables

Quick reference for all provider environment variables: