Skip to main content

The model_list array

model_list is an array of model entries in ~/.operator/config.json. The agent references entries by their model_name alias, not by the raw API model identifier.
{
  "model_list": [
    {
      "model_name": "gpt4",
      "model": "openai/gpt-5.2",
      "api_key": "sk-your-openai-key",
      "api_base": "https://api.openai.com/v1"
    }
  ],
  "agents": {
    "defaults": {
      "model_name": "gpt4"
    }
  }
}

Entry fields

model_name
string
required
The alias used throughout the rest of the config to refer to this model. Set agents.defaults.model_name to this value to make the model the default. Multiple entries with the same model_name enable load balancing — Operator selects between them in round-robin order.
model
string
required
The fully qualified model identifier including its protocol prefix, for example openai/gpt-5.2 or anthropic/claude-sonnet-4.6. The protocol prefix determines which provider implementation handles the request. If no prefix is present, openai is assumed.
api_key
string
The API key sent as a Bearer token to the provider. Required for all HTTP-based providers. Not used for OAuth providers such as antigravity and github-copilot.
api_base
string
The base URL for the provider’s API. Each protocol has a built-in default (see the provider table below), so this field is optional when using the official endpoint. Set it to route traffic through a proxy, a self-hosted deployment, or an OpenAI-compatible endpoint.
auth_method
string
Authentication mechanism. Use "oauth" for providers that require OAuth 2.0 login (Antigravity / GitHub Copilot). For Anthropic and OpenAI you can also specify "token" to load credentials from the local auth store (~/.operator/auth.json) instead of an api_key.
proxy
string
Optional HTTP/HTTPS/SOCKS5 proxy URL applied to all requests for this entry. Example: "http://proxy.example.com:3128".
rpm
number
Optional requests-per-minute cap. Operator respects this limit when selecting entries during load balancing.
request_timeout
number
Per-request timeout in seconds. Overrides the global default when set.

Protocol prefix system

The model field uses a protocol/model-identifier format. The protocol prefix routes the request to the correct provider implementation.
ProtocolProviderDefault api_base
openaiOpenAIhttps://api.openai.com/v1
anthropicAnthropichttps://api.anthropic.com/v1
geminiGoogle Gemini (API key)https://generativelanguage.googleapis.com/v1beta
antigravityGoogle Cloud Code Assist (OAuth)— (OAuth, no base URL)
groqGroqhttps://api.groq.com/openai/v1
deepseekDeepSeekhttps://api.deepseek.com/v1
ollamaOllama (local)http://localhost:11434/v1
openrouterOpenRouterhttps://openrouter.ai/api/v1
mistralMistral AIhttps://api.mistral.ai/v1
qwenQwen / Alibaba DashScopehttps://dashscope.aliyuncs.com/compatible-mode/v1
zhipuZhipu AI (GLM)https://open.bigmodel.cn/api/paas/v4
moonshotMoonshot (Kimi)https://api.moonshot.cn/v1
nvidiaNVIDIAhttps://integrate.api.nvidia.com/v1
cerebrasCerebrashttps://api.cerebras.ai/v1
volcengineVolcengine (Doubao)https://ark.cn-beijing.volces.com/api/v3
shengsuanyunShengsuanYunhttps://router.shengsuanyun.com/api/v1
vllmvLLM (local)http://localhost:8000/v1
litellmLiteLLM proxyhttp://localhost:4000/v1
github-copilotGitHub Copilotlocalhost:4321 (gRPC)
claude-cliClaude CLI (subprocess)— (local process)
codex-cliCodex CLI (subprocess)— (local process)
All protocols except anthropic, antigravity, github-copilot, claude-cli, and codex-cli use an OpenAI-compatible HTTP API. Any service that exposes an OpenAI-compatible endpoint works with the openai protocol prefix and a custom api_base.

Provider configuration examples

{
  "model_name": "gpt4",
  "model": "openai/gpt-5.2",
  "api_key": "sk-your-openai-key",
  "api_base": "https://api.openai.com/v1"
}
Get your key at platform.openai.com/api-keys.

Setting the default model

agents.defaults.model_name names the model entry the agent uses by default when no model is specified for a task. It must match a model_name value in model_list.
{
  "agents": {
    "defaults": {
      "model_name": "claude-sonnet-4.6"
    }
  }
}
You can also override this at runtime with the environment variable:
OPERATOR_AGENTS_DEFAULTS_MODEL_NAME=gpt4

Multi-model load balancing

Adding multiple entries that share the same model_name enables automatic load balancing. Operator selects between them using round-robin so that requests are spread across different API keys or endpoints.
{
  "model_list": [
    {
      "model_name": "gpt4-lb",
      "model": "openai/gpt-5.2",
      "api_key": "sk-key1",
      "api_base": "https://api1.example.com/v1"
    },
    {
      "model_name": "gpt4-lb",
      "model": "openai/gpt-5.2",
      "api_key": "sk-key2",
      "api_base": "https://api2.example.com/v1"
    }
  ],
  "agents": {
    "defaults": {
      "model_name": "gpt4-lb"
    }
  }
}
Use load balancing to stay within per-key rate limits or to route traffic across multiple self-hosted inference nodes.

Model fallbacks

You can configure ordered fallback models on agents.defaults for resilience. If the primary model fails, Operator retries with each fallback in sequence:
{
  "agents": {
    "defaults": {
      "model_name": "claude-sonnet-4.6",
      "model_fallbacks": ["gpt4", "gemini-flash"]
    }
  }
}

Build docs developers (and LLMs) love