Skip to content

feat: add Atomic Chat as local OpenAI-compatible provider - #414

Open
yanalialiuk wants to merge 1 commit into
bytedance:mainfrom
yanalialiuk:main
Open

feat: add Atomic Chat as local OpenAI-compatible provider#414
yanalialiuk wants to merge 1 commit into
bytedance:mainfrom
yanalialiuk:main

Conversation

@yanalialiuk

Copy link
Copy Markdown

Description

Adds a first-class atomic_chat LLM provider for Atomic Chat — a local desktop app that exposes an OpenAI-compatible HTTP API (default http://127.0.0.1:1337/v1).

Users can run Trae Agent against locally loaded models without cloud API keys. The client uses the same Chat Completions flow as other OpenAI-compatible providers (e.g. OpenRouter, Doubao), not the Ollama-native SDK path.

More Information

Changes

Area Change
trae_agent/utils/llm_clients/atomic_chat_client.py New AtomicChatClient + AtomicChatProvider with defaults: base URL http://127.0.0.1:1337/v1, API key noop
trae_agent/utils/llm_clients/llm_client.py Register LLMProvider.ATOMIC_CHAT (atomic_chat) in the provider switch
trae_config.json.example / trae_config.yaml.example Example provider + model entries
docs/atomic_chat.md Setup, CLI, JSON/YAML config, troubleshooting
README.md CLI example for --provider atomic_chat
tests/utils/test_atomic_chat_client_utils.py Unit tests for defaults, provider wiring, tool-calling heuristic; optional live test behind SKIP_ATOMIC_CHAT_TEST

Design notes

  • OpenAI-compatible: Atomic Chat implements /v1/chat/completions, so OpenAICompatibleClient is reused instead of adding a separate protocol stack.
  • Tool calling: supports_tool_calling() uses name heuristics (qwen, llama, gemma, etc.); can be overridden via supports_tool_calling: false in YAML model config.
  • Env overrides: ATOMIC_CHAT_API_KEY and ATOMIC_CHAT_BASE_URL follow the existing resolve_config_value pattern ({PROVIDER}_API_KEY / {PROVIDER}_BASE_URL).

Impact

  • No breaking changes to existing providers.
  • New provider id: atomic_chat

Validation

Prerequisites

  1. Install Atomic Chat and load a model.
  2. Enable the local API server (default port 1337).
  3. Python ≥ 3.12 and project deps (uv sync or equivalent).
curl http://127.0.0.1:1337/v1/models
# Note a model id from the response (e.g. gemma-4-E4B-it-IQ4_XS)

Unit tests

cd trae-agent
uv run python -m unittest tests.utils.test_atomic_chat_client_utils.TestAtomicChatClient -v

Expected: default base URL/API key, LLMProvider.ATOMIC_CHAT wiring, tool-calling heuristic pass.

CLI

trae-cli run "Reply with ok" \
  --provider atomic_chat \
  --model <your-model-id> \
  --model-base-url http://127.0.0.1:1337/v1

Config files

  • Copy the atomic_chat entries from trae_config.json.example and trae_config.yaml.example.
  • See docs/atomic_chat.md for full YAML agent wiring.

Add atomic_chat provider for Atomic Chat's local API (default
http://127.0.0.1:1337/v1), config examples, docs, and unit tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@CLAassistant

CLAassistant commented May 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants