经 AI Skill Hub 精选评估,AI代理工具 获评「推荐使用」。这款AI工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.5 分,适合有一定技术背景的用户使用。
轻量级本地AI代理,支持第三方LLM API
AI代理工具 是一款基于 Go 开发的开源工具,专注于 AI、代理、LLM 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
轻量级本地AI代理,支持第三方LLM API
AI代理工具 是一款基于 Go 开发的开源工具,专注于 AI、代理、LLM 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:go install(推荐) go install github.com/keepmind9/ai-switch@latest # 方式二:从源码编译 git clone https://github.com/keepmind9/ai-switch cd ai-switch go build -o ai-switch . # 方式三:下载预编译二进制 # 访问 Releases 页面下载对应平台二进制文件 # https://github.com/keepmind9/ai-switch/releases
# 查看帮助 ai-switch --help # 基本运行 ai-switch [options] <input> # 详细使用说明请查阅文档 # https://github.com/keepmind9/ai-switch
# ai-switch 配置说明 # 查看配置选项 ai-switch --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export AI_SWITCH_CONFIG="/path/to/config.yml"
Local LLM proxy — let Claude Code, Cursor, Codex CLI use any AI provider.
One binary. One config. Any AI CLI → any LLM API.
Linux / macOS:
curl -sL https://raw.githubusercontent.com/keepmind9/ai-switch/main/scripts/install.sh | bash
Windows (PowerShell):
irm https://raw.githubusercontent.com/keepmind9/ai-switch/main/scripts/install.ps1 | iex
Quick Start · Features · Supported Providers & Clients · Configuration · CLI · Admin UI · FAQ
English | 中文
---
🔄 Multi-Protocol Conversion Auto-detect client protocol (Chat / Anthropic / Responses / Gemini) and convert to any upstream format — all 4 protocols, N×N cross-conversion.
🎯 Smart Routing Route requests to different models based on what the AI tool is doing — thinking tasks → DeepSeek, web search → Zhipu, background → lightweight model. Supports scene detection, model name mapping, and cross-provider routing.
🛡️ Reliability Multi-key fallback on 429/529 rate limiting, hot config reload without restart, automatic config backup with one-click restore and corrupt-file auto-recovery.
📊 Observability Built-in Admin UI with provider/route management, per-request tracing (raw viewer, diff view, TTFB waterfall), and token usage statistics with trend charts.
🪶 Lightweight Pure Go, single binary, zero dependencies. No Python, no Docker, no runtime. Download and run.
---
curl -sL https://raw.githubusercontent.com/keepmind9/ai-switch/main/scripts/install.sh | bash
</details>
<details>
<summary>Configure other AI tools</summary>
**Codex CLI:**
toml [model_providers.proxy] name = "ai-switch" base_url = "http://localhost:12345/v1" api_key = "ais-default" wire_api = "responses"
**Cursor / Any OpenAI-compatible tool:**
bash export OPENAI_BASE_URL=http://localhost:12345/v1 export OPENAI_API_KEY=ais-default
**Or use the agent launcher (zero config):**
bash ais agent my-route-key claude # Launch Claude Code ais agent my-route-key codex # Launch Codex CLI ```
</details>
---
make build # fmt + vet + compile
make build-all # build frontend + Go binary
make install # build all + install to ~/.local/bin
make test # run tests
make clean # remove binary
```bash
providers:
deepseek:
name: "DeepSeek"
base_url: "https://api.deepseek.com/v1"
api_key: "${DEEPSEEK_API_KEY}" # supports ${ENV_VAR} expansion
format: "chat" # chat | responses | anthropic | gemini
routes:
"ais-default":
provider: "deepseek"
default_model: "deepseek-chat"
providers:
deepseek:
name: "DeepSeek"
base_url: "https://api.deepseek.com/v1"
api_key: "${DEEPSEEK_API_KEY}"
format: "chat"
think_tag: "think" # optional: strip reasoning tags
fallback_keys: # optional: backup keys for 429 fallback
- "${DEEPSEEK_API_KEY_2}"
models: # optional: for GET /v1/models & validation
- "deepseek-chat"
- "deepseek-reasoner"
enable_proxy: true # optional: use global proxy_url
$ ais check -c config.yaml
Checking config.yaml ...
Providers: 3
Routes: 3
Default: ais-default
✓ Config is valid.
---
Does it support streaming?
Yes — full SSE streaming with protocol conversion. Stream from Anthropic → Chat, Gemini → Responses, any combination.
Can I use it with Cursor / Copilot / ChatGPT-Next-Web?
Yes — any tool that supports OpenAI-compatible API. Just set OPENAI_BASE_URL=http://localhost:12345/v1.
What if my provider isn't listed?
Any OpenAI-compatible API works out of the box. Just add it as a provider with format: "chat".
How does it handle rate limiting?
Configure fallback_keys on your provider — ai-switch automatically switches to the next key on 429/529.
Can different scenes use different providers?
Yes — use scene_map with provider|model syntax to route thinking → DeepSeek, web search → Zhipu, etc.
---
轻量级AI代理工具,支持第三方LLM API
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:AI代理工具 的核心功能完整,质量良好。对于AI 技术爱好者来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | ai-switch |
| 原始描述 | 开源AI工具:A lightweight local AI proxy that lets any AI CLI tool use third-party LLM APIs 。⭐11 · Go |
| Topics | AI代理LLM |
| GitHub | https://github.com/keepmind9/ai-switch |
| License | MIT |
| 语言 | Go |
收录时间:2026-06-05 · 更新时间:2026-06-08 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。