Docker error logs indicate that the model id was not sanitised from the OpenWebUI model prefix (the initial name of the function I guess). And indeed in the function the model id is derived from the namespace-prefixed function name like this:
model = body["model"].removeprefix("mistral.")
The supposed function namespace is hardcoded to mistral
Looking at other functions the right way to derive the model name would be
model = body["model"].split(".", 1)[-1]
Changing that in the function fixes all errors.
Originally created by @perelin on GitHub (Apr 15, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12892
### Check Existing Issues
- [x] I have searched the existing issues and discussions.
- [x] I am using the latest version of Open WebUI.
### Installation Method
Other
### Open WebUI Version
v0.6.5
### Ollama Version (if applicable)
_No response_
### Operating System
Ubuntu 22.04
### Browser (if applicable)
_No response_
### Confirmation
- [x] I have read and followed all instructions in `README.md`.
- [x] I am using the latest version of **both** Open WebUI and Ollama.
- [x] I have included the browser console logs.
- [x] I have included the Docker container logs.
- [x] I have listed steps to reproduce the bug in detail.
### Expected Behavior
Using the highest ranked Mistral function https://openwebui.com/f/peuportier/Mistral should let me use the models provided by mistral without any errors.
### Actual Behavior
Chat completion for any Mistral models provided by https://openwebui.com/f/peuportier/Mistral fails.
### Steps to Reproduce
- Install the function (incl. mistral API key, its free) https://openwebui.com/f/peuportier/Mistral
- Use the suggested default name 'Mistral API' for the function (which produces a model namespace of 'mistral_api.' for the models)
- Try a chat completion in the UI with one of the mistral models
completion will fail
### Logs & Screenshots
Chat completion for any Mistral model will fail with this error in the Chat:
> Error: 400 Client Error: Bad Request for url: [https://api.mistral.ai/v1/chat/completionsError ](https://api.mistral.ai/v1/chat/completionsError): 400 Client Error: Bad Request for url: [https://api.mistral.ai/v1/chat/completionsError ](https://api.mistral.ai/v1/chat/completionsError): 400 Client Error: Bad Request for url: https://api.mistral.ai/v1/chat/completions
Docker logs:
> 2025-04-14T20:59:10Z HTTPError: {"object":"error","message":"Invalid model: mistral_api.open-mistral-nemo","type":"invalid_model","param":null,"code":"1500"}
### Additional Information
Docker error logs indicate that the model id was not sanitised from the OpenWebUI model prefix (the initial name of the function I guess). And indeed in the function the model id is derived from the namespace-prefixed function name like this:
`model = body["model"].removeprefix("mistral.")`
The supposed function namespace is hardcoded to `mistral`
Looking at other functions the right way to derive the model name would be
`model = body["model"].split(".", 1)[-1]`
Changing that in the function fixes all errors.
GiteaMirror
added the bug label 2026-05-25 04:31:25 -05:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @perelin on GitHub (Apr 15, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12892
Check Existing Issues
Installation Method
Other
Open WebUI Version
v0.6.5
Ollama Version (if applicable)
No response
Operating System
Ubuntu 22.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Using the highest ranked Mistral function https://openwebui.com/f/peuportier/Mistral should let me use the models provided by mistral without any errors.
Actual Behavior
Chat completion for any Mistral models provided by https://openwebui.com/f/peuportier/Mistral fails.
Steps to Reproduce
completion will fail
Logs & Screenshots
Chat completion for any Mistral model will fail with this error in the Chat:
Docker logs:
Additional Information
Docker error logs indicate that the model id was not sanitised from the OpenWebUI model prefix (the initial name of the function I guess). And indeed in the function the model id is derived from the namespace-prefixed function name like this:
model = body["model"].removeprefix("mistral.")The supposed function namespace is hardcoded to
mistralLooking at other functions the right way to derive the model name would be
model = body["model"].split(".", 1)[-1]Changing that in the function fixes all errors.