ACAIAgent
A model-agnostic layer for the Claude Agent SDK. Switch models mid-session without losing context. Bring your own models.
ACAIAgent = Any-CLI AI Agent
Status (v0.1): mid-session model switching verified end-to-end on Zhipu GLM (BigModel) — a fact planted on glm-4.5-air is recalled correctly after switching to glm-5.2 and back, in one session. MiniMax-M3 direct also verified on claude-agent-sdk 0.2.110 (no proxy, no OAuth gate). Other Anthropic-format endpoints should work direct; OpenAI/Gemini/local go through a LiteLLM proxy for format translation — see docs/providers.md.
The problem
The Claude Agent SDK (and Claude Code) is brilliant — but it's welded to one endpoint and a fixed set of model aliases per session. Want to answer a quick question on a cheap model, then switch to a long-context model to read your whole project, then back? You either restart and lose the conversation, or run a resident proxy.
If you're on GLM / Qwen / DeepSeek / MiniMax / a local model — i.e. not the Anthropic-default world — this hurts more, because no single model is always the right one.
The fix
ACAIAgent is a thin wrapper around claude_agent_sdk.query() that puts the model router in your hands:
- 🔄 Switch models mid-conversation, zero context loss —
/model <key>keeps your full history. - 🧩 Bring your own models — any Anthropic-compatible endpoint works out of the box (Claude, GLM, MiniMax, DeepSeek, Qwen…). Non-compatible formats via a LiteLLM proxy.
- ⚙️ Add a model = one line of config, zero code, zero restart.
- 🧠 Model-agnostic cross-session memory (
~/.acaiagent/memory/) — not tied to Claude Code. - 📝 Inherits your project's
CLAUDE.mdand Claude Code skills automatically.
Quickstart
git clone https://github.com/arronfly/ACAIAgent.git
cd ACAIAgent
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
acaiagent init # interactive: pick providers, write config
acaiagent doctor # verify claude CLI + keys + endpoints
acaiagent # start the REPL
Note: the
claude-agent-sdkpackage bundles its ownclaudebinary, so you usually don't need to install anything else.acaiagent doctorverifies it's found.
Then in the REPL:
you: help me refactor this function
acaiagent: ... # uses your default model
you: /model glm-strong # switch to a stronger model — history stays
you: now write the tests for it # continues with full context, on glm-strong
Configure models
Copy the template and edit:
cp config/models.yaml.example config/models.yaml
models:
glm-strong:
base_url: https://open.bigmodel.cn/api/anthropic
model: glm-5.2
auth_env: GLM_AUTH_TOKEN # key read from env / .env, never committed
minimax:
base_url: https://api.minimax.io/anthropic
model: MiniMax-M3
auth_env: MINIMAX_AUTH_TOKEN
default: glm-strong
Add a model = add one entry. That's it. See config/models.yaml.example for the full provider list and docs/providers.md for the LiteLLM-proxy path (OpenAI / Gemini / local models).
Roadmap (v1 is GitHub-first)
- Mid-session model switching, no context loss
- Bring-your-own-models config
-
initwizard +doctorself-check - Model-agnostic memory
- PyPI release + CI matrix (once there are real users)
- Optional LLM-based auto-routing (today: manual
/model+ keyword rules) - Sub-agent multi-model orchestration
- Cost / token dashboard
Why this exists
Built by someone who runs Claude Code on GLM-5.2 because the Anthropic API isn't easy to reach from where I sit. If you're on GLM / Qwen / DeepSeek / MiniMax / a local model, ACAIAgent is for you — dogfooded from exactly that seat.
License
MIT — see LICENSE. The Claude Agent SDK is © Anthropic and governed by its own terms; ACAIAgent is an independent wrapper and is not affiliated with Anthropic.
Metadata
Release files for acaiagent 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| acaiagent-0.3.0.tar.gz | 69.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| acaiagent-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 111.5 kB
Release files / acaiagent-0.3.0.tar.gz
| Download URL | acaiagent-0.3.0.tar.gz |
|---|---|
| Size | 69.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
073af1103acd425760a5117e98e2dc2c86b23029cb782e7166ac8dba7cedb31b
|
|
BLAKE2b-256 checksum How to use checksums |
2e3064a3bf29089d5c6d5ce6b00fb7a9027c7e11e93acf4a0f84100b376c569b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 6, 2026.
Transparency logRelease files / acaiagent-0.3.0-py3-none-any.whl
| Download URL | acaiagent-0.3.0-py3-none-any.whl |
|---|---|
| Size | 42.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad4f7879a02df77b0fc14057d19cba69591c73cf4735cce8cfab8af5a5222a92
|
|
BLAKE2b-256 checksum How to use checksums |
febcf1c5ddfa82b361d62cf7684c69fa6832c6e3c630bdc5e6a3e84d78093407
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 6, 2026.
Transparency log