{"record":{"id":"a6f55aed52208697","repo":"infiniflow/ragflow","slug":"unknown-model-type-model-type","errorCode":null,"errorMessage":"Unknown model type {model_type}","messagePattern":"Unknown model type (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"api/db/joint_services/tenant_model_service.py","lineNumber":194,"sourceCode":"        case LLMType.ASR.value:\n            model_id = tenant.tenant_asr_id\n            model_name = tenant.asr_id\n        case LLMType.VISION.value:\n            model_id = tenant.tenant_img2txt_id\n            model_name = tenant.img2txt_id\n        case LLMType.CHAT.value:\n            model_id = tenant.tenant_llm_id\n            model_name = tenant.llm_id\n        case LLMType.RERANK.value:\n            model_id = tenant.tenant_rerank_id\n            model_name = tenant.rerank_id\n        case LLMType.TTS.value:\n            model_id = tenant.tenant_tts_id\n            model_name = tenant.tts_id\n        case LLMType.OCR.value:\n            raise Exception(\"OCR model name is required\")\n        case _:\n            raise Exception(f\"Unknown model type {model_type}\")\n    if not model_name:\n        raise Exception(f\"No default {model_type} model is set.\")\n    # Prefer resolving by tenant_model.id when available\n    if model_id:\n        try:\n            return get_model_config_by_id(tenant_id, model_type, model_id)\n        except LookupError:\n            logger.warning(\"tenant_model id=%s not found, falling back to model_name lookup for %s\", model_id, model_name)\n    return resolve_model_config(tenant_id, model_type, model_name)\n\n\ndef split_model_name(model_name: str):\n    # Parse model_name: {model_name} or {model_name}@{factory_name} or {model_name}@{instance_name}@{factory_name}\n    #\n    # The composite key is right-anchored on the provider: the *last* '@'-separated\n    # field is the factory/provider, the second-to-last is the instance (when\n    # present), and everything to the left is the bare model name. Some model\n    # names legitimately contain '@' characters themselves (e.g. LM Studio","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/api/db/joint_services/tenant_model_service.py#L176-L212","documentation":"Error \"Unknown model type {model_type}\" thrown in infiniflow/ragflow.","triggerScenarios":"Thrown at api/db/joint_services/tenant_model_service.py:194 when the library encounters an invalid state.","commonSituations":"The caller passes an unrecognized model_type value; restricting input to the supported enum prevents this error.","solutions":["Use a supported model type (llm, embedding, rerank, tts, ocr, etc.).","Check for typos in the model_type parameter."],"exampleFix":"model_type = 'embedding'  # supported type","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}