Models and providers
Pick a model
| Form | Example | Provider | Model |
|---|---|---|---|
| Provider and model id | model.openai("gpt-4o") | named | named |
| Provider and tier | model.mistral.fast | named | from the table below |
| Tier only | model.balanced | the first provider with a key, in the order of the table | from the table |
| String | model("anthropic:claude-sonnet-4-6"), model("openai:fast") | named | named, or from the table |
| Custom endpoint | model.openaiCompatible({ baseURL, model, apiKeyEnv }) | any OpenAI-compatible server | named |
The same forms work for agentNode({ model }) and for one-off calls with .invoke(). A string
also works directly: agentNode({ model: "openai:gpt-4o" }). An unknown provider is an error.
Providers, keys and tiers
| Provider | Key | fast | balanced | frontier | creative |
|---|---|---|---|---|---|
| anthropic | ANTHROPIC_API_KEY | claude-haiku-4-5 | claude-sonnet-4-6 | claude-opus-4-8 | claude-fable-5 |
| openai | OPENAI_API_KEY | gpt-4o-mini | gpt-4o | gpt-4o | gpt-4o |
GEMINI_API_KEY or GOOGLE_API_KEY | gemini-2.5-flash | gemini-2.5-flash | gemini-2.5-pro | gemini-2.5-flash | |
| mistral | MISTRAL_API_KEY | mistral-small-latest | mistral-medium-latest | mistral-large-latest | mistral-large-latest |
| openrouter | OPENROUTER_API_KEY | openai/gpt-4o-mini | openai/gpt-4o-mini | openai/gpt-4o | openai/gpt-4o |
| minimax | MINIMAX_API_KEY | MiniMax-Text-01 | MiniMax-Text-01 | MiniMax-Text-01 | MiniMax-Text-01 |
| huggingface | HF_TOKEN or HUGGINGFACE_API_KEY | meta-llama/Llama-3.3-70B-Instruct | meta-llama/Llama-3.3-70B-Instruct | meta-llama/Llama-3.3-70B-Instruct | meta-llama/Llama-3.3-70B-Instruct |
| ollama | AILU_USE_OLLAMA=1 | mistral | mistral | mistral | mistral |
| lmstudio | AILU_USE_LMSTUDIO=1 | local-model | local-model | local-model | local-model |
A missing key fails the call with the name of the variable to set. AILU_LLM_MOCK=1 turns
missing keys into calls to the deterministic offline mock instead.
Local servers need no key but must be switched on: AILU_USE_OLLAMA=1 (with
AILU_OLLAMA_BASE_URL for a server not on http://localhost:11434/v1), AILU_USE_LMSTUDIO=1
(with AILU_LMSTUDIO_BASE_URL).
Custom endpoints
model.openaiCompatible points an agent at any server that speaks the OpenAI chat-completions
API: vLLM, LM Studio, LiteLLM, Azure OpenAI, a company gateway.
model.openaiCompatible({
baseURL: "https://gateway.example.com/v1",
model: "llama-3.1-70b",
apiKeyEnv: "GATEWAY_API_KEY" // sent as a Bearer token; omit for a keyless server
});
The key is read only from apiKeyEnv. Your OPENAI_API_KEY is never sent to a custom endpoint.
Anthropic and Gemini have their own APIs and can't be pointed at a custom URL.