Custom Models
Add custom providers and models (Ollama, vLLM, LM Studio, proxies) via~/.atomic/agent/models.json (legacy ~/.pi/agent/models.json is also read).
Table of Contents
- Minimal Example
- Full Example
- Supported APIs
- Provider Configuration
- Model Configuration
- Overriding Built-in Providers
- Per-model Overrides
- Anthropic Messages Compatibility
- OpenAI Compatibility
Minimal Example
For local models (Ollama, LM Studio, vLLM), onlyid is required per model:
apiKey is required but Ollama ignores it, so any value works.
Some OpenAI-compatible servers do not understand the developer role used for reasoning-capable models. For those providers, set compat.supportsDeveloperRole to false so Atomic sends the system prompt as a system message instead. If the server also does not support reasoning_effort, set compat.supportsReasoningEffort to false too.
You can set compat at the provider level to apply to all models, or at the model level to override a specific model. This commonly applies to Ollama, vLLM, SGLang, and similar OpenAI-compatible servers.
Full Example
Override defaults when you need specific values:/model. Edit during session; no restart needed.
Google AI Studio Example
Usegoogle-generative-ai with a baseUrl to add models from Google AI Studio, including custom Gemma 4 entries:
baseUrl is required when adding custom models to the google-generative-ai API type.
Supported APIs
| API | Description |
|---|---|
openai-completions | OpenAI Chat Completions (most compatible) |
openai-responses | OpenAI Responses API |
anthropic-messages | Anthropic Messages API |
google-generative-ai | Google Generative AI |
api at provider level (default for all models) or model level (override per model).
Provider Configuration
| Field | Description |
|---|---|
baseUrl | API endpoint URL |
api | API type (see above) |
apiKey | API key (see value resolution below) |
headers | Custom headers (see value resolution below) |
authHeader | Set true to add Authorization: Bearer <apiKey> automatically |
models | Array of model configurations |
modelOverrides | Per-model overrides for built-in models on this provider |
Value Resolution
TheapiKey and headers fields support three formats:
- Shell command:
"!command"executes and uses stdout - Environment variable: Uses the value of the named variable
- Literal value: Used directly
models.json, shell commands are resolved at request time. Atomic intentionally does not apply built-in TTL, stale reuse, or recovery logic for arbitrary commands. Different commands need different caching and failure strategies, and Atomic cannot infer the right one.
If your command is slow, expensive, rate-limited, or should keep using a previous value on transient failures, wrap it in your own script or command that implements the caching or TTL behavior you want.
/model availability checks use configured auth presence and do not execute shell commands.
Custom Headers
Model Configuration
| Field | Required | Default | Description |
|---|---|---|---|
id | Yes | — | Model identifier (passed to the API) |
name | No | id | Human-readable model label. Used for matching (--model patterns) and shown in model details/status text. |
api | No | provider’s api | Override provider’s API for this model |
reasoning | No | false | Supports extended thinking |
thinkingLevelMap | No | omitted | Maps Atomic thinking levels to provider values and marks unsupported levels (see below) |
input | No | ["text"] | Input types: ["text"] or ["text", "image"] |
contextWindow | No | 128000 | Context window size in tokens |
maxTokens | No | 16384 | Maximum output tokens |
cost | No | all zeros | {"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0} (per million tokens) |
compat | No | provider compat | Provider compatibility overrides. Merged with provider-level compat when both are set. |
/modeland--list-modelslist entries by modelid.- The configured
nameis used for model matching and detail/status text.
Thinking Level Map
UsethinkingLevelMap on a model to describe model-specific thinking controls. Keys are Atomic thinking levels: off, minimal, low, medium, high, xhigh.
Values are tristate:
| Value | Meaning |
|---|---|
| omitted | Level is supported and uses the provider’s default mapping |
| string | Level is supported and this value is sent to the provider |
null | Level is unsupported and hidden/skipped/clamped away |
compat.reasoningEffortMap should move that mapping to model-level thinkingLevelMap. Use null for levels that should not appear in the UI.
Overriding Built-in Providers
Route a built-in provider through a proxy without redefining models:models array:
- Built-in models are kept.
- Custom models are upserted by
idwithin the provider. - If a custom model
idmatches a built-in modelid, the custom model replaces that built-in model. - If a custom model
idis new, it is added alongside built-in models.
Per-model Overrides
UsemodelOverrides to customize specific built-in models without replacing the provider’s full model list.
modelOverrides supports these fields per model: name, reasoning, input, cost (partial), contextWindow, maxTokens, headers, compat.
Behavior notes:
modelOverridesare applied to built-in provider models.- Unknown model IDs are ignored.
- You can combine provider-level
baseUrl/headerswithmodelOverrides. - If
modelsis also defined for a provider, custom models are merged after built-in overrides. A custom model with the sameidreplaces the overridden built-in model entry.
Anthropic Messages Compatibility
For providers or proxies usingapi: "anthropic-messages", use compat.supportsEagerToolInputStreaming to control Anthropic fine-grained tool streaming compatibility.
By default, Atomic sends per-tool eager_input_streaming: true. If a proxy or Anthropic-compatible backend rejects that field, set supportsEagerToolInputStreaming to false. Atomic will omit tools[].eager_input_streaming and send the legacy fine-grained-tool-streaming-2025-05-14 beta header for tool-enabled requests instead.
| Field | Description |
|---|---|
supportsEagerToolInputStreaming | Whether the provider accepts per-tool eager_input_streaming. Default: true. Set to false to omit that field and use the legacy fine-grained tool streaming beta header on tool-enabled requests. |
supportsLongCacheRetention | Whether the provider accepts Anthropic long cache retention (cache_control.ttl: "1h") when cache retention is long. Default: true. |
OpenAI Compatibility
For providers with partial OpenAI compatibility, use thecompat field.
- Provider-level
compatapplies defaults to all models under that provider. - Model-level
compatoverrides provider-level values for that model.
| Field | Description |
|---|---|
supportsStore | Provider supports store field |
supportsDeveloperRole | Use developer vs system role |
supportsReasoningEffort | Support for reasoning_effort parameter |
supportsUsageInStreaming | Supports stream_options: { include_usage: true } (default: true) |
maxTokensField | Use max_completion_tokens or max_tokens |
requiresToolResultName | Include name on tool result messages |
requiresAssistantAfterToolResult | Insert an assistant message before a user message after tool results |
requiresThinkingAsText | Convert thinking blocks to plain text |
requiresReasoningContentOnAssistantMessages | Include empty reasoning_content on all replayed assistant messages when reasoning is enabled |
thinkingFormat | Use reasoning_effort, openrouter, deepseek, together, zai, qwen, or qwen-chat-template thinking parameters |
cacheControlFormat | Use Anthropic-style cache_control markers on the system prompt, last tool definition, and last user/assistant text content. Currently only anthropic is supported. |
supportsStrictMode | Include the strict field in tool definitions |
supportsLongCacheRetention | Whether the provider accepts long cache retention when cache retention is long: prompt_cache_retention: "24h" for OpenAI prompt caching, or cache_control.ttl: "1h" when cacheControlFormat is anthropic. Default: true. |
openRouterRouting | OpenRouter provider routing preferences. This object is sent as-is in the provider field of the OpenRouter API request. |
vercelGatewayRouting | Vercel AI Gateway routing config for provider selection (only, order) |
openrouter uses reasoning: { effort }. together uses reasoning: { enabled } and also reasoning_effort when supportsReasoningEffort is enabled. qwen uses top-level enable_thinking. Use qwen-chat-template for local Qwen-compatible servers that require chat_template_kwargs.enable_thinking.
cacheControlFormat: "anthropic" is for OpenAI-compatible providers that expose Anthropic-style prompt caching through cache_control markers on text content and tool definitions.
Example: