Claude模型切换器 - 在不同的Claude模型之间自由切换
Project description
Claude模型切换器
一个简单的工具,用于在不同的Claude模型之间自由切换。
功能特性
- 支持多种Claude模型切换
- 可配置的模型参数
- 命令行界面操作
- 交互式菜单选择
- 支持Kimi、DeepSeek等第三方模型API
安装
从PyPI安装(推荐):
pip install claude-switcher
或使用uv安装:
uv pip install claude-switcher
从源码安装(开发模式):
pip install -e .
使用方法
安装后,你可以使用 claude-switch 命令来启动工具。
交互式菜单(无参数运行)
claude-switch
直接选择模型运行
claude-switch kimi
或
claude-switch deepseek
支持的模型
目前支持以下模型配置:
- Kimi (
kimi) - Moonshot API - DeepSeek (
deepseek) - DeepSeek API - 以及其他在配置文件中定义的模型
第三方API支持
本工具支持通过Anthropic兼容的API端点访问第三方AI模型,例如:
- Kimi (Moonshot API)
- DeepSeek (DeepSeek API)
- 以及其他兼容Anthropic API格式的模型
配置文件
模型配置存储在用户主目录下的 ~/.claude_switcher/claude_models.json 文件中。首次运行时会自动创建默认配置模板,您需要编辑该文件填入API密钥等信息。
项目结构
claude_switcher/
├── main.py # 主入口文件
├── pyproject.toml # 项目配置
├── README.md # 项目说明
├── launcher/ # 启动器模块
│ ├── __init__.py
│ ├── launcher.py # 启动器主类
│ ├── config_handler.py # 配置文件处理器
│ ├── claude_runner.py # Claude运行器
│ └── menu_handler.py # 菜单处理器
└── .gitignore # Git忽略文件
依赖要求
- Python >= 3.11
- Claude Code CLI 工具 (通过 npm 安装:
npm install -g @anthropic-ai/claude-code)
注意:Claude Code CLI 是必须的,因为此工具实际上是设置环境变量来控制Claude命令的行为。
许可证
本项目采用 Apache License 2.0 许可证。详情请参阅 LICENSE 文件。
配置说明
首次运行工具时,会自动创建配置文件 ~/.claude_switcher/claude_models.json,其中包含默认的模型配置模板。你需要:
- 编辑配置文件,将
YOUR_*_API_KEY_HERE替换为真实的API密钥 - 根据需要修改API端点和其他参数
- 保存配置文件后即可使用
每个模型配置包含以下字段:
description: 模型的描述信息env: 环境变量配置,包括API基础URL、认证令牌、超时时间、模型名称等
Project details
Release history Release notifications | RSS feed
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 claude_switcher-0.0.1.tar.gz.
File metadata
- Download URL: claude_switcher-0.0.1.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0a605b0f439c5048b873ece1626285266e63c7799061fc4a58be4e7067e0bd7
|
|
| MD5 |
3be33240238ec01e0fd8924d568aefb0
|
|
| BLAKE2b-256 |
df1a4d1bb70d6755df1abf872d30520b4d6fc3a0715fcaea2b5c3593deda6624
|
File details
Details for the file claude_switcher-0.0.1-py3-none-any.whl.
File metadata
- Download URL: claude_switcher-0.0.1-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c41d56b7b8891309932e86de00fc33734f2a5ca06af71e5a3a40c2a0edbea057
|
|
| MD5 |
064a6b3d9bb84733efe9698d43e20003
|
|
| BLAKE2b-256 |
9bd893f25990829da6771dee45d9b3d45a8ac37950a5bc0a4629c6d1af1ff97d
|