{"record":{"id":"906712ed089e7eb4","repo":"immich-app/immich","slug":"unknown-model-combination-source-model-type","errorCode":null,"errorMessage":"Unknown model combination: {source}, {model_type}, {model_task}","messagePattern":"Unknown model combination: (.+?), (.+?), (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"machine-learning/immich_ml/models/__init__.py","lineNumber":40,"sourceCode":"            return OpenClipTextualEncoder\n\n        case ModelSource.MCLIP, ModelType.TEXTUAL, ModelTask.SEARCH:\n            return MClipTextualEncoder\n\n        case ModelSource.INSIGHTFACE, ModelType.DETECTION, ModelTask.FACIAL_RECOGNITION:\n            return FaceDetector\n\n        case ModelSource.INSIGHTFACE, ModelType.RECOGNITION, ModelTask.FACIAL_RECOGNITION:\n            return FaceRecognizer\n\n        case ModelSource.PADDLE, ModelType.DETECTION, ModelTask.OCR:\n            return TextDetector\n\n        case ModelSource.PADDLE, ModelType.RECOGNITION, ModelTask.OCR:\n            return TextRecognizer\n\n        case _:\n            raise ValueError(f\"Unknown model combination: {source}, {model_type}, {model_task}\")\n\n\ndef from_model_type(model_name: str, model_type: ModelType, model_task: ModelTask, **kwargs: Any) -> InferenceModel:\n    return get_model_class(model_name, model_type, model_task)(model_name, **kwargs)\n\n\ndef get_model_deps(model_name: str, model_type: ModelType, model_task: ModelTask) -> list[tuple[ModelType, ModelTask]]:\n    return get_model_class(model_name, model_type, model_task).depends\n","sourceCodeStart":22,"sourceCodeEnd":49,"githubUrl":"https://github.com/immich-app/immich/blob/199723261c6ffa897fec8ccdaea6359e39c37cc3/machine-learning/immich_ml/models/__init__.py#L22-L49","documentation":"Raised as ValueError by get_model_class (models/__init__.py) when the (model_source, model_type, model_task) triple does not match any of the supported case branches. Model source is derived from the model name via get_model_source; the valid combinations are openclip/mclip visual+search, openclip/mclip textual+search, insightface detection/recognition+facial-recognition, and paddle detection/recognition+ocr.","triggerScenarios":"A request or config references a model whose source+type+task triple is unsupported — e.g. a Paddle OCR model requested with task=facial-recognition, or a CLIP model requested as type=detection.","commonSituations":"Misconfigured model name that maps to an unexpected source; mixing task/type fields in a custom request; new model family not yet wired into the match statement (version drift).","solutions":["Use a model name whose (source, type, task) is one of the supported combinations — see the match statement in models/__init__.py.","Correct the modelName and/or the task/type fields in the request/config to a valid combination.","Upgrade the ML service if a newer model family is officially supported."],"exampleFix":"# before\nfrom_model_type('buffalo_l', ModelType.RECOGNITION, ModelTask.OCR)  # wrong family\n\n# after\nfrom_model_type('buffalo_l_recognizer', ModelType.RECOGNITION, ModelTask.FACIAL_RECOGNITION)","handlingStrategy":"validation","validationCode":"from immich_ml.models import get_model_class\nfrom immich_ml.schemas import ModelSource, ModelType, ModelTask\ntry:\n    cls = get_model_class(name, model_type, model_task)\nexcept ValueError:\n    # not a supported combination; reject early\n    raise","typeGuard":"def is_supported_combination(source, model_type, model_task) -> bool:\n    try:\n        get_model_class('probe', model_type, model_task) if False else None\n        return True\n    except Exception:\n        return False  # (wrap a lookup against the same match statement)","tryCatchPattern":"try:\n    model = from_model_type(name, model_type, model_task)\nexcept ValueError as e:\n    if 'Unknown model combination' in str(e): pick_default_model()\n    raise","preventionTips":["Restrict the model picker to documented (source, type, task) combinations.","Re-validate configured models after ML service upgrades."],"tags":["machine-learning","model-registry","validation","python","valueerror"],"backgroundTag":null,"analyzedSha":"199723261c6ffa897fec8ccdaea6359e39c37cc3","analyzedAt":"2026-08-12T04:54:27.085Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}