Skip to content

[codex] Add SiliconFlow provider support#1868

Open
Lee-take wants to merge 1 commit into
Hmbown:mainfrom
Lee-take:feat/siliconflow-provider
Open

[codex] Add SiliconFlow provider support#1868
Lee-take wants to merge 1 commit into
Hmbown:mainfrom
Lee-take:feat/siliconflow-provider

Conversation

@Lee-take
Copy link
Copy Markdown

Summary

  • Adds SiliconFlow as a first-class provider across CLI, config loading, secrets, TUI selection, docs, and examples.
  • Wires provider defaults, environment variable overrides, model alias normalization, and stored API key lookup.
  • Treats SiliconFlow streamed reasoning content like other DeepSeek-compatible providers.

Fixes #1710

Validation

  • cargo fmt --check
  • git diff --check
  • cargo check -p deepseek-config
  • cargo check -p deepseek-secrets
  • cargo check -p deepseek-tui
  • cargo check -p deepseek-tui-cli
  • cargo test -p deepseek-config siliconflow -- --nocapture
  • cargo test -p deepseek-secrets siliconflow -- --nocapture

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 support for SiliconFlow as a new model provider, updating the CLI, TUI, and documentation to handle SiliconFlow-specific configurations and environment variables. Feedback was provided regarding the model normalization logic to ensure that reasoning-capable models are correctly mapped to the Pro model instead of the Flash model.

Comment thread crates/config/src/lib.rs Outdated
Comment on lines +1226 to +1233
(ProviderKind::Siliconflow, "deepseek-v4-pro" | "deepseek-v4pro") => {
DEFAULT_SILICONFLOW_MODEL.to_string()
}
(
ProviderKind::Siliconflow,
"deepseek-v4-flash" | "deepseek-v4flash" | "deepseek-chat" | "deepseek-reasoner"
| "deepseek-r1" | "deepseek-v3" | "deepseek-v3.2",
) => DEFAULT_SILICONFLOW_FLASH_MODEL.to_string(),
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.

high

The model aliases deepseek-reasoner and deepseek-r1 should be mapped to the Pro model (DEFAULT_SILICONFLOW_MODEL) rather than the Flash model, as they represent reasoning-capable models. Additionally, deepseek-v3.2 appears to be a typo for deepseek-v3 (which is already present) or perhaps deepseek-v2.5.

Suggested change
(ProviderKind::Siliconflow, "deepseek-v4-pro" | "deepseek-v4pro") => {
DEFAULT_SILICONFLOW_MODEL.to_string()
}
(
ProviderKind::Siliconflow,
"deepseek-v4-flash" | "deepseek-v4flash" | "deepseek-chat" | "deepseek-reasoner"
| "deepseek-r1" | "deepseek-v3" | "deepseek-v3.2",
) => DEFAULT_SILICONFLOW_FLASH_MODEL.to_string(),
(
ProviderKind::Siliconflow,
"deepseek-v4-pro" | "deepseek-v4pro" | "deepseek-reasoner" | "deepseek-r1",
) => DEFAULT_SILICONFLOW_MODEL.to_string(),
(
ProviderKind::Siliconflow,
"deepseek-v4-flash" | "deepseek-v4flash" | "deepseek-chat" | "deepseek-v3",
) => DEFAULT_SILICONFLOW_FLASH_MODEL.to_string(),

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed in 89aa47a2.

  • deepseek-reasoner and deepseek-r1 now map to DEFAULT_SILICONFLOW_MODEL.
  • deepseek-v3.2 is no longer treated as a SiliconFlow Flash alias; it is preserved as an explicit model value.
  • Added config tests for both behaviors.

Validation: cargo test -p deepseek-config siliconflow -- --nocapture, cargo check -p deepseek-config, cargo check -p deepseek-tui-cli.

@Lee-take Lee-take force-pushed the feat/siliconflow-provider branch from cdab5da to 89aa47a Compare May 21, 2026 07:14
@Lee-take
Copy link
Copy Markdown
Author

Addressed the SiliconFlow model alias feedback in the latest push:

  • deepseek-reasoner and deepseek-r1 now normalize to the Pro model (DEFAULT_SILICONFLOW_MODEL).
  • deepseek-v3.2 is no longer remapped to Flash for SiliconFlow; unknown DeepSeek versions are preserved.
  • Added targeted config tests for both behaviors.

Validation:

  • cargo fmt --check
  • cargo test -p deepseek-config siliconflow -- --nocapture
  • cargo check -p deepseek-config
  • git diff --check
  • cargo check -p deepseek-tui-cli

@Lee-take Lee-take marked this pull request as ready for review May 21, 2026 07:19
@Hmbown Hmbown added this to the v0.8.46 milestone May 21, 2026
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.

Add SiliconFlow as a built-in provider

2 participants