Skip to main content

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 .

启动

# 默认端口 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

chat_table-0.1.0.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

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

chat_table-0.1.0-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file chat_table-0.1.0.tar.gz.

File metadata

  • Download URL: chat_table-0.1.0.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for chat_table-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3e4510abb0e45ba5093dfa3accb6e41fbeb726025441214107f855a7ca27f624
MD5 15182868a939d412257d9eb406f61be0
BLAKE2b-256 e1411a3552c9da311ce0087e86cb3758d758dad53e14a5df3bf17b4a792b00cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for chat_table-0.1.0.tar.gz:

Publisher: publish.yml on myinxd/chat-table

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

File details

Details for the file chat_table-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chat_table-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for chat_table-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2413b17bc5f7e194f14b8b1b6e34af9822501296016c2c98731ebf331e16ac06
MD5 3dd38b6b94cecea51710550366979b5a
BLAKE2b-256 836701ecb826e6acf136a0709c5d224268edc30ef842e2eebafd8d477c0c5333

See more details on using hashes here.

Provenance

The following attestation bundles were made for chat_table-0.1.0-py3-none-any.whl:

Publisher: publish.yml on myinxd/chat-table

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

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

Supported by

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