{"record":{"id":"8c2c9c12295c5202","repo":"BerriAI/litellm","slug":"lar-1-thresholds-must-satisfy-0-low-medium-h","errorCode":null,"errorMessage":"LAR-1 thresholds must satisfy 0 < low < medium < high < 1, got low={low}, medium={medium}, high={high}","messagePattern":"LAR-1 thresholds must satisfy 0 < low < medium < high < 1, got low=(.+?), medium=(.+?), high=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/router_strategy/lar1_routing.py","lineNumber":62,"sourceCode":"def apply_lar1_routing_strategy(\n    router: Router,\n    routing_strategy_args: Mapping[str, object] | None = None,\n) -> None:\n    strategy: Final = LAR1RoutingStrategy(\n        router_instance=router,\n        thresholds=lar1_thresholds_from_args(routing_strategy_args),\n    )\n    router.routing_strategy = \"lar1\"\n    router.set_custom_routing_strategy(strategy)\n\n\ndef _normalize_thresholds(thresholds: dict[str, float] | None) -> dict[str, float]:\n    merged: Final = {**DEFAULT_THRESHOLDS, **(thresholds or {})}\n    low: Final = merged[\"low\"]\n    medium: Final = merged[\"medium\"]\n    high: Final = merged[\"high\"]\n    if not (0 < low < medium < high < 1):\n        raise ValueError(\n            f\"LAR-1 thresholds must satisfy 0 < low < medium < high < 1, got low={low}, medium={medium}, high={high}\"\n        )\n    return merged\n\n\ndef _parse_lar1_metadata(request_kwargs: dict) -> LAR1Metadata:\n    lar1_raw: Final = request_kwargs.get(\"metadata\", {}).get(\"lar1\", {})\n    if not isinstance(lar1_raw, dict):\n        verbose_router_logger.warning(\"[LAR-1] Invalid lar1 metadata type: %s. Using defaults\", type(lar1_raw).__name__)\n        return LAR1Metadata()\n    try:\n        return LAR1Metadata.model_validate(lar1_raw)\n    except ValidationError as exc:\n        verbose_router_logger.warning(\"[LAR-1] Invalid lar1 metadata: %s. Using defaults\", exc)\n        return LAR1Metadata()\n\n\nclass LAR1RoutingStrategy(CustomRoutingStrategyBase):","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/router_strategy/lar1_routing.py#L44-L80","documentation":"Config validation in LAR-1 routing: the low/medium/high latency thresholds merged from routing_strategy_args must be strictly increasing within (0,1); the supplied values violate that ordering, so the strategy cannot bucket latencies.","triggerScenarios":"Thrown at litellm/router_strategy/lar1_routing.py:62 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Adjust LAR-1 thresholds so 0 < low < medium < high < 1."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}