sgl-project/sglang · error · ValueError

unsupported MiniMax H3 task {task!r}

Error message

unsupported MiniMax H3 task {task!r}

What it means

After normalization (strip + lower), the task string is looked up in MINIMAX_H3_TASK_PARTITIONS. An unknown task raises ValueError with the original (non-normalized) task in the message, chained from the KeyError. Only tasks with a configured deployment partition are accepted.

Source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/task_profiles.py:56

)


def canonical_minimax_h3_task(task: str) -> str:
    """Normalize a public task name (no aliases are currently defined)."""

    return task


def partition_for_task(task: str) -> str:
    """Return the deployment partition serving *task*."""

    if not isinstance(task, str) or not task.strip():
        raise ValueError("MiniMax H3 task must be a non-empty string")
    normalized = task.strip().lower()
    try:
        return MINIMAX_H3_TASK_PARTITIONS[normalized]
    except KeyError as exc:
        raise ValueError(f"unsupported MiniMax H3 task {task!r}") from exc


MINIMAX_H3_FINITE_ASPECT_RATIOS = (
    "21:9",
    "16:9",
    "4:3",
    "1:1",
    "3:4",
    "9:16",
)

# ``fl2va`` remains the single public task name for all keyframe variants:
# first-frame-only, last-frame-only, and first+last.  Keep the accepted
# semantic signatures centralized so validation and every downstream sink can
# reject middle/reversed/stale payloads consistently.
MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES: tuple[tuple[int, ...], ...] = (
    (0,),
    (-1,),

View on GitHub (pinned to 0132848349)

Solutions

  1. Use one of the supported MiniMax H3 tasks: check MINIMAX_H3_TASK_PARTITIONS keys for the exact set (includes t2va, fl2va, ref2va)
  2. Print sorted(MINIMAX_H3_TASK_PARTITIONS) to see what your version supports
  3. If you need a new task alias, register it in the partition map via the public registration path or request upstream support

Example fix

# before
partition_for_task("t2v")

# after
partition_for_task("t2va")
Defensive patterns

Strategy: type-guard

Validate before calling

from ...task_profiles import MINIMAX_H3_TASK_PARTITIONS
if task.strip().lower() not in MINIMAX_H3_TASK_PARTITIONS:
    raise ValueError(f"pick one of {sorted(MINIMAX_H3_TASK_PARTITIONS)}")

Type guard

def is_supported_task(task: str) -> bool:
    from ...task_profiles import MINIMAX_H3_TASK_PARTITIONS
    return task.strip().lower() in MINIMAX_H3_TASK_PARTITIONS

Try / catch

catch ValueError and present the supported task list to the end user for selection

Prevention

When it happens

Trigger: Calling partition_for_task('t2v') instead of 't2va', 'FL2VA' works (lowercased) but 'image2video', 'i2v', or any typo fails. Also custom task aliases not registered in MINIMAX_H3_TASK_PARTITIONS.

Common situations: Using task names from other video-generation APIs (i2v, v2v, t2v) that don't map to MiniMax H3 naming; version changes that added/renamed tasks; case/whitespace is handled so failures are genuine name mismatches.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/a803e4c914ec4f78. Report an issue: GitHub.