{"record":{"id":"21b46e050f450ba2","repo":"BerriAI/litellm","slug":"ptu-count-must-be-a-positive-integer-no-greater-th","errorCode":null,"errorMessage":"ptu_count must be a positive integer no greater than {self.MAX_PTU_COUNT}","messagePattern":"ptu_count must be a positive integer no greater than (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/types/router.py","lineNumber":198,"sourceCode":"    # per-model-group override for router_settings.enable_tag_filtering; unset\n    # defers to the router-wide default. Checked against any deployment in the\n    # group, so set it consistently across every deployment sharing this\n    # model_name. A request-level enable_tag_filtering=True (from key/team\n    # settings) still wins over this, exactly as it already does over the\n    # router-wide default.\n    enable_tag_filtering: bool | None = None\n\n    def __init__(self, id: str | int | None = None, **params) -> None:\n        if id is None:\n            id = str(uuid.uuid4())  # Generate a UUID if id is None or not provided\n        elif isinstance(id, int):\n            id = str(id)\n        super().__init__(id=id, **params)\n\n    @model_validator(mode=\"after\")\n    def _validate_ptu_bounds(self) -> \"ModelInfo\":\n        if self.ptu_count is not None and not 0 < self.ptu_count <= self.MAX_PTU_COUNT:\n            raise ValueError(f\"ptu_count must be a positive integer no greater than {self.MAX_PTU_COUNT}\")\n        if (\n            self.cost_per_ptu_per_hour is not None\n            and not 0 <= self.cost_per_ptu_per_hour <= self.MAX_COST_PER_PTU_PER_HOUR\n        ):\n            raise ValueError(\n                f\"cost_per_ptu_per_hour must be a finite number between 0 and {self.MAX_COST_PER_PTU_PER_HOUR}\"\n            )\n        start: Final = _as_utc(self.ptu_effective_from)\n        end: Final = _as_utc(self.ptu_effective_to)\n        if start is not None and end is not None and end <= start:\n            raise ValueError(\"ptu_effective_to must be after ptu_effective_from\")\n        return self\n\n    model_config = ConfigDict(extra=\"allow\")\n\n    def __contains__(self, key) -> bool:\n        # Define custom behavior for the 'in' operator\n        return hasattr(self, key)","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/types/router.py#L180-L216","documentation":"Model validator _validate_ptu_bounds on ModelInfo: ptu_count was supplied but is zero, negative, or exceeds MAX_PTU_COUNT. Provisioned-throughput units are capped, so out-of-range counts are rejected at model-registration time.","triggerScenarios":"Thrown at litellm/types/router.py:198 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set ptu_count to an integer between 1 and {self.MAX_PTU_COUNT}."],"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-14T05:17:10.506Z"}