{"record":{"id":"7dd976818dce84fa","repo":"langgenius/dify","slug":"new-user-default-models-entries-must-use-model-ty","errorCode":null,"errorMessage":"NEW_USER_DEFAULT_MODELS entries must use 'model_type:provider:model' format","messagePattern":"NEW_USER_DEFAULT_MODELS entries must use 'model_type:provider:model' format","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"api/configs/feature/__init__.py","lineNumber":331,"sourceCode":"        return [item.strip() for item in self.NEW_USER_DEFAULT_PLUGIN_IDS.split(\",\") if item.strip()]\n\n    NEW_USER_DEFAULT_MODELS: str = Field(\n        description=(\"Comma-separated default models for new users in 'model_type:provider:model' format\"),\n        default=\"\",\n    )\n\n    @property\n    def NEW_USER_DEFAULT_MODEL_LIST(self) -> list[tuple[str, str, str]]:\n        default_models: list[tuple[str, str, str]] = []\n        configured_model_types: set[str] = set()\n\n        for item in self.NEW_USER_DEFAULT_MODELS.split(\",\"):\n            if not item.strip():\n                continue\n\n            parts = tuple(part.strip() for part in item.split(\":\", 2))\n            if len(parts) != 3 or not all(parts):\n                raise ValueError(\"NEW_USER_DEFAULT_MODELS entries must use 'model_type:provider:model' format\")\n\n            model_type, provider, model = parts\n            if model_type in configured_model_types:\n                raise ValueError(f\"NEW_USER_DEFAULT_MODELS contains duplicate model type: {model_type}\")\n\n            configured_model_types.add(model_type)\n            default_models.append((model_type, provider, model))\n\n        return default_models\n\n\nclass MarketplaceConfig(BaseSettings):\n    \"\"\"\n    Configuration for marketplace\n    \"\"\"\n\n    MARKETPLACE_ENABLED: bool = Field(\n        description=\"Enable or disable marketplace\",","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/configs/feature/__init__.py#L313-L349","documentation":"Raised by the NEW_USER_DEFAULT_MODEL_LIST property when a comma-separated NEW_USER_DEFAULT_MODELS entry does not split into exactly three non-empty parts via item.split(':', 2). The expected format is 'model_type:provider:model'; fewer than three colons-separated parts, empty parts, or trailing colons trigger it.","triggerScenarios":"Setting NEW_USER_DEFAULT_MODELS='llm:openai' (missing model), 'llm::gpt-4' (empty provider), 'chat-model' (no colons), or 'llm:openai:gpt-4:extra' (split with maxsplit=2 yields 3 parts but the third contains a colon — actually passes; failing case is <3 parts or empty parts).","commonSituations":"Wrong delimiter (using ';' or '|'), missing a segment, or copy-pasting a model name that omits the provider.","solutions":["Format each entry as model_type:provider:model, e.g. 'llm:openai:gpt-4o'.","Separate multiple entries with commas; ensure no empty segments between colons.","Use a recognized model_type (typically 'llm' / 'text-to-speech' etc. per the app's enum)."],"exampleFix":"// before\nNEW_USER_DEFAULT_MODELS=llm:openai\n// after\nNEW_USER_DEFAULT_MODELS=llm:openai:gpt-4o","handlingStrategy":"validation","validationCode":"def valid_default_model_entry(entry: str) -> bool:\n    parts = tuple(p.strip() for p in entry.split(':', 2))\n    return len(parts) == 3 and all(parts)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the 'model_type:provider:model' shape exactly.","Split on commas and validate each entry in a pre-deploy script.","Avoid empty segments between colons."],"tags":["config","pydantic","model-defaults","validation"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}