infiniflow/ragflow · error · Exception

No default {model_type} model is set.

Error message

No default {model_type} model is set.

What it means

Error "No default {model_type} model is set." thrown in infiniflow/ragflow.

Source

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

            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
    # embedding model IDs such as `text-embedding-nomic-embed-text-v1.5@q8_0`),
    # which produces composite keys like

View on GitHub (pinned to 554fb1133a)

Solutions

  1. Set a default model for the requested model type in the tenant settings.

Example fix

# tenant settings: choose a default embedding model

When it happens

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

Common situations: The tenant has not configured a default model for the requested type; setting one in the admin panel prevents this error.


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