Bug
_DEFAULT_CONTEXT_LIMITS in headroom/providers/openai_compatible.py hardcodes DeepSeek models at outdated context window sizes:
"deepseek": 32768,
"deepseek-coder": 16384,
"deepseek-v2": 128000,
"deepseek-v3": 128000,
DeepSeek V3 (and V4) supports 1,048,576 tokens (1M context). The hardcoded 128K causes Headroom to trigger compression far too early — at 128K instead of letting the full 1M window be utilized.
Impact
When using Headroom as a proxy in front of DeepSeek (directly or via a router like Manifest), the proxy compresses messages once they exceed ~128K tokens. This defeats the purpose of using a long-context model — users pay for 1M context but only get 128K before compression kicks in.
Additionally, the fallback for unknown model names is 128K (return 128000). This means any routing proxy that sends model names like auto will also be capped at 128K regardless of the downstream model.
Suggested Fix
- Update
_DEFAULT_CONTEXT_LIMITS:
"deepseek": 1048576, # V3/V4 family default
"deepseek-coder": 128000, # DeepSeek Coder V2+
"deepseek-v2": 128000, # V2 remains 128K
"deepseek-v3": 1048576, # 1M context
"deepseek-v4": 1048576, # 1M context
- Consider a mechanism to override the fallback default (128K) or allow per-request
context_limit / token_budget hints so routing proxies can signal the true downstream context window.
Environment
- Headroom version: 0.23.0
- Provider: OpenAI-compatible (custom endpoint via Manifest router)
- Model: DeepSeek V3 / V4 Flash (routed as
auto)
Workaround
Manually patching _DEFAULT_CONTEXT_LIMITS in site-packages and adding "auto": 1048576 for router model aliases.
Bug
_DEFAULT_CONTEXT_LIMITSinheadroom/providers/openai_compatible.pyhardcodes DeepSeek models at outdated context window sizes:DeepSeek V3 (and V4) supports 1,048,576 tokens (1M context). The hardcoded 128K causes Headroom to trigger compression far too early — at 128K instead of letting the full 1M window be utilized.
Impact
When using Headroom as a proxy in front of DeepSeek (directly or via a router like Manifest), the proxy compresses messages once they exceed ~128K tokens. This defeats the purpose of using a long-context model — users pay for 1M context but only get 128K before compression kicks in.
Additionally, the fallback for unknown model names is 128K (
return 128000). This means any routing proxy that sends model names likeautowill also be capped at 128K regardless of the downstream model.Suggested Fix
_DEFAULT_CONTEXT_LIMITS:context_limit/token_budgethints so routing proxies can signal the true downstream context window.Environment
auto)Workaround
Manually patching
_DEFAULT_CONTEXT_LIMITSin site-packages and adding"auto": 1048576for router model aliases.