farion1231 / farion1231/cc-switch

Feature: Vision Proxy — 图片理解模型自动注入回原请求

Open
#5,347 1 comment 0 reactions 0 assignees View on GitHub
stale
Dominant language
Rust
Stars
133k
Forks
9.2k
Avg merge
3d 12h
Merged PRs (30d)
47

Description

### Self Checks / 自检

- [x] I have read the [FAQ](https://github.com/farion1231/cc-switch#faq) section in README.
我已阅读 README 中的[常见问题](https://github.com/farion1231/cc-switch#常见问题)。

- [x] I have searched for [existing issues](https://github.com/farion1231/cc-switch/issues), including closed ones.
我已搜索过[已有的 Issue](https://github.com/farion1231/cc-switch/issues),包括已关闭的。

### Related App / 涉及应用

General / 通用, Claude Code

### Problem or Motivation / 问题或动机

使用不支持图片的纯文本模型(如 DeepSeek V4 Pro、GLM-5.2 等)时,无法发送含图片的请求。即使手动切换到支持图片的模型,图片理解结果也无法自动回到原模型继续对话。

希望 CC Switch 能自动检测请求中的图片,交给专门的图片理解模型处理,再把理解结果注入回原请求。

### Proposed Solution / 建议方案

**Vision Proxy 模式**:请求含图片时自动分流处理:

1. 提取图片内容,单独发送到**图片理解模型**(如 GPT-5.5、Gemini、Qwen-VL 等)
2. 图片理解模型返回描述后,**注入回原请求**(替换原始图片为文本描述)
3. 原请求(文本 + 图片描述)→ 发给**原模型**继续处理

```
请求(文本+图片) → CC Switch
├─ 提取图片 → 图片理解模型 → 返回描述
└─ 文本 + 图片描述 → 原模型(纯文本)
```

配置示例:
```json
{
env: {
ANTHROPIC_VISION_MODEL: gpt-5.5
}
}
```

### Additional Context / 补充信息

- 相关 Issue:#4233 按图片/文字路由到不同模型(简单路由,不涉及理解后注入),#4626 Codex 模型目录配置是否支持图片

### Contribution / 参与贡献

- [x] I am interested in contributing to this feature.
我有兴趣参与开发此功能。

Contributor guide

Open the contributing guide

Research direction

Start by reading related issues #4233 and #4626, then locate the request-routing and provider configuration entry points in the repository. Determine how image-bearing requests, the configured vision model, and the original model are represented. Done means supported image requests are described by the vision model and the resulting text is sent to the original model without breaking ordinary requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
ai, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.