qinyu765/dsh-llm-auto-route ↗★ 0
dsh-llm-auto-route
Provider discovery, matching, health checks, and pre-output failover for DeepSeek Harness.
AI 분석
核心用途是提高大模型API调用的可用性与灵活性。适合配置了多个API端点、需要自动测速、健康检查及多通道容灾备份的开发者。
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:qinyu765/dsh-llm-auto-routeConfiguration
The shipped patch contains the default rules. An application can override them through its Cordis configuration:
provider: auto
precedence:
- explicit
- provider_env
- base_url
- model_prefix
healthCheck:
mode: adaptive # off | adaptive | probe
timeoutMs: 3000
cacheTtlMs: 30000
failover:
enabled: true
maxAttempts: 3
diagnostics: info # silent | error | info
routes:
deepseek:
apiKeyEnv: DEEPSEEK_API_KEY
defaultModel: deepseek-chat
priority: 10
openai-compatible:
apiKeyEnv: GATEWAY_API_KEY
baseURLEnv: LLM_BASE_URL
modelPrefixes: [gateway-]
Route fields are hints, not adapter configuration:
| Field | Meaning |
|---|---|
provider | Registered route id to return; defaults to the routes key. |
apiKeyEnv | Non-empty environment variable used as a provider-env signal and for discovery. |
baseURL / baseURLEnv | Exact or user-supplied endpoint hint. baseURLEnv also supports unknown OpenAI-compatible hosts. |
baseURLPatterns | Additional normalized URL prefixes. |
ports | Local ports that identify this route when a base URL is supplied. |
modelPrefixes | Model id prefixes for automatic selection. |
defaultModel | Model to use when the request does not name one. |
priority | Tie breaker within one matching stage; higher wins. |
Do not put an API key directly in route configuration. Use the official adapter's credential reference, normally apiKeyEnv, and keep this plugin's apiKeyEnv aligned with it.