Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
feat: add SiliconFlow provider support
Zhiwei Li66cd21e6eccd
diff --git a/nanobot/config/schema.py b/nanobot/config/schema.pyindex 60bbc6937..6140a6532 100644--- a/nanobot/config/schema.py+++ b/nanobot/config/schema.py@@ -192,6 +192,7 @@ class ProvidersConfig(BaseModel):moonshot: ProviderConfig = Field(default_factory=ProviderConfig)minimax: ProviderConfig = Field(default_factory=ProviderConfig)aihubmix: ProviderConfig = Field(default_factory=ProviderConfig) # AiHubMix API gateway+ siliconflow: ProviderConfig = Field(default_factory=ProviderConfig) # 硅基流动 API gatewayclass GatewayConfig(BaseModel):diff --git a/nanobot/providers/registry.py b/nanobot/providers/registry.pyindex b9071a0c1..bf00e31a9 100644--- a/nanobot/providers/registry.py+++ b/nanobot/providers/registry.py@@ -117,6 +117,27 @@ PROVIDERS: tuple[ProviderSpec, ...] = (model_overrides=(),),+ # SiliconFlow (硅基流动): OpenAI-compatible gateway hosting multiple models.+ # strip_model_prefix=False: SiliconFlow model names include org prefix+ # (e.g. "Qwen/Qwen2.5-14B-Instruct", "deepseek-ai/DeepSeek-V3")+ # which is part of the model ID and must NOT be stripped.+ ProviderSpec(+ name="siliconflow",+ keywords=("siliconflow",),+ env_key="OPENAI_API_KEY", # OpenAI-compatible+ display_name="SiliconFlow",+ litellm_prefix="openai", # → openai/{model}+ skip_prefixes=(),+ env_extras=(),+ is_gateway=True,+ is_local=False,+ detect_by_key_prefix="",+ detect_by_base_keyword="siliconflow",+ default_api_base="https://api.siliconflow.cn/v1",+ strip_model_prefix=False,+ model_overrides=(),+ ),+# === Standard providers (matched by model-name keywords) ===============# Anthropic: LiteLLM recognizes "claude-*" natively, no prefix needed.