qinyu765/dsh-llm-auto-route0

dsh-llm-auto-route

Provider discovery, matching, health checks, and pre-output failover for DeepSeek Harness.

AI 분석

核心用途是提高大模型API调用的可用性与灵活性。适合配置了多个API端点、需要自动测速、健康检查及多通道容灾备份的开发者。

패키지
dsh-llm-auto-route
버전
0.1.0
라이선스
MIT
최근 업데이트
2026. 8. 14.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:qinyu765/dsh-llm-auto-route

Configuration

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:

FieldMeaning
providerRegistered route id to return; defaults to the routes key.
apiKeyEnvNon-empty environment variable used as a provider-env signal and for discovery.
baseURL / baseURLEnvExact or user-supplied endpoint hint. baseURLEnv also supports unknown OpenAI-compatible hosts.
baseURLPatternsAdditional normalized URL prefixes.
portsLocal ports that identify this route when a base URL is supplied.
modelPrefixesModel id prefixes for automatic selection.
defaultModelModel to use when the request does not name one.
priorityTie 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.