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.

Authorize custom destinations​

Custom endpoints are denied by default. Set AILU_MODEL_ENDPOINT_ALLOWLIST in the embedding host's environment to a comma-separated list of exact base URLs before running a graph or calling .invoke():

AILU_MODEL_ENDPOINT_ALLOWLIST="https://models.example.com/v1,http://127.0.0.1:1234/v1"

The engine compares parsed URLs, including scheme, port and base path. Host case, default ports and trailing slashes are normalized. Prefixes and wildcards do not grant access. Credentials in URLs, queries, fragments and malformed entries are refused. An unset, empty or invalid list denies custom endpoints with AILU_MODEL_ENDPOINT_NOT_ALLOWED. This check also applies when constructing a graph for replay.

Only the trusted operator should configure this list. Listing an endpoint authorizes its destination, including its DNS and network routing; it is not a public-IP filter. HTTP and private/local servers work when explicitly listed, so list only services intended to receive model requests. Redirects are never followed. Built-in providers and the host-controlled AILU_OLLAMA_BASE_URL / AILU_LMSTUDIO_BASE_URL routes keep their existing configuration. Restrict endpoint credentials separately with the variable allowlist below.

Restrict the variables apiKeyEnv may name​

A graph names the variable its key is read from. Before using a named key, the operator must set AILU_API_KEY_ENV_ALLOWLIST to the variables meant to hold endpoint keys: exact names and prefixes ending in *, separated by commas. Only list keys intended for endpoints that graph authors may choose; this list authorizes variable names, not endpoint origins.

AILU_API_KEY_ENV_ALLOWLIST="AILU_ENDPOINT_*,GATEWAY_KEY"

An apiKeyEnv that matches no entry is refused before anything is read, whether the variable exists or not. The error names the variable, never a value: ApiKeyEnvNotAllowedError (code AILU_API_KEY_ENV_NOT_ALLOWED) from .invoke() and from a graph run whose agent names it, and ailu.ApiKeyEnvNotAllowedError from Python's llm_complete. Elsewhere (a Python graph run, the C ABI) the engine's message starts with AILU_API_KEY_ENV_NOT_ALLOWED:. Unset or empty, the list allows no named variable. To migrate a keyed custom endpoint, explicitly list its key variable. Endpoints without an apiKeyEnv remain keyless. Names are trimmed, and the list applies only to apiKeyEnv, not to a provider's own variable such as OPENAI_API_KEY.

This is a breaking default change for keyed custom endpoints and for TypeScript standalone provider-key overrides such as model.openai("gpt-4o", { apiKeyEnv: "CORP_OPENAI_KEY" }).invoke(...), even without baseURL. Python's llm_complete uses api_key_env only when base_url is supplied; it does not use that selector to override a built-in provider's variable without base_url. Follow the named-credential migration guide before upgrading.

A bare * entry explicitly allows every variable name, removing this restriction. Use exact names or narrow prefixes for keys that graph authors may access.