{"record":{"id":"5aeadf9ff4410a34","repo":"BerriAI/litellm","slug":"tier-labels-must-be-a-json-object-of-tier-name-to","errorCode":null,"errorMessage":"tier_labels must be a JSON object of tier name to display name: {e}","messagePattern":"tier_labels must be a JSON object of tier name to display name: (.+?)","errorType":"http","errorClass":"ProxyException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/model_management_endpoints.py","lineNumber":2208,"sourceCode":"        )\n\n\ndef _labeled_tiers_from_query(tier_labels: str | None) -> tuple[tuple[ComplexityTier, str], ...] | None:\n    \"\"\"Resolve the tier_labels query param into the labeled tiers the rubric is built from.\n\n    Validated through ComplexityRouterConfig so the editor prefills what the router would send: the\n    same field validators that reject a blank, duplicated, or canonical-name-stealing label on the\n    write path reject it here, rather than this returning a rubric no router could be configured to\n    use. A malformed value is the caller's error, so it surfaces as a 400.\n\n    None when unset, letting classification_system_prompt apply its own default names.\n    \"\"\"\n    if not tier_labels:\n        return None\n    try:\n        return ComplexityRouterConfig(tier_labels=json.loads(tier_labels)).labeled_tiers()\n    except (JSONDecodeError, ValidationError) as e:\n        raise ProxyException(\n            message=f\"tier_labels must be a JSON object of tier name to display name: {e}\",\n            type=ProxyErrorTypes.bad_request_error,\n            code=status.HTTP_400_BAD_REQUEST,\n            param=\"tier_labels\",\n        ) from e\n\n\n@router.get(\n    \"/auto_router/classifier/default_prompt\",\n    description=\"Get the built-in system prompt used by an auto-router's LLM classifier\",\n    tags=[\"model management\"],  # mutable-ok: fastapi's decorator signature types tags as a list\n    dependencies=[Depends(user_api_key_auth)],  # mutable-ok: fastapi's decorator signature types dependencies as a list\n)\nasync def get_auto_router_classifier_default_prompt(\n    context_window_size: int = DEFAULT_CLASSIFIER_CONTEXT_WINDOW_SIZE,\n    tier_labels: str | None = None,\n    classification_rubric: ClassificationRubric | None = None,\n) -> AutoRouterClassifierDefaultPromptResponse:","sourceCodeStart":2190,"sourceCodeEnd":2226,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/model_management_endpoints.py#L2190-L2226","documentation":"Input guard in _labeled_tiers_from_query: the tier_labels query parameter could not be parsed/validated as a JSON object of tier name to display name via ComplexityRouterConfig. The validators reject blank, duplicated, or canonical-name-stealing labels so the editor cannot prefill a rubric no router would accept; surfaced as a 400.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/model_management_endpoints.py:2208 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass tier_labels as a JSON object mapping tier name to display name."],"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"}