mirror of
https://github.com/usestrix/strix.git
synced 2026-08-23 19:32:37 +02:00
fix(llm): resolve grok/ models to xai/ for LiteLLM metadata
LiteLLM maps xAI models only provider-qualified, so neither "grok/grok-4" nor bare "grok-4" resolves: subscription runs fell back to the generic 200k context window and an 8k output cap instead of Grok's 256k/256k. subscription.litellm_model_name() now owns the routing-prefix -> LiteLLM name mapping (grok/ -> xai/, chatgpt/ -> bare) and context_budget uses it.
This commit is contained in:
@@ -39,6 +39,17 @@ def test_context_window_chatgpt_prefix_skips_provider_auth(
|
||||
context_budget._model_info.cache_clear()
|
||||
|
||||
|
||||
def test_context_window_grok_prefix_resolves_to_xai() -> None:
|
||||
# LiteLLM maps xAI models only provider-qualified: neither "grok/grok-4" nor
|
||||
# bare "grok-4" resolves, so the subscription prefix becomes "xai/".
|
||||
context_budget._model_info.cache_clear()
|
||||
try:
|
||||
assert context_budget.context_window("grok/grok-4") == 256_000
|
||||
assert context_budget.output_limit("grok/grok-4") == 256_000
|
||||
finally:
|
||||
context_budget._model_info.cache_clear()
|
||||
|
||||
|
||||
def test_context_window_unmapped_uses_fallback(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
context_budget._model_info.cache_clear()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user