Metadata-Version: 2.4
Name: acaiagent
Version: 0.3.0
Summary: ACAIAgent — a model-agnostic layer for the Claude Agent SDK. Switch models mid-session without losing context. Bring your own models.
Project-URL: Homepage, https://github.com/arronfly/ACAIAgent
Project-URL: Repository, https://github.com/arronfly/ACAIAgent
Project-URL: Issues, https://github.com/arronfly/ACAIAgent/issues
Author: Yugen Chang
License-Expression: MIT
License-File: LICENSE
Keywords: agent-sdk,anthropic,claude,claude-code,deepseek,glm,llm,minimax,multi-model,qwen,router
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.11
Requires-Dist: claude-agent-sdk
Requires-Dist: python-dotenv>=1.0
Requires-Dist: pyyaml>=6.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# ACAIAgent

[![CI](https://github.com/arronfly/ACAIAgent/actions/workflows/ci.yml/badge.svg)](https://github.com/arronfly/ACAIAgent/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/acaiagent.svg)](https://pypi.org/project/acaiagent/)
[![Python](https://img.shields.io/pypi/pyversions/acaiagent.svg)](https://pypi.org/project/acaiagent/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

**A model-agnostic layer for the [Claude Agent SDK](https://github.com/anthropics/claude-agent-sdk-python). Switch models mid-session without losing context. Bring your own models.**

> ACAIAgent = **A**ny-**C**LI **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](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

```bash
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:

```bash
cp config/models.yaml.example config/models.yaml
```

```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`](config/models.yaml.example) for the full provider list and [`docs/providers.md`](docs/providers.md) for the LiteLLM-proxy path (OpenAI / Gemini / local models).

## Roadmap (v1 is GitHub-first)

- [x] Mid-session model switching, no context loss
- [x] Bring-your-own-models config
- [x] `init` wizard + `doctor` self-check
- [x] 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](LICENSE). The Claude Agent SDK is © Anthropic and governed by its own terms; ACAIAgent is an independent wrapper and is not affiliated with Anthropic.
