feat(tui): add SiliconFlow provider#1864
Conversation
Add SiliconFlow (https://siliconflow.com) as a new API provider with OpenAI-compatible /v1/chat/completions endpoint. - Base URL: https://api.siliconflow.com/v1 - Default model: deepseek-ai/DeepSeek-V4-Pro - Supports thinking (reasoning) and cache telemetry - Pass-through model names (no remapping) - Env vars: SILICONFLOW_API_KEY, SILICONFLOW_BASE_URL, SILICONFLOW_MODEL - Provider aliases: siliconflow, sf Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request adds SiliconFlow as a new AI provider, updating configuration files, environment variable handling, and TUI components to support its API. Key updates include the addition of SiliconFlow to provider enums, implementation of its default settings, and integration into the reasoning and telemetry logic. The reviewer recommended updating a stale comment about cache telemetry and including the SiliconFlow-specific default model in the model picker's completion list to improve usability.
| ApiProvider::Deepseek | ||
| | ApiProvider::DeepseekCN | ||
| | ApiProvider::NvidiaNim | ||
| | ApiProvider::SiliconFlow |
| ApiProvider::Openai | ||
| | ApiProvider::Atlascloud | ||
| | ApiProvider::Ollama | ||
| | ApiProvider::SiliconFlow => OFFICIAL_DEEPSEEK_MODELS.to_vec(), |
There was a problem hiding this comment.
For the SiliconFlow provider, it would be beneficial to include its default model (deepseek-ai/DeepSeek-V4-Pro) in the completion list, as it differs from the standard DeepSeek model names used by other providers. This improves the user experience when using the model picker.
ApiProvider::Openai | ApiProvider::Atlascloud | ApiProvider::Ollama => {
OFFICIAL_DEEPSEEK_MODELS.to_vec()
}
ApiProvider::SiliconFlow => {
let mut models = OFFICIAL_DEEPSEEK_MODELS.to_vec();
models.push(DEFAULT_SILICONFLOW_MODEL);
models
}|
Independent review: PR #1864 and sister PR #1868 share the same base commit (
1868 is the more complete implementation. Both will need rebase regardless. v0.8.48 (#2256) compatibility: conflicts — 9-file conflict surface against the v0.8.48 provider refactor. Recommend close 1864 as duplicate-of-#1868 and rebase 1868 atop v0.8.48 once it lands. |
|
@qychen2001 — thanks for the SiliconFlow contribution. PR #1868 (Lee-take) is a sibling implementation of the same provider, larger scope (15 files vs 11), and includes README + Direction-wise: rather than merge both, we'll likely consolidate on #1868 as the more complete version. If there's something specific to your implementation that #1868 missed — a default endpoint, an env var alias, a model in the registry — point it out on #1868 and we'll fold it in with co-authorship. Otherwise the SiliconFlow surface ships either way and your filing helped surface the demand for it. |
Add SiliconFlow (https://siliconflow.com) as a new API provider with OpenAI-compatible /v1/chat/completions endpoint.
Summary
Testing
cargo test --all-featurescargo fmt --all -- --checkcargo clippy --all-targets --all-featuresChecklist