infiniflow/ragflow · error · Exception

Unknown model type {model_type}

Error message

Unknown model type {model_type}

What it means

Error "Unknown model type {model_type}" thrown in infiniflow/ragflow.

Source

Thrown at api/db/joint_services/tenant_model_service.py:194

        case LLMType.ASR.value:
            model_id = tenant.tenant_asr_id
            model_name = tenant.asr_id
        case LLMType.VISION.value:
            model_id = tenant.tenant_img2txt_id
            model_name = tenant.img2txt_id
        case LLMType.CHAT.value:
            model_id = tenant.tenant_llm_id
            model_name = tenant.llm_id
        case LLMType.RERANK.value:
            model_id = tenant.tenant_rerank_id
            model_name = tenant.rerank_id
        case LLMType.TTS.value:
            model_id = tenant.tenant_tts_id
            model_name = tenant.tts_id
        case LLMType.OCR.value:
            raise Exception("OCR model name is required")
        case _:
            raise Exception(f"Unknown model type {model_type}")
    if not model_name:
        raise Exception(f"No default {model_type} model is set.")
    # Prefer resolving by tenant_model.id when available
    if model_id:
        try:
            return get_model_config_by_id(tenant_id, model_type, model_id)
        except LookupError:
            logger.warning("tenant_model id=%s not found, falling back to model_name lookup for %s", model_id, model_name)
    return resolve_model_config(tenant_id, model_type, model_name)


def split_model_name(model_name: str):
    # Parse model_name: {model_name} or {model_name}@{factory_name} or {model_name}@{instance_name}@{factory_name}
    #
    # The composite key is right-anchored on the provider: the *last* '@'-separated
    # field is the factory/provider, the second-to-last is the instance (when
    # present), and everything to the left is the bare model name. Some model
    # names legitimately contain '@' characters themselves (e.g. LM Studio

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Use a supported model type (llm, embedding, rerank, tts, ocr, etc.).
  2. Check for typos in the model_type parameter.

Example fix

model_type = 'embedding'  # supported type

When it happens

Trigger: Thrown at api/db/joint_services/tenant_model_service.py:194 when the library encounters an invalid state.

Common situations: The caller passes an unrecognized model_type value; restricting input to the supported enum prevents this error.


AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15). Data as JSON: /api/errors/a6f55aed52208697. Report an issue: GitHub.