Skip to main content

ACAIAgent — a model-agnostic layer for the Claude Agent SDK. Switch models mid-session without losing context. Bring your own models.

Project description

ACAIAgent

CI PyPI Python License

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.md and 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-sdk package bundles its own claude binary, so you usually don't need to install anything else. acaiagent doctor verifies 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
  • init wizard + doctor self-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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

acaiagent-0.3.0.tar.gz (69.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

acaiagent-0.3.0-py3-none-any.whl (42.0 kB view details)

Uploaded Python 3

File details

Details for the file acaiagent-0.3.0.tar.gz.

File metadata

  • Download URL: acaiagent-0.3.0.tar.gz
  • Upload date:
  • Size: 69.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for acaiagent-0.3.0.tar.gz
Algorithm Hash digest
SHA256 073af1103acd425760a5117e98e2dc2c86b23029cb782e7166ac8dba7cedb31b
MD5 c5c279329cf50103f121663e814f7c63
BLAKE2b-256 2e3064a3bf29089d5c6d5ce6b00fb7a9027c7e11e93acf4a0f84100b376c569b

See more details on using hashes here.

Provenance

The following attestation bundles were made for acaiagent-0.3.0.tar.gz:

Publisher: publish.yml on arronfly/ACAIAgent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file acaiagent-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: acaiagent-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 42.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for acaiagent-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad4f7879a02df77b0fc14057d19cba69591c73cf4735cce8cfab8af5a5222a92
MD5 0cdab759ead06ce4d42deb61e9f3a399
BLAKE2b-256 febcf1c5ddfa82b361d62cf7684c69fa6832c6e3c630bdc5e6a3e84d78093407

See more details on using hashes here.

Provenance

The following attestation bundles were made for acaiagent-0.3.0-py3-none-any.whl:

Publisher: publish.yml on arronfly/ACAIAgent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page