Skip to content

feat(tui): add SiliconFlow provider#1864

Open
qychen2001 wants to merge 1 commit into
Hmbown:mainfrom
qychen2001:main
Open

feat(tui): add SiliconFlow provider#1864
qychen2001 wants to merge 1 commit into
Hmbown:mainfrom
qychen2001:main

Conversation

@qychen2001
Copy link
Copy Markdown

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

Summary

Testing

  • cargo test --all-features
  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features

Checklist

  • Updated docs or comments as needed
  • Added or updated tests where relevant
  • Verified TUI behavior manually if UI changes

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>
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread crates/tui/src/config.rs
ApiProvider::Deepseek
| ApiProvider::DeepseekCN
| ApiProvider::NvidiaNim
| ApiProvider::SiliconFlow
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment on line 304 is now outdated as it doesn't mention SiliconFlow. It should be updated to: // Cache telemetry: returned only by DeepSeek-native, NVIDIA NIM, and SiliconFlow endpoints.

Comment thread crates/tui/src/config.rs
Comment on lines +436 to +439
ApiProvider::Openai
| ApiProvider::Atlascloud
| ApiProvider::Ollama
| ApiProvider::SiliconFlow => OFFICIAL_DEEPSEEK_MODELS.to_vec(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants