{"record":{"id":"8677beffe2402af9","repo":"langgenius/dify","slug":"model-currently-not-support-8677be","errorCode":"model_currently_not_support","errorMessage":"Dify Hosted OpenAI trial currently not support the GPT-4 model.","messagePattern":"Dify Hosted OpenAI trial currently not support the GPT-4 model\\.","errorType":"error_code","errorClass":"ProviderModelCurrentlyNotSupportError","httpStatus":400,"severity":"error","filePath":"api/controllers/console/datasets/datasets_document.py","lineNumber":573,"sourceCode":"\n        if not dataset.indexing_technique and not knowledge_config.indexing_technique:\n            raise ValueError(\"indexing_technique is required.\")\n\n        # validate args\n        DocumentService.document_create_args_validate(knowledge_config)\n\n        try:\n            documents, batch = DocumentService.save_document_with_dataset_id(\n                dataset, knowledge_config, current_user, session=session\n            )\n            dataset = DatasetService.get_dataset(dataset_id_str, session)\n\n        except ProviderTokenNotInitError as ex:\n            raise ProviderNotInitializeError(ex.description)\n        except QuotaExceededError:\n            raise ProviderQuotaExceededError()\n        except ModelCurrentlyNotSupportError:\n            raise ProviderModelCurrentlyNotSupportError()\n\n        return dump_response(\n            DatasetAndDocumentResponse,\n            {\"dataset\": dataset, \"documents\": document_responses(documents, session=session), \"batch\": batch},\n        )\n\n    @setup_required\n    @login_required\n    @account_initialization_required\n    @console_ns.response(204, \"Documents deleted successfully\")\n    @with_current_user\n    @with_current_tenant_id\n    @rbac_permission_required(RBACResourceScope.DATASET, RBACPermission.DATASET_EDIT)\n    @with_session\n    def delete(\n        self,\n        session: Session,\n        current_tenant_id: str,","sourceCodeStart":555,"sourceCodeEnd":591,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/datasets/datasets_document.py#L555-L591","documentation":"ProviderModelCurrentlyNotSupportError (HTTP 400, code model_currently_not_support) raised in DatasetDocumentListApi.post when save_document_with_dataset_id raises ModelCurrentlyNotSupportError — the selected model is not allowed in the current provider context. The default description specifically calls out that the Dify-hosted OpenAI trial does not support GPT-4.","triggerScenarios":"POST /console/api/datasets/<dataset_id>/documents where the indexing/processing pipeline (e.g. QA mode summarisation, parent-child chunking) selects a model the provider refuses to serve — most commonly GPT-4 on the Dify-hosted trial, which only allows certain models. Any model gated by the provider's allow-list can trigger it.","commonSituations":"Trial tenant selects GPT-4 (or another restricted model) for QA-form document processing or summarisation; a model was deprecated by the provider after the dataset was configured; the dataset references a model tier the current plan does not include.","solutions":["Switch the dataset/app model to a supported one (e.g. gpt-3.5-turbo on the hosted trial) in Settings -> Model Provider / dataset config.","Configure your own provider credentials to unlock the restricted model (e.g. your own OpenAI key supports GPT-4).","Change the document form away from QA mode if an LLM model you cannot access is required."],"exampleFix":"// before — trial tenant, QA mode selects gpt-4\nPOST /console/api/datasets/<id>/documents { doc_form: 'qa_model', ..., model: 'gpt-4' }\n  →  400 model_currently_not_support\n\n// after — use a supported model or own credentials\nPOST /console/api/datasets/<id>/documents { doc_form: 'qa_model', ..., model: 'gpt-3.5-turbo' }  // 200","handlingStrategy":"validation","validationCode":"from core.model_manager import ModelManager\nfrom graphon.model_runtime.entities.model_entities import ModelType\nfrom core.errors.error import ModelCurrentlyNotSupportError\n\nHOSTED_TRIAL_BLOCKED = {\"gpt-4\", \"gpt-4-32k\", \"gpt-4-turbo\"}  # extend per provider\n\ndef model_supported(tenant_id: str, provider: str, model: str, is_trial: bool) -> bool:\n    if is_trial and model.lower() in HOSTED_TRIAL_BLOCKED:\n        return False\n    try:\n        mm = ModelManager.for_tenant(tenant_id=tenant_id)\n        mm.get_model_instance(\n            tenant_id=tenant_id, provider=provider, model_type=ModelType.LLM, model=model,\n        )\n        return True\n    except ModelCurrentlyNotSupportError:\n        return False\n    except Exception:\n        return False","typeGuard":"def is_allowed_model(model: str, is_hosted_trial: bool) -> bool:\n    \"\"\"True only when the model is permitted for the provider context.\"\"\"\n    if is_hosted_trial and model.lower() in HOSTED_TRIAL_BLOCKED:\n        return False\n    return True","tryCatchPattern":"from core.errors.error import ModelCurrentlyNotSupportError\nfrom controllers.console.app.error import ProviderModelCurrentlyNotSupportError\n\ntry:\n    documents, batch = DocumentService.save_document_with_dataset_id(...)\nexcept ModelCurrentlyNotSupportError:\n    raise ProviderModelCurrentlyNotSupportError()","preventionTips":["On the hosted trial, default document/QA models to a supported tier (e.g. gpt-3.5-turbo), not GPT-4.","Maintain a model allow-list per provider context and validate against it in the UI before submit.","When deprecating a model, migrate existing dataset configs to a supported replacement proactively."],"tags":["model-provider","datasets","rag","configuration","unsupported-model"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}