LLM Providers
Applies to SDK 0.16+ · Last updated: 2026-06-12
AgentNode binds OpenAI-compatible hosted providers, local Ollama, and custom endpoints from a single provider registry. Credentials are resolved host-side — through an environment variable or the credential vault — and an environment variable always wins. Ollama runs locally and needs no API key when it is already running on your machine.
Supported providers
These presets are built in. They are the providers that agentnode setup, agentnode auth, and the host-side LLM binding understand.
| Provider | Slug | Auth | Env var | Notes |
|---|---|---|---|---|
| OpenAI | openai | API key | OPENAI_API_KEY | Official endpoint |
| Anthropic | anthropic | API key | ANTHROPIC_API_KEY | Official endpoint |
| OpenRouter | openrouter | API key | OPENROUTER_API_KEY | Gateway to many models; default openai/gpt-4o-mini |
| DeepSeek | deepseek | API key | DEEPSEEK_API_KEY | OpenAI-compatible; default deepseek-chat |
| Mistral | mistral | API key | MISTRAL_API_KEY | OpenAI-compatible; default mistral-small-latest |
| Qwen | qwen | API key | DASHSCOPE_API_KEY | Alibaba DashScope (intl); default qwen-plus |
| Gemini | gemini | API key | GEMINI_API_KEY | Google OpenAI-compatible endpoint; default gemini-2.0-flash |
| Ollama | ollama | None — local | — (keyless) | localhost:11434; default llama3.2; opt-in only |
Every key provider authenticates with an API key. Only Ollama is keyless. The Slug is what you pass to agentnode auth and llm.default_provider.
Set the default provider
Choose which provider the host-side LLM binding uses by default, then confirm it is configured.
$ agentnode config set llm.default_provider openai
$ agentnode auth status # shows each provider and its effective source
$ agentnode auth test openai # validate the key via a free endpointAdd credentials
Store a key in the credential vault, or export the provider's environment variable (which overrides the vault):
$ agentnode auth set deepseek # prompts for the key (hidden input)
# or, per shell / CI:
$ export DEEPSEEK_API_KEY=sk-...Storage backends, env precedence, and the connector vault are covered in Credentials & Connectors.
Use Ollama locally
Ollama is a keyless, local provider — no account and no per-token cost. Select it as the default, then check that your local Ollama is reachable.
$ agentnode config set llm.default_provider ollama
$ agentnode auth test ollama # localhost reachability check (not a key check)This path needs no hosted API key, but it is not zero-setup: you must install Ollama, have it running, and pull a model. AgentNode never installs or starts Ollama for you, and never probes it automatically.
OpenAI-compatible and custom endpoints
Any endpoint that implements the OpenAI chat-completions API can be added as a config entry under llm.providers.<name> — no code change per provider. Endpoints that deviate from that protocol are not guaranteed to work.
{
"llm": {
"default_provider": "my-llm",
"providers": {
"my-llm": {
"base_url": "https://my-host/v1",
"api_key_env": "MY_LLM_API_KEY",
"default_model": "my-model",
"requires_key": true
}
}
}
}A custom entry can also override a preset field (for example, a different default_model). Set requires_key to false for a local, keyless endpoint.
Providers vs the runtime
This page covers which providers exist and how their credentials are configured. How an agent or the tool loop actually calls a model — registering tools, the auto tool-loop, and per-provider client wiring — lives in the LLM Runtime docs. Either way, keys stay host-side: a sandboxed agent reaches a model only through a host-side broker, so the provider key never enters the container.
Troubleshooting
| Symptom | Fix |
|---|---|
| Provider not configured | Run agentnode auth status; set a key with agentnode auth set <provider>, or switch to Ollama. |
| agentnode auth test fails (401/403) | The key was rejected. Re-set it with agentnode auth set <provider> and check it has the right scope/plan. |
| Ollama not reachable | Start Ollama and pull a model; confirm with agentnode auth test ollama. AgentNode never starts it for you. |
| Wrong default provider | Set it explicitly: agentnode config set llm.default_provider <name>. |
| Model unavailable | The provider default may not exist on your plan; set a default_model under llm.providers.<name>. |
| Env var overrides a saved key | Environment variables always win over the vault. Unset the variable, or check agentnode auth status for the effective source. |
Related
- Credentials & Connectors — vault storage, env precedence, connector secrets.
- LLM Runtime — how agents call models (AgentNodeRuntime, meta-tools, tool loop).
- Quick Start — install, set up, and run your first capability.
- Execution Sandbox — how untrusted code is isolated from your keys.
- Agents — agent tiers and
llm_access.