{"record":{"id":"44642fc00fd1ce11","repo":"open-webui/open-webui","slug":"provider-provider-or-default-does-not-suppor","errorCode":null,"errorMessage":"Provider \"{provider or \"default\"}\" does not support model unloading","messagePattern":"Provider \"(.+?)\" does not support model unloading","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"warning","filePath":"backend/open_webui/main.py","lineNumber":1003,"sourceCode":"                        'Content-Type': 'application/json',\n                        **({'Authorization': f'Bearer {key}'} if key else {}),\n                    }\n                    async with session.post(\n                        f'{root_url}/models/unload',\n                        json={'model': actual_model},\n                        headers=headers,\n                    ) as r:\n                        if not r.ok:\n                            detail = await r.text()\n                            raise HTTPException(status_code=r.status, detail=detail)\n                        return await r.json()\n            except HTTPException:\n                raise\n            except Exception as e:\n                log.exception(f'Failed to unload model via llama.cpp: {e}')\n                raise HTTPException(status_code=500, detail=str(e))\n        else:\n            raise HTTPException(\n                status_code=400,\n                detail=f'Provider \"{provider or \"default\"}\" does not support model unloading',\n            )\n\n    raise HTTPException(status_code=404, detail=f'Model \"{model_id}\" not found')\n\n\n##################################\n# Embeddings\n##################################\n\n\n@app.post('/api/embeddings')\n@app.post('/api/v1/embeddings')  # Experimental: Compatibility with OpenAI API\nasync def embeddings(request: Request, form_data: dict, user=Depends(get_verified_user)):\n    \"\"\"\n    OpenAI-compatible embeddings endpoint.\n","sourceCodeStart":985,"sourceCodeEnd":1021,"githubUrl":"https://github.com/open-webui/open-webui/blob/01f4282f1ffe0d6212f58d3afbeae21fffd0c4be/backend/open_webui/main.py#L985-L1021","documentation":"Terminal else-branch of the unload-model endpoint (backend/open_webui/main.py:1003): the endpoint implements unloading only for Ollama and llama.cpp providers. If the model resolves to any other OpenAI-compatible provider (no 'llama.cpp' provider marker), it raises HTTPException 400 stating that provider does not support model unloading. 'default' appears when the provider field is empty, which itself hits this branch for non-local backends.","triggerScenarios":"POST unload for a model whose connection entry is an OpenAI-compatible API (vLLM without llama.cpp marker, LM Studio, OpenRouter, Azure, a gateway) or an entry with no provider set.","commonSituations":"Users expecting every OpenAI-compatible server to expose an unload endpoint; vLLM deployments (lifecycle is managed by the server, not the client); missing provider metadata in the connection config.","solutions":["Unload via the provider's own mechanism (vLLM admin API, LM Studio UI, cloud console) — Open WebUI cannot do it for that provider.","If the backend really is llama.cpp, ensure the connection's provider field is set to 'llama.cpp' so the unload branch is selected.","Treat the 400 as expected behavior for remote/OpenAI-compatible providers."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"model = MODELS.get(model_id)\nsupports_unload = model is not None and (\n    model.get('owned_by') == 'ollama' or model.get('provider') == 'llama.cpp'\n)\nif not supports_unload:\n    print('Unload not supported for this provider; use the provider-native method')","typeGuard":"def supports_unload(model_entry: dict) -> bool:\n    return model_entry.get('provider') in {'ollama', 'llama.cpp'}","tryCatchPattern":"try:\n    resp = await client.post(f'/api/v1/models/{model_id}/unload')\nexcept HTTPStatusError as e:\n    if e.response.status_code == 400 and 'does not support model unloading' in e.response.text():\n        pass  # expected for OpenAI-compatible providers; handle out-of-band","preventionTips":["Gate unload UI buttons on provider type (Ollama/llama.cpp only).","For vLLM/cloud providers, manage model lifecycle on the provider side."],"tags":["models","providers","unload","openai-compatible"],"backgroundTag":null,"analyzedSha":"01f4282f1ffe0d6212f58d3afbeae21fffd0c4be","analyzedAt":"2026-08-14T18:25:22.715Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}