chatchat
A Python agent runtime: a Team of agents with tools, hooks, skills and
sub-agents — and the LLM client underneath it, speaking two API protocols.
Install
pip install chatchat
Python 3.10 or newer.
Configure
There is no built-in provider list. A provider is a profile — your data, in
~/.chatchat/config.json (CHATCHAT_SECRET_FILE moves the file):
{
"agnes": {
"type": "openai",
"base_url": "https://apihub.agnes-ai.com/v1",
"api_key": "YOUR_API_KEY"
},
"kimi": {
"type": "anthropic",
"base_url": "https://api.moonshot.ai",
"api_key": "YOUR_API_KEY"
}
}
| field | meaning |
|---|---|
type |
the API protocol: openai or anthropic. Selects the request encoding, the SSE parser and the auth header. Required |
base_url |
where to send requests. Required |
api_key |
the credential. Required |
rpm |
optional cap on requests per minute for this provider |
Environment variables override or replace profile entries:
CHATCHAT_<NAME>_API_KEY, CHATCHAT_<NAME>_BASE_URL, CHATCHAT_<NAME>_TYPE.
Or write entries from the command line:
chatchat config --provider agnes --type openai --base-url https://apihub.agnes-ai.com/v1 --api-key YOUR_API_KEY
chatchat config --provider agnes --rpm 60
chatchat config # show the profiles, api keys masked
The file is written 0600, and chatchat config warns when it is readable by
others.
Chat in the terminal
$ chatchat run agnes/agnes-3.0-flash
user> Introduce yourself briefly.
assistant> Hello! I am a large language model ...
user> /exit
The model is one provider/model string. --thinking picks the reasoning
effort (off, low, medium, high, max); --proxy and --timeout apply
to the HTTP client.
A team in the terminal
chatchat team agnes/agnes-3.0-flash --prompt "帮我写一段 DeepSeek 的介绍"
A lead hands work to teammates over the mailbox and writes the final answer.
--no-hooks runs without the configured hooks.
Hooks
chatchat hooks
lists every hook that will run and where it came from: ~/.chatchat/settings.json,
.chatchat/settings.json and .chatchat/settings.local.json.
Examples
Each example is runnable and shows one shape. Every one takes
--model provider/model and defaults to deepseek/deepseek-chat
(examples/tool.py defaults to zhipu/glm-4.7-flash), so either configure a
profile by that name or pass your own.
python examples/client.py --model agnes/agnes-3.0-flash # the client alone: completion and chat
python examples/agent.py --model agnes/agnes-3.0-flash # one agent, no team
python examples/team.py --model agnes/agnes-3.0-flash # lead + teammate over a mailbox
python examples/agenttool.py --model agnes/agnes-3.0-flash # an agent spawning sub-agents
python examples/tool.py --model agnes/agnes-3.0-flash # your own tools and ToolContext
python examples/hooks.py --model agnes/agnes-3.0-flash # hooks around tool calls and turns
python examples/skill.py --model agnes/agnes-3.0-flash # a SKILL.md loaded on demand
How a request is made
Client(model="agnes/agnes-3.0-flash")
│ profile: type, base_url, api_key, rpm
├─ openai.py → POST {base_url}/responses Responses API
└─ anthropic.py → POST {base_url}/v1/messages Messages API
│
▼
SSE → Delta (content, reasoning, tool calls) → one accumulated Message
│
├─ text only → returned as str
└─ tool calls → returned as list[ToolUse]; the caller runs them and
sends the results back in the next call
A call sends the whole conversation each time, with store: false; on the
Responses protocol the model's reasoning is replayed through
reasoning.encrypted_content, and on the Anthropic one message blocks pass
through verbatim while thinking is set per effort. History, compaction and the
tool loop above Client belong to the agent and team layers, not to the
transport.
A third-party endpoint needs no code — only a profile entry. Anything that speaks the Responses or the Anthropic protocol works.
Sponsor
| 公众号 | |
|---|---|
| AliPay | WeChatPay |
Metadata
Release files for chatchat 0.6.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 | Provenance | Actions |
|---|---|---|---|---|
| chatchat-0.6.0.tar.gz | 153.0 kB | Without provenance | Details for chatchat-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chatchat-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for chatchat-0.6.0-py3-none-any.whl |
Total release size: 272.8 kB
Release files / chatchat-0.6.0.tar.gz
| Download URL | chatchat-0.6.0.tar.gz |
|---|---|
| Size | 153.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
013efeea0d82f52334d0422b58baea36a0a24af6f7ba278191b105ecb3a4584a
|
|
BLAKE2b-256 checksum How to use checksums |
9ea98511816a2411e40afe3a096b1e93a2e0dd20d0ac576137393f9f1af8e639
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / chatchat-0.6.0-py3-none-any.whl
| Download URL | chatchat-0.6.0-py3-none-any.whl |
|---|---|
| Size | 119.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
13c44d28a31e09bc6bef9cfb95b70233bd56cad282b06a7a5d6b2ad7cc9fe1a4
|
|
BLAKE2b-256 checksum How to use checksums |
9e3bb4f983f28cc4c3e859ce3340f3da9a56dddb91bb5ac067f6cb916bf68449
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for chatchat 0.6.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.