{"record":{"id":"c101c0d145a4f00b","repo":"infiniflow/ragflow","slug":"no-default-model-type-model-is-set","errorCode":null,"errorMessage":"No default {model_type} model is set.","messagePattern":"No default (.+?) model is set\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"api/db/joint_services/tenant_model_service.py","lineNumber":196,"sourceCode":"            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\n    # embedding model IDs such as `text-embedding-nomic-embed-text-v1.5@q8_0`),\n    # which produces composite keys like","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/api/db/joint_services/tenant_model_service.py#L178-L214","documentation":"Error \"No default {model_type} model is set.\" thrown in infiniflow/ragflow.","triggerScenarios":"Thrown at api/db/joint_services/tenant_model_service.py:196 when the library encounters an invalid state.","commonSituations":"The tenant has not configured a default model for the requested type; setting one in the admin panel prevents this error.","solutions":["Set a default model for the requested model type in the tenant settings."],"exampleFix":"# tenant settings: choose a default embedding model","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-15T22:17:37.221Z"}