{"record":{"id":"1e6c49593aebbbe0","repo":"mudler/LocalAI","slug":"unknown-pipeline-class-class-name-available-p","errorCode":null,"errorMessage":"Unknown pipeline class '{class_name}'. Available pipelines: {', '.join(sorted(registry.keys())[:20])}...","messagePattern":"Unknown pipeline class '(.+?)'\\. Available pipelines: (.+?)\\.\\.\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"backend/python/diffusers/diffusers_dynamic_loader.py","lineNumber":348,"sourceCode":"\n    Returns:\n        The resolved pipeline class.\n\n    Raises:\n        ValueError: If no pipeline could be resolved.\n    \"\"\"\n    registry = get_pipeline_registry()\n    aliases = get_task_aliases()\n\n    # 1. Direct class name lookup\n    if class_name:\n        if class_name in registry:\n            return registry[class_name]\n        # Try case-insensitive match\n        for name, cls in registry.items():\n            if name.lower() == class_name.lower():\n                return cls\n        raise ValueError(\n            f\"Unknown pipeline class '{class_name}'. \"\n            f\"Available pipelines: {', '.join(sorted(registry.keys())[:20])}...\"\n        )\n\n    # 2. Task alias lookup\n    if task:\n        task_lower = task.lower().replace('_', '-')\n        if task_lower in aliases:\n            # Return the first matching pipeline for this task\n            matching_classes = aliases[task_lower]\n            if matching_classes:\n                return registry[matching_classes[0]]\n\n        # Try partial matching\n        for alias, classes in aliases.items():\n            if task_lower in alias or alias in task_lower:\n                if classes:\n                    return registry[classes[0]]","sourceCodeStart":330,"sourceCodeEnd":366,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/python/diffusers/diffusers_dynamic_loader.py#L330-L366","documentation":"Raised by resolve_pipeline_class when class_name was provided but neither an exact nor case-insensitive match exists in the pipeline registry. The message lists up to 20 sorted registry keys to guide correction.","triggerScenarios":"Calling load_diffusers_pipeline / resolve_pipeline_class with a class_name like 'StableDiffusionXL' (truncated), 'stable-diffusion-xl-pipeline' (slug form), or a class unknown to the installed diffusers.","commonSituations":"Users passing model repo slugs or task names in the class_name field, casing mismatches beyond the case-insensitive fallback (e.g. hyphens/underscores), or a pipeline class from a newer diffusers than installed.","solutions":["Use the exact diffusers class name (e.g. 'StableDiffusionXLPipeline'); the match is case-insensitive but punctuation-sensitive.","If you meant a task, pass it via the task= argument instead of class_name (task aliases are handled separately).","Compare against the 'Available pipelines' list in the error message and correct spelling.","Upgrade diffusers if the class genuinely should exist."],"exampleFix":"# before\nload_diffusers_pipeline(class_name=\"stable-diffusion-xl\")\n\n# after\nload_diffusers_pipeline(class_name=\"StableDiffusionXLPipeline\")","handlingStrategy":"validation","validationCode":"registry = get_pipeline_registry()\nname_map = {k.lower(): k for k in registry}\ncanonical = name_map.get(class_name.lower())\nassert canonical, f\"unknown pipeline {class_name!r}\"","typeGuard":"def is_known_pipeline(class_name: str) -> bool:\n    lowered = {k.lower() for k in get_pipeline_registry()}\n    return class_name.lower() in lowered","tryCatchPattern":"try:\n    cls = resolve_pipeline_class(class_name=name, ...)\nexcept ValueError as e:\n    # error message lists valid names; re-surface to the API consumer\n    return error_reply(str(e))","preventionTips":["Feed class names from a dropdown built off get_available_pipelines(), not free text.","Use exact diffusers class spellings (CamelCase ending in 'Pipeline').","Validate once at config load rather than at generation time."],"tags":["diffusers","pipeline-resolution","validation","image-generation"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}