{"record":{"id":"b030df5654fc87ad","repo":"mudler/LocalAI","slug":"must-provide-at-least-one-of-class-name-task-or","errorCode":null,"errorMessage":"Must provide at least one of: class_name, task, or model_id. Available pipelines: {', '.join(sorted(registry.keys())[:20])}... Available tasks: {', '.join(sorted(aliases.keys())[:20])}...","messagePattern":"Must provide at least one of: class_name, task, or model_id\\. Available pipelines: (.+?)\\.\\.\\. Available tasks: (.+?)\\.\\.\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"backend/python/diffusers/diffusers_dynamic_loader.py","lineNumber":414,"sourceCode":"\n        except ImportError:\n            # huggingface_hub not available\n            pass\n        except (KeyError, AttributeError, ValueError, OSError):\n            # Model info lookup failed - common cases:\n            # - KeyError: Missing keys in model card\n            # - AttributeError: Missing attributes on model info\n            # - ValueError: Invalid model data\n            # - OSError: Network or file access issues\n            pass\n\n        # Fallback: use DiffusionPipeline.from_pretrained which auto-detects\n        # DiffusionPipeline is always added to registry in _discover_pipelines (line 132)\n        # but use .get() with import fallback for extra safety\n        from diffusers import DiffusionPipeline\n        return registry.get('DiffusionPipeline', DiffusionPipeline)\n\n    raise ValueError(\n        \"Must provide at least one of: class_name, task, or model_id. \"\n        f\"Available pipelines: {', '.join(sorted(registry.keys())[:20])}... \"\n        f\"Available tasks: {', '.join(sorted(aliases.keys())[:20])}...\"\n    )\n\n\ndef load_diffusers_pipeline(\n    class_name: Optional[str] = None,\n    task: Optional[str] = None,\n    model_id: Optional[str] = None,\n    from_single_file: bool = False,\n    **kwargs\n) -> Any:\n    \"\"\"\n    Load a diffusers pipeline dynamically.\n\n    This function resolves the appropriate pipeline class based on the provided\n    parameters and instantiates it with the given kwargs.","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/mudler/LocalAI/blob/44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26/backend/python/diffusers/diffusers_dynamic_loader.py#L396-L432","documentation":"Raised by resolve_pipeline_class as its final guard: all three resolution inputs were falsy — no class_name, no task, and no model_id — so there is nothing to resolve and the HuggingFace-inference branch (which requires model_id) was skipped. The message lists both available pipeline classes and task aliases.","triggerScenarios":"Calling load_diffusers_pipeline() (or resolve_pipeline_class) with all of class_name, task, and model_id as None/empty — typically a caller bug that failed to populate any argument.","commonSituations":"A request pipeline where the user omitted both pipeline type and model, a default-argument refactor that dropped model_id propagation, or a config file where all optional fields were left blank.","solutions":["Supply at least one of the three arguments; model_id alone is usually sufficient (auto-detection via the model card).","Fix the caller: log the arguments at the call site to find which layer dropped them.","If wrapping this API, validate inputs before calling and raise a domain-specific error instead."],"exampleFix":"# before\npipe = load_diffusers_pipeline()\n\n# after\npipe = load_diffusers_pipeline(model_id=model_ref)","handlingStrategy":"validation","validationCode":"assert class_name or task or model_id, (\n    \"load_diffusers_pipeline needs at least one of class_name/task/model_id\")","typeGuard":"def has_resolution_input(class_name, task, model_id) -> bool:\n    return bool(class_name or task or model_id)","tryCatchPattern":"try:\n    pipe = load_diffusers_pipeline(class_name=c, task=t, model_id=m)\nexcept ValueError as e:\n    if \"Must provide at least one\" in str(e):\n        raise ProgrammingError(\"loader called without any resolution input\") from e\n    raise","preventionTips":["Make model_id a required field in your wrapper's signature.","Fail fast on empty config values before calling the loader.","Treat this error as a caller bug, not a user error."],"tags":["diffusers","argument-validation","api-misuse","programming-error"],"backgroundTag":null,"analyzedSha":"44413a9d06bf5bc52ce088ba8ca74e5a2e8bee26","analyzedAt":"2026-08-15T10:13:50.291Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}