chenyifawan-cell/dsh-litellm-extra-headers ↗★ 0

dsh-litellm-extra-headers

DeepSeek Harness plugin: inject an `extra_headers` entry into the OpenAI-compatible request BODY for model calls routed to listed providers and sent to listed upstream hosts — the only injection point that survives a LiteLLM relay, which drops client HTTP headers. 适合需要穿透LiteLLM等中转网关,向特定上游传递会话标识的开发任务。

패키지
dsh-litellm-extra-headers
호환성
미검증
버전
0.1.0
라이선스
MIT
최근 업데이트
2026. 10. 15.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:chenyifawan-cell/dsh-litellm-extra-headers

配置字段

字段类型默认说明
providersstring[][]llm/stream 的 options.provider 路由键白名单。必须显式列出,匹配大小写不敏感。
hostsstring[][]允许注入的上游 host[:port] 白名单;带 scheme / path 的写法会被归一化(http://litellm.internal:4000/v1 → litellm.internal:4000)。必须显式列出。
headerstringx-opencode-session放进 extra_headers 的字段名。
modesession-id | uuid | fixedsession-id取值来源:DSH 会话 id(跨轮次、跨重启稳定)/每会话一个进程内随机 uuid/配置里的字面量。
valuestring—mode: fixed 时的字面量;fixed 却没给值会在加载时报错。
debugbooleanfalse每次注入决策打一条 ctx.logger.info。
debugFilestring—每次注入决策追加一行 JSON(含 provider / model / session / host / path / event / reason),进程控制台看不到时用它排错。

providers 或 hosts 为空时插件保持惰性并打一条 warning:一个可以共享出去的包,不应该对别人没被告知过的网关偷偷加字段。