{"record":{"id":"d4c0dd2e066ab9ad","repo":"sgl-project/sglang","slug":"quality-must-be-one-of-list-quality-levels-got","errorCode":null,"errorMessage":"quality must be one of {list(QUALITY_LEVELS)}, got {quality!r}","messagePattern":"quality must be one of (.+?), got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/release_metadata.py","lineNumber":157,"sourceCode":"\nclass MiniMaxH3PartitionAdmissionStage(PipelineStage):\n    def __init__(self, metadata: MiniMaxH3ReleaseMetadata) -> None:\n        super().__init__()\n        self.metadata = metadata\n\n    def forward(self, batch: Req, server_args: ServerArgs) -> Req:\n        task = None if batch.sampling_params is None else batch.sampling_params.task\n        if not isinstance(task, str) or not task.strip():\n            raise ValueError(\"MiniMax H3 request task must be a non-empty string\")\n        self.metadata.canonical_task(task)\n        if batch.num_inference_steps < 2:\n            raise ValueError(\n                \"MiniMax H3 requires num_inference_steps >= 2 because its \"\n                \"video/audio sigma schedules include both interval endpoints\"\n            )\n        quality = getattr(batch.sampling_params, \"quality\", \"lossless\")\n        if quality not in QUALITY_LEVELS:\n            raise ValueError(\n                f\"quality must be one of {list(QUALITY_LEVELS)}, got {quality!r}\"\n            )\n        high_quality = quality == \"high\"\n        if high_quality and not batch.is_warmup:\n            server_args.pipeline_config.validate_quality_deployment(server_args)\n            plan = minimax_h3_plan_from_batch(batch)\n            if plan is None:\n                raise ValueError(\n                    'MiniMax-H3 quality=\"high\" requires a resolved request plan'\n                )\n            shape = plan.shape\n            actual = {\n                \"task\": plan.task,\n                \"width\": int(shape[\"width\"]),\n                \"height\": int(shape[\"height\"]),\n                \"fps\": int(shape[\"fps\"]),\n                \"frame_count\": int(shape[\"frame_count\"]),\n                \"num_inference_steps\": int(batch.num_inference_steps),","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/release_metadata.py#L139-L175","documentation":"The admission stage validates the optional sampling_params.quality attribute (defaulting to \"lossless\") against QUALITY_LEVELS. Any value outside that set (e.g. \"medium\", \"ultra\") is rejected before planning.","triggerScenarios":"Setting sampling_params.quality to a string not in QUALITY_LEVELS (typically only \"lossless\" and \"high\") on a MiniMax H3 request.","commonSituations":"Clients porting quality knobs from other models (\"standard\"/\"fast\"), or typos like \"High\" with capitalization.","solutions":["Use one of the values in QUALITY_LEVELS, e.g. \"lossless\" or \"high\"","Omit quality entirely to get the \"lossless\" default","Check QUALITY_LEVELS in this module for the exact accepted spelling"],"exampleFix":"# before\nsampling_params.quality = \"medium\"\n# after\nsampling_params.quality = \"high\"  # or omit for \"lossless\"","handlingStrategy":"validation","validationCode":"from ... import QUALITY_LEVELS\nq = getattr(sampling_params, \"quality\", \"lossless\")\nif q not in QUALITY_LEVELS:\n    reject(f\"quality must be one of {QUALITY_LEVELS}\")","typeGuard":"def quality_ok(sp) -> bool:\n    return getattr(sp, \"quality\", \"lossless\") in QUALITY_LEVELS","tryCatchPattern":null,"preventionTips":["Expose only accepted quality values in client SDKs","Treat quality as an enum, not free text"],"tags":["minimax-h3","quality-level","request-validation","sampling-params"],"backgroundTag":"invalid-request-parameter","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}