mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[GH-ISSUE #17840] Third-party Mistral API Pipe - Model name prefix bug causing "Invalid model" error #18414
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @FrankSieckmann on GitHub (Sep 28, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/17840
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
v0.6.30
Ollama Version (if applicable)
No response
Operating System
Windows 11
Browser (if applicable)
Brave, Firefox
Confirmation
README.md.Expected Behavior
Bug Description:
The third-party Mistral API pipe fails with "400 Client Error: Bad Request" because OpenWebUI sends model names like "mistral_api_.mistral-large-latest" but the pipe only removes "mistral/" and "mistral." prefixes.
Error Message:
{"object":"error","message":"Invalid model: mistral_api_.mistral-large-latest","type":"invalid_model","param":null,"code":"1500"}
Root Cause:
Line in pipe() method only handles some prefixes:
model = body["model"].replace("mistral/", "").replace("mistral.", "")
Working Fix:
Replace with proper prefix removal that handles "mistral_api_." prefix.
Steps to Reproduce:
Expected: Model should work
Actual: Invalid model error
Note: This affects the third-party Mistral pipe created by justinh-rahb.
Actual Behavior
Mistral API pipe fails with repeated 400 errors:
"Error: 400 Client Error: Bad Request for url: https://api.mistral.ai/v1/chat/completions"
Debug logs show:
{"object":"error","message":"Invalid model: mistral_api_.mistral-large-latest","type":"invalid_model","param":null,"code":"1500"}
The pipe receives "mistral_api_.mistral-large-latest" from OpenWebUI but only removes "mistral/" and "mistral." prefixes, leaving "mistral_api_." which causes Mistral API to reject the model name.
Steps to Reproduce
Expected: Model responds normally
Actual: Invalid model error due to incorrect prefix cleaning
Logs & Screenshots
Debug logs showing the root cause:
[MISTRAL DEBUG] Original model: 'mistral_api_.mistral-large-latest' -> Cleaned model: 'mistral_api_.mistral-large-latest'
[MISTRAL DEBUG] Response content: {"object":"error","message":"Invalid model: mistral_api_.mistral-large-latest","type":"invalid_model","param":null,"code":"1500"}
Error repeats 3 times due to retry logic:
Error: 400 Client Error: Bad Request for url: https://api.mistral.ai/v1/chat/completions (repeated 3x)
Additional Information
This bug affects the third-party Mistral API pipe created by justinh-rahb.
Working fix tested and confirmed:
The issue is in the pipe() method where model name cleaning is incomplete.
@tjbck commented on GitHub (Sep 28, 2025):
Issue should be raised to the pipe author.