Configuration
AtomCode's config is TOML, supports any number of providers side by side, and lets you switch on the fly. This page explains every field and shows examples for common providers.
Config file location
Default path:
- macOS / Linux / HarmonyOS PC:
~/.atomcode/config.toml - Windows:
%USERPROFILE%\.atomcode\config.toml
You can also use --config /path/to/config.toml to point at any file. On the first run, if the file is missing, the 3-step wizard walks you through initial setup.
Minimal example
default_provider = "deepseek"
[providers.deepseek]
type = "openai"
api_key = "sk-xxxxxxxxxxxxxxxx"
model = "deepseek-chat"
base_url = "https://api.deepseek.com/v1"
context_window = 64000
This config is enough to launch atomcode and start chatting with DeepSeek.
The recommended path is /provider: add a provider account, then add one or more models under it. Protocol, base URL, and API key are shared by the account; model name and context window are stored per model. Legacy [providers.*] entries remain supported and are projected automatically.
Top-level fields
| Field | Type | Description |
|---|---|---|
default_provider | string | Provider used at launch (must match a key under [providers.*]) |
default_workdir | string? | Default working directory. /cd writes back here; restored next launch |
providers | table | Map of provider name to ProviderConfig |
vision_preprocessor_provider | string? | When the main provider can't see images but the user attaches one, forward it to this provider for OCR / description; the result is spliced back into the prompt as text. See Vision preprocessor |
init_prompt_file | string? | UTF-8 file whose requirements are appended to the built-in /init prompt. Relative paths resolve from $ATOMCODE_HOME; maximum size is 64 KiB. This can also be edited in /config. |
ProviderConfig fields
Fields available under each [providers.xxx] table:
| Field | Type | Required | Description |
|---|---|---|---|
type | string | yes | Provider protocol — currently openai, claude, or ollama |
api_key | string? | conditional | API key. Supports literal keys, env var expansion (e.g. $MY_KEY or ${MY_KEY:-default}), direct env var names (e.g. MY_KEY), or omitted/blank fallback to standard env vars (e.g. OPENAI_API_KEY / ANTHROPIC_API_KEY). Optional for ollama. OAuth providers omit this — token read from ~/.atomcode/auth.toml automatically |
model | string | yes | Model name, e.g. deepseek-chat, gpt-4o, claude-sonnet-4-6 |
base_url | string | yes | API base URL, pointing at the actual endpoint. e.g. https://api.deepseek.com/v1, http://localhost:11434 |
context_window | integer | no | Model context window (tokens), default 64000. Default 8000 for ollama |
max_tokens | integer? | no | Max output tokens per response. Defaults to context_window / 4 when unset |
retry_max_attempts | integer? | no | Total attempts in the provider OPEN retry loop; when set, it also caps kernel-owned HTTP 429 recovery (both include the first request). Unset preserves the existing defaults (3 adapter attempts and the kernel's rate-limit safety policy). Set to 1 to disable adapter-level and 429 retries. Must be at least 1. In the account/model schema, set this on the [models."..."] profile because retry behavior is model-specific. |
system_prompt | string? | no | Override the default system prompt. Rarely needed |
user_agent | string? | no | Override the HTTP User-Agent — useful when the upstream blocks the default UA |
Environment Variables & Dynamic API Key Resolution
To avoid storing sensitive credentials in plain text and to share environment variables with other tools, AtomCode supports flexible environment variable syntax in config.toml:
- Environment Variable Expansion (
$VAR/${VAR}):
Supports fallback expressions with default values (e.g.,[providers.my_openai] type = "openai" model = "gpt-4o" api_key = "$MY_OPENAI_KEY" # or "${MY_OPENAI_KEY}" base_url = "https://api.openai.com/v1"api_key = "${MY_KEY:-sk-fallback}"). - Direct Environment Variable Name:
[providers.my_claude] type = "claude" model = "claude-sonnet-4-6" api_key = "ANTHROPIC_API_KEY" # Automatically read from environment variable ANTHROPIC_API_KEY - Automatic Standard Environment Variable Fallback: When
api_keyis omitted or blank, AtomCode automatically checks standard environment variables matching the providertype:openai/openai-compat: readsOPENAI_API_KEYclaude/anthropic: readsANTHROPIC_API_KEYollama: readsOLLAMA_API_KEY- Global fallback: reads
ATOMCODE_API_KEY
Note: The $VAR syntax in config.toml is parsed internally by AtomCode, providing consistent behavior across Windows, macOS, and Linux.
Even when a model advertises 128K+, its effective attention window is usually much smaller. An oversized context triggers "lost in the middle" failures and disables AtomCode's compaction strategy. 64K is empirically the most robust default; bump it yourself if your model is solid at higher values.
Network & proxy
By default AtomCode follows your system's proxy configuration, so it works out of the box behind a corporate proxy. Tune it under [network.proxy]:
[network.proxy]
mode = "follow_system" # default — honor env vars + OS system proxy
# mode = "default_proxy" # use the explicit http/https/all below
# mode = "no_proxy" # force a direct connection
# http = "http://127.0.0.1:7890"
# https = "http://127.0.0.1:7890"
# all = "socks5://127.0.0.1:1080"
# no_proxy = "localhost,127.0.0.1,.internal"
| mode | Behaviour |
|---|---|
follow_system (default) | Honor HTTP_PROXY / HTTPS_PROXY / ALL_PROXY / NO_PROXY; where those are unset, fall back to the OS system proxy (Windows registry / macOS scutil --proxy). |
default_proxy | Use the explicit http / https / all / no_proxy values from this section. |
no_proxy | Force a direct connection, ignoring env vars and the system proxy. |
IPv6 proxy hosts are bracketed automatically (::1 → http://[::1]:8080). If a login attempt fails to connect or times out, the error message points at your proxy / network settings so you can tell a proxy problem apart from bad credentials.
Common provider examples
Claude (Anthropic)
[providers.claude]
type = "claude"
api_key = "sk-ant-..."
model = "claude-sonnet-4-6"
context_window = 128000
OpenAI
[providers.openai]
type = "openai"
api_key = "sk-..."
model = "gpt-4o"
context_window = 128000
DeepSeek
[providers.deepseek]
type = "openai"
api_key = "sk-..."
model = "deepseek-chat"
base_url = "https://api.deepseek.com/v1"
context_window = 64000
Zhipu GLM
[providers.glm]
type = "openai"
api_key = "..."
model = "glm-4-plus"
base_url = "https://open.bigmodel.cn/api/paas/v4"
context_window = 128000
Tongyi Qianwen (Qwen)
[providers.qwen]
type = "openai"
api_key = "sk-..."
model = "qwen-plus"
base_url = "https://dashscope.aliyuncs.com/compatible-mode/v1"
context_window = 128000
SiliconFlow
[providers.siliconflow]
type = "openai"
api_key = "sk-..."
model = "Qwen/Qwen2.5-72B-Instruct"
base_url = "https://api.siliconflow.cn/v1"
Ollama (local)
[providers.ollama]
type = "ollama"
model = "llama3.2"
base_url = "http://localhost:11434"
context_window = 8000
Function-calling support varies a lot across Ollama models; weaker local models may not invoke tools reliably. Prefer the Instruct variants of Qwen2.5 / Llama3.2.
Multiple providers and quick switching
Config files can host any number of providers in parallel:
default_provider = "claude"
[providers.claude]
type = "claude"
api_key = "sk-ant-..."
model = "claude-sonnet-4-6"
[providers.deepseek]
type = "openai"
api_key = "sk-..."
model = "deepseek-chat"
base_url = "https://api.deepseek.com/v1"
[providers.local]
type = "ollama"
model = "qwen2.5:14b"
base_url = "http://localhost:11434"
In the TUI, use /provider to manage provider accounts and their models. Built-in presets fill in the protocol and base URL for vendors such as AtomGit and TaoToken; choose Custom for another endpoint. Use /model to switch the current session and save the selected model as the default for sessions opened later; other already-open sessions are unchanged. The CLI also accepts one-shot overrides:
atomcode --provider deepseek --model deepseek-reasoner
Turn round limit
[coding]
max_rounds = 200
When the limit is reached, the TUI asks whether to continue or stop instead of dropping the task. Set it to 0 for no limit.
Todo eagerness
[tools.todo]
enabled = true
eager = "auto"
eager accepts auto, preferred, or always. Auto adds a stronger first-round reminder for DeepSeek V4 Flash while preserving the normal behavior for other models. Preferred applies that reminder to every model. Always requests todowrite as the first tool of a new task when no active list exists; OpenAI-compatible and Anthropic providers enforce the named choice, while adapters without named-tool selection still receive the imperative reminder. Set enabled = false to remove the tool, prompt guidance, and todo hooks together; restart the current runtime after changing this master switch. ATOMCODE_TODO remains an environment override.
Vision preprocessor
When the active provider's model can't read images (text-only models like DeepSeek-V3 / Kimi) and the user attaches an image, AtomCode doesn't refuse — it forwards the image to a separate "vision preprocessor" provider for OCR + description, then splices the resulting text into the user message before sending to the main model.
To enable: name an image-capable provider key as vision_preprocessor_provider in the config:
default_provider = "deepseek"
vision_preprocessor_provider = "qwen-vl"
[providers.deepseek]
type = "openai"
api_key = "sk-..."
model = "deepseek-chat"
base_url = "https://api.deepseek.com/v1"
[providers.qwen-vl]
type = "openai"
api_key = "sk-..."
model = "Qwen/Qwen3-VL-32B-Instruct"
base_url = "https://api.siliconflow.cn/v1"
qwen-vlmust be an existing key under[providers.*], and its model must support vision input (common ones:Qwen3-VL-*/GLM-4V-*/claude-3+/gpt-4o/gemini-*).- When the active provider can already see images, the preprocessor is skipped — the raw image bytes are sent directly.
- The
/loginflow auto-picks a VL/OCR model from the granted model list and writes this field for you (you can override afterwards). - VL calls use an idle timeout: no total cap as long as the stream keeps producing chunks; the request times out after 30 seconds with no activity. On failure the main model still receives a "vision recognition failed" notice rather than a silent drop.
For usage-level details see Basic Usage · Image attachments / screenshots.
Three ways to edit the config
- Hand-edit — open
~/.atomcode/config.tomlin your favourite editor. /configin the TUI — search and edit safe settings in place. The dynamic Retry attempts (current model) row writesretry_max_attemptsto the active model; press Delete twice to restore the default./providerin the TUI — interactively manage provider accounts and their models; changes are written back to disk.
Next steps
- Login Methods — skip manual key management with AtomGit OAuth.
- Basic Usage — see how CLI flags can override config for one run.