{"record":{"id":"0e7d1a5f825a2616","repo":"invoke-ai/InvokeAI","slug":"unknown-dashscope-model-id-model-id-add-it-to","errorCode":null,"errorMessage":"Unknown DashScope model_id '{model_id}'. Add it to _SYNC_MODELS or _ASYNC_MODELS in alibabacloud.py.","messagePattern":"Unknown DashScope model_id '(.+?)'\\. Add it to _SYNC_MODELS or _ASYNC_MODELS in alibabacloud\\.py\\.","errorType":"exception","errorClass":"ExternalProviderRequestError","httpStatus":null,"severity":"error","filePath":"invokeai/app/services/external_generation/providers/alibabacloud.py","lineNumber":67,"sourceCode":"        api_key = self._app_config.external_alibabacloud_api_key\n        if not api_key:\n            raise ExternalProviderRequestError(\"Alibaba Cloud DashScope API key is not configured\")\n\n        base_url = (self._app_config.external_alibabacloud_base_url or \"https://dashscope-intl.aliyuncs.com\").rstrip(\n            \"/\"\n        )\n        model_id = request.model.provider_model_id\n        headers = {\n            \"Content-Type\": \"application/json\",\n            \"Authorization\": f\"Bearer {api_key}\",\n        }\n        size = f\"{request.width}*{request.height}\"\n\n        if model_id in _SYNC_MODELS:\n            return self._generate_sync(request, base_url, headers, model_id, size)\n        if model_id in _ASYNC_MODELS:\n            return self._generate_async(request, base_url, headers, model_id, size)\n        raise ExternalProviderRequestError(\n            f\"Unknown DashScope model_id '{model_id}'. Add it to _SYNC_MODELS or _ASYNC_MODELS in alibabacloud.py.\"\n        )\n\n    def _generate_sync(\n        self,\n        request: ExternalGenerationRequest,\n        base_url: str,\n        headers: dict[str, str],\n        model_id: str,\n        size: str,\n    ) -> ExternalGenerationResult:\n        \"\"\"Use the synchronous multimodal-generation endpoint (messages format).\"\"\"\n        endpoint = f\"{base_url}/api/v1/services/aigc/multimodal-generation/generation\"\n\n        content: list[dict[str, str]] = []\n\n        # Reference images: DashScope multimodal accepts up to 3 input images for the\n        # qwen-image-edit family; we let the API surface its own limit if exceeded.","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/services/external_generation/providers/alibabacloud.py#L49-L85","documentation":"DashScope splits models into synchronous and asynchronous task-based APIs. The provider dispatches based on membership in the hardcoded module-level lists _SYNC_MODELS and _ASYNC_MODELS; a model_id not in either list has no implemented call path, so generate() raises ExternalProviderRequestError telling the developer to extend the provider code.","triggerScenarios":"request.model.provider_model_id is a DashScope model id (or typo/renamed id) not present in _SYNC_MODELS or _ASYNC_MODELS in alibabacloud.py at the time of the call.","commonSituations":"Alibaba released a new image model after this InvokeAI version was cut; admin entered a custom model id in provider settings; a typo or changed model id (e.g. renamed wanx variant); using an outdated InvokeAI version lacking newer model registrations.","solutions":["Check the model id spelling against DashScope's documented model ids and correct it in provider settings","Upgrade InvokeAI to a version whose _SYNC_MODELS/_ASYNC_MODELS includes the desired model","Add the model id to the appropriate list (_SYNC_MODELS for sync APIs, _ASYNC_MODELS for task-based APIs) in alibabacloud.py and implement/reuse the matching call path","Choose a model already registered in the installed version"],"exampleFix":"# before (alibabacloud.py)\n_SYNC_MODELS = {\"wanx2.1-t2i-turbo\"}\n# after\n_SYNC_MODELS = {\"wanx2.1-t2i-turbo\", \"wan2.5-t2i\"}  # newly registered model id","handlingStrategy":"validation","validationCode":"from invokeai.app.services.external_generation.providers.alibabacloud import _SYNC_MODELS, _ASYNC_MODELS\nif request.model.provider_model_id not in _SYNC_MODELS | _ASYNC_MODELS:\n    raise ValueError(f\"DashScope model {request.model.provider_model_id!r} not registered in alibabacloud.py\")","typeGuard":"def is_registered_model(model_id: str) -> bool:\n    return model_id in _SYNC_MODELS or model_id in _ASYNC_MODELS","tryCatchPattern":"try:\n    result = provider.generate(request)\nexcept ExternalProviderRequestError as e:\n    if 'Unknown DashScope model_id' in str(e):\n        raise UnsupportedModelError(request.model.provider_model_id) from e\n    raise","preventionTips":["Pin model ids to those registered in your InvokeAI version","Upgrade InvokeAI when adopting newly released DashScope models","Centralize model-id selection in a validated settings list"],"tags":["configuration","model-not-supported","dashscope","alibabacloud","whitelist"],"backgroundTag":"unsupported-model","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}