feat: add SiliconFlow provider support

This commit is contained in:
liuzhuoya 2026-04-12 11:22:23 +08:00
parent 10c136f49c
commit 24925d41be
6 changed files with 20 additions and 3 deletions

3
.gitignore vendored
View File

@ -217,3 +217,6 @@ __marimo__/
# Cache
**/data_cache/
results/*
reports/*

View File

@ -242,6 +242,7 @@ def select_llm_provider() -> tuple[str, str | None]:
("xAI", "https://api.x.ai/v1"),
("Openrouter", "https://openrouter.ai/api/v1"),
("Ollama", "http://localhost:11434/v1"),
("SiliconFlow", "https://api.siliconflow.cn/v1"),
]
choice = questionary.select(

View File

@ -8,8 +8,8 @@ load_dotenv()
# Create a custom config
config = DEFAULT_CONFIG.copy()
config["deep_think_llm"] = "gpt-5.4-mini" # Use a different model
config["quick_think_llm"] = "gpt-5.4-mini" # Use a different model
config["deep_think_llm"] = "Qwen/Qwen3.5-122B-A10B" # Use a different model
config["quick_think_llm"] = "Qwen/Qwen3.5-122B-A10B" # Use a different model
config["max_debate_rounds"] = 1 # Increase debate rounds
# Configure data vendors (default uses yfinance, no extra API keys needed)

View File

@ -34,7 +34,7 @@ def create_llm_client(
"""
provider_lower = provider.lower()
if provider_lower in ("openai", "ollama", "openrouter"):
if provider_lower in ("openai", "ollama", "openrouter", "siliconflow"):
return OpenAIClient(model, base_url, provider=provider_lower, **kwargs)
if provider_lower == "xai":

View File

@ -77,6 +77,18 @@ MODEL_OPTIONS: ProviderModeOptions = {
("Qwen3:latest (8B, local)", "qwen3:latest"),
],
},
"siliconflow": {
"quick": [
("Qwen/Qwen3.5-35B-A3B", "Qwen/Qwen3.5-35B-A3B"),
("Qwen/Qwen3.5-27B", "Qwen/Qwen3.5-27B"),
("Qwen/Qwen3.5-122B-A10B", "Qwen/Qwen3.5-122B-A10B"),
],
"deep": [
("Qwen/Qwen3.5-122B-A10B", "Qwen/Qwen3.5-122B-A10B"),
("Pro/zai-org/GLM-5.1", "Pro/zai-org/GLM-5.1"),
("Pro/MiniMaxAI/MiniMax-M2.5", "Pro/MiniMaxAI/MiniMax-M2.5"),
],
},
}

View File

@ -29,6 +29,7 @@ _PROVIDER_CONFIG = {
"xai": ("https://api.x.ai/v1", "XAI_API_KEY"),
"openrouter": ("https://openrouter.ai/api/v1", "OPENROUTER_API_KEY"),
"ollama": ("http://localhost:11434/v1", None),
"siliconflow": ("https://api.siliconflow.cn/v1", "SILICONFLOW_API_KEY"),
}