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
}
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