Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/skillspector/providers/nv_build/model_registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,17 @@

models:
# NVIDIA-curated NIMs on build.nvidia.com.
# 202749 e' il tetto COMBINATO ingresso+uscita che l'endpoint impone, ed e' riportato
# alla lettera nel 400 che restituisce quando lo si supera. Dichiarando la finestra
# nominale di 1000000, model_info calcolava un budget d'uscita di 250000 token
# (ctx * (1 - MAX_INPUT_TOKENS_PCT)) e OGNI chiamata falliva:
# "This model configuration accepts at most 202749 combined input and output tokens.
# However, your request has 1249 input tokens and asks for 250000 output tokens"
# Una finestra sovrastimata non degrada con grazia: azzera lo stadio LLM. Sottostimare
# e' sicuro, sovrastimare no.
"z-ai/glm-5.2":
context_length: 1000000
context_length: 202749
max_output_tokens: 32768

"z-ai/glm-5.1":
context_length: 205000
Expand Down
14 changes: 12 additions & 2 deletions tests/unit/test_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,25 @@ class TestNvBuildProvider:
@pytest.mark.parametrize(
("model", "context_length"),
[
("z-ai/glm-5.2", 1_000_000),
("z-ai/glm-5.2", 202_749),
("z-ai/glm-5.1", 205_000),
("moonshotai/kimi-k2.6", 256_000),
],
)
def test_nv_build_reported_model_metadata(self, model: str, context_length: int) -> None:
provider = NvBuildProvider()
assert provider.get_context_length(model) == context_length
assert provider.get_max_output_tokens(model) is None

def test_glm_declares_both_limits(self) -> None:
"""max_output_tokens is optional, and its absence is not neutral.

Without it the output budget is derived as a percentage of the context
window, which is what produced a 250_000-token request against an
endpoint accepting 202_749 combined.
"""
provider = NvBuildProvider()
assert provider.get_context_length("z-ai/glm-5.2") == 202_749
assert provider.get_max_output_tokens("z-ai/glm-5.2") == 32_768

@pytest.mark.parametrize("model", ["glm-5.2", "z-ai/glm-5.2 "])
def test_nv_build_model_near_match_stays_unresolved(self, model: str) -> None:
Expand Down
Loading