仓库 →

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:

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.

Provider management in v5.0.7

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

FieldTypeDescription
default_providerstringProvider used at launch (must match a key under [providers.*])
default_workdirstring?Default working directory. /cd writes back here; restored next launch
providerstableMap of provider name to ProviderConfig
vision_preprocessor_providerstring?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_filestring?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:

FieldTypeRequiredDescription
typestringyesProvider protocol — currently openai, claude, or ollama
api_keystring?conditionalAPI 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
modelstringyesModel name, e.g. deepseek-chat, gpt-4o, claude-sonnet-4-6
base_urlstringyesAPI base URL, pointing at the actual endpoint. e.g. https://api.deepseek.com/v1, http://localhost:11434
context_windowintegernoModel context window (tokens), default 64000. Default 8000 for ollama
max_tokensinteger?noMax output tokens per response. Defaults to context_window / 4 when unset
retry_max_attemptsinteger?noTotal 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_promptstring?noOverride the default system prompt. Rarely needed
user_agentstring?noOverride 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:

Note: The $VAR syntax in config.toml is parsed internally by AtomCode, providing consistent behavior across Windows, macOS, and Linux.

Why default to 64K instead of 128K?

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"
modeBehaviour
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_proxyUse the explicit http / https / all / no_proxy values from this section.
no_proxyForce a direct connection, ignoring env vars and the system proxy.

IPv6 proxy hosts are bracketed automatically (::1http://[::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
Heads up

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"

For usage-level details see Basic Usage · Image attachments / screenshots.

Three ways to edit the config

Next steps