Chat Table
交互式大模型任务路由工具,通过浏览器界面选择 Provider/模型、执行任务、统计 Token 费用。
支持 Provider:Kimi · Qwen (通义千问) · OpenAI · Anthropic (Claude) · DeepSeek · Gemini
快速开始
安装
pip install chat-table
或者开发模式(修改代码后实时生效):
git clone https://github.com/myinxd/chat-table.git
cd chat-table
pip install -e .
用 QClaw / Agent 安装(推荐在另一台机器)
如果你使用 QClaw(或任何装载了 chat-table-toolkit 技能的 Agent),无需手动敲命令。直接对 Agent 说:
安装 chat-table
Agent 会自动:检测 Python ≥ 3.10 → 安装 chat-table(优先从 PyPI,失败回退 GitHub)→ 引导你填写各 Provider 的 API Key → 以 --open 启动服务 → 告诉你打开 http://localhost:8877。
这是在全新机器上最省事的搭建方式。
📦 QClaw 技能文件位于仓库
skills/chat-table-toolkit/SKILL.md。在另一台机器的 QClaw 中,把它复制到~/.qclaw/skills/chat-table-toolkit/即可让 Agent 识别「安装 chat-table」指令。
💡 本项目源码托管在 GitHub(
myinxd/chat-table),安装包发布在 PyPI(pip install chat-table)。往 GitHub 打 tag 推送会由 GitHub Actions 自动构建并发布到 PyPI,两者相互独立。
启动
# 默认端口 8877,数据存 ~/.model_router/
chat-table
# 指定端口 + 项目级数据目录(每个项目独立会话)
chat-table -p 8878 -d ~/projects/my-project/.model_router
# 启动后自动打开浏览器
chat-table --open
然后浏览器打开 http://localhost:8877 即可。
功能
- 🌐 多 Provider 切换:Kimi / Qwen / OpenAI / Claude / DeepSeek / Gemini
- 💬 多轮会话:发送消息自动携带上下文
- ⚡ 多任务并发:最多同时跑 3 个任务
- 📊 Token 统计:输入/输出 tokens、用量费用
- ↩️ History 恢复:从历史记录恢复某个会话继续对话
- 💾 持久化:会话自动保存到
~/.model_router/state.json,重启不丢 - 🎨 轻量 Web UI:点击选模型、发送任务、查看用量,无需命令行
数据目录
默认存 ~/.model_router/:
~/.model_router/
└── state.json # 会话历史、消息、usage 统计
指定 --data-dir 可为每个项目分配独立数据目录,互不干扰。
API
启动后可通过 HTTP 调用:
# 查看状态
curl http://localhost:8877/api/state
# 发送任务
curl -X POST http://localhost:8877/api/run \
-H "Content-Type: application/json" \
-d '{"prompt": "你好"}'
# 注入 API Key(运行时生效)
curl -X POST http://localhost:8877/api/set-env \
-H "Content-Type: application/json" \
-d '{"KIMI_API_KEY": "sk-xxx"}'
# 恢复历史会话
curl -X POST http://localhost:8877/api/resume-history \
-H "Content-Type: application/json" \
-d '{"id": "t1"}'
# 清空会话
curl -X POST http://localhost:8877/api/clear-messages
配置 API Key
方式一:环境变量(推荐)
export KIMI_API_KEY="sk-xxx"
export DASHSCOPE_API_KEY="sk-xxx"
export OPENAI_API_KEY="sk-xxx"
# ...
chat-table
方式二:Web UI 的 ⚙️ Config 页面直接填入
卸载
pip uninstall chat-table
rm -rf ~/.model_router/
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chat_table-0.1.1.tar.gz.
File metadata
- Download URL: chat_table-0.1.1.tar.gz
- Upload date:
- Size: 25.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a060d8a9735fc519633315407d6ec4aac334edb5475c17b1fd3a83442f879315
|
|
| MD5 |
eef1969bfa08feb06eb67919e04f766b
|
|
| BLAKE2b-256 |
de622808739ea8ff9a2178a4136b882b7192156680c08a4e9c599b56a488d43a
|
Provenance
The following attestation bundles were made for chat_table-0.1.1.tar.gz:
Publisher:
publish.yml on myinxd/chat-table
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chat_table-0.1.1.tar.gz -
Subject digest:
a060d8a9735fc519633315407d6ec4aac334edb5475c17b1fd3a83442f879315 - Sigstore transparency entry: 2569452769
- Sigstore integration time:
-
Permalink:
myinxd/chat-table@dd0d3fe427b2b2076420d8d4cf41d92c51f33c0d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/myinxd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dd0d3fe427b2b2076420d8d4cf41d92c51f33c0d -
Trigger Event:
push
-
Statement type:
File details
Details for the file chat_table-0.1.1-py3-none-any.whl.
File metadata
- Download URL: chat_table-0.1.1-py3-none-any.whl
- Upload date:
- Size: 25.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb21fd949b84389a7e4d347d79d01a3a817ecf6da05adc241c65de1464062fbe
|
|
| MD5 |
0f91e135062cf1f63cb6a418f825c990
|
|
| BLAKE2b-256 |
eb206b1da495ca508688548603ae215d7009f8dbb8e08c86ea7ccc947cacd4a3
|
Provenance
The following attestation bundles were made for chat_table-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on myinxd/chat-table
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chat_table-0.1.1-py3-none-any.whl -
Subject digest:
bb21fd949b84389a7e4d347d79d01a3a817ecf6da05adc241c65de1464062fbe - Sigstore transparency entry: 2569452774
- Sigstore integration time:
-
Permalink:
myinxd/chat-table@dd0d3fe427b2b2076420d8d4cf41d92c51f33c0d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/myinxd
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@dd0d3fe427b2b2076420d8d4cf41d92c51f33c0d -
Trigger Event:
push
-
Statement type: