Skip to main content

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.

ProviderSlugAuthEnv varNotes
OpenAIopenaiAPI keyOPENAI_API_KEYOfficial endpoint
AnthropicanthropicAPI keyANTHROPIC_API_KEYOfficial endpoint
OpenRouteropenrouterAPI keyOPENROUTER_API_KEYGateway to many models; default openai/gpt-4o-mini
DeepSeekdeepseekAPI keyDEEPSEEK_API_KEYOpenAI-compatible; default deepseek-chat
MistralmistralAPI keyMISTRAL_API_KEYOpenAI-compatible; default mistral-small-latest
QwenqwenAPI keyDASHSCOPE_API_KEYAlibaba DashScope (intl); default qwen-plus
GeminigeminiAPI keyGEMINI_API_KEYGoogle OpenAI-compatible endpoint; default gemini-2.0-flash
OllamaollamaNone — 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.

terminal
$ 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 endpoint

Add credentials

Store a key in the credential vault, or export the provider's environment variable (which overrides the vault):

terminal
$ 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.

terminal
$ 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.

~/.agentnode/config.jsonjson
{
  "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

SymptomFix
Provider not configuredRun 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 reachableStart Ollama and pull a model; confirm with agentnode auth test ollama. AgentNode never starts it for you.
Wrong default providerSet it explicitly: agentnode config set llm.default_provider <name>.
Model unavailableThe provider default may not exist on your plan; set a default_model under llm.providers.<name>.
Env var overrides a saved keyEnvironment variables always win over the vault. Unset the variable, or check agentnode auth status for the effective source.