Skip to main content

Models and providers

Pick a model​

FormExampleProviderModel
Provider and model idmodel.openai("gpt-4o")namednamed
Provider and tiermodel.mistral.fastnamedfrom the table below
Tier onlymodel.balancedthe first provider with a key, in the order of the tablefrom the table
Stringmodel("anthropic:claude-sonnet-4-6"), model("openai:fast")namednamed, or from the table
Custom endpointmodel.openaiCompatible({ baseURL, model, apiKeyEnv })any OpenAI-compatible servernamed

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​

ProviderKeyfastbalancedfrontiercreative
anthropicANTHROPIC_API_KEYclaude-haiku-4-5claude-sonnet-4-6claude-opus-4-8claude-fable-5
openaiOPENAI_API_KEYgpt-4o-minigpt-4ogpt-4ogpt-4o
googleGEMINI_API_KEY or GOOGLE_API_KEYgemini-2.5-flashgemini-2.5-flashgemini-2.5-progemini-2.5-flash
mistralMISTRAL_API_KEYmistral-small-latestmistral-medium-latestmistral-large-latestmistral-large-latest
openrouterOPENROUTER_API_KEYopenai/gpt-4o-miniopenai/gpt-4o-miniopenai/gpt-4oopenai/gpt-4o
minimaxMINIMAX_API_KEYMiniMax-Text-01MiniMax-Text-01MiniMax-Text-01MiniMax-Text-01
huggingfaceHF_TOKEN or HUGGINGFACE_API_KEYmeta-llama/Llama-3.3-70B-Instructmeta-llama/Llama-3.3-70B-Instructmeta-llama/Llama-3.3-70B-Instructmeta-llama/Llama-3.3-70B-Instruct
ollamaAILU_USE_OLLAMA=1mistralmistralmistralmistral
lmstudioAILU_USE_LMSTUDIO=1local-modellocal-modellocal-modellocal-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.