{"record":{"id":"16ce8d8ab5dde3e2","repo":"BerriAI/litellm","slug":"validation-error","errorCode":"validation_error","errorMessage":"complexity_router_config is invalid at {location}: {first.get('msg', 'invalid value')}. The router would drop this deployment at load time, so the write is rejected instead.","messagePattern":"complexity_router_config is invalid at (.+?): (.+?)\\. The router would drop this deployment at load time, so the write is rejected instead\\.","errorType":"validation","errorClass":"ProxyException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/model_management_endpoints.py","lineNumber":237,"sourceCode":"    if incoming_params.model is None:\n        return None\n    present_fields: Final = frozenset(\n        field\n        for field in STRATEGY_ROUTER_PARAM_FIELDS\n        for source in (incoming_params, existing_params)\n        if source is not None and getattr(source, field, None) is not None\n    )\n    return validate_strategy_router_model_write(model=incoming_params.model, present_fields=present_fields)\n\n\ndef _raise_on_strategy_router_write_violation(\n    incoming_params: GenericLiteLLMParams | None,\n    existing_params: GenericLiteLLMParams | None,\n) -> None:\n    violation = _strategy_router_write_violation(incoming_params=incoming_params, existing_params=existing_params)\n    if violation is None:\n        return\n    raise ProxyException(\n        message=violation,\n        type=ProxyErrorTypes.validation_error.value,\n        code=status.HTTP_400_BAD_REQUEST,\n        param=\"litellm_params.model\",\n    )\n\n\n_PTU_MODEL_INFO_FIELDS: Final = (\"ptu_count\", \"cost_per_ptu_per_hour\", \"ptu_effective_from\", \"ptu_effective_to\")\n_PTU_PRICED_PAIR: Final = frozenset({\"ptu_count\", \"cost_per_ptu_per_hour\"})\n\n\ndef _explicitly_cleared_ptu_fields(model_info: ModelInfo | None) -> frozenset[str]:\n    \"\"\"The PTU fields a patch sends as an explicit null, which update_db_model drops.\n\n    Empty while the feature is off, so disabling pauses PTU rather than letting a client\n    that round-trips a model_info blob erase a configuration set up during an earlier opt-in.\n    \"\"\"\n    if model_info is None or not is_ptu_cost_attribution_enabled():","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/model_management_endpoints.py#L219-L255","documentation":"Error \"complexity_router_config is invalid at {location}: {first.get('msg', 'invalid value')}. The router would drop this deployment at load time, so the write is rejected instead.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/model_management_endpoints.py:237 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the complexity_router_config value at the indicated location per the validation message."],"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"}