[GH-ISSUE #17840] Third-party Mistral API Pipe - Model name prefix bug causing "Invalid model" error #33943

Closed
opened 2026-04-25 07:49:27 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @FrankSieckmann on GitHub (Sep 28, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/17840

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I am using the latest version of Open WebUI.

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

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

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:

  1. Install Mistral API pipe in OpenWebUI
  2. Add Mistral API key
  3. Try to use any Mistral model
  4. Get 400 error

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

  1. Install Mistral API pipe in OpenWebUI from Functions
  2. Configure with valid Mistral API key
  3. Try to chat with any Mistral model (e.g., mistral-large-latest)
  4. Send message "Hello"
  5. Observe 400 error repeating 3 times due to retry logic

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:

  • Replace simple .replace() with proper prefix detection
  • Handle "mistral_api_." prefix that OpenWebUI sends
  • After fix, Mistral API responds normally

The issue is in the pipe() method where model name cleaning is incomplete.

Originally created by @FrankSieckmann on GitHub (Sep 28, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/17840 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I am using the latest version of Open WebUI. ### 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 - [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 **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### 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:** 1. Install Mistral API pipe in OpenWebUI 2. Add Mistral API key 3. Try to use any Mistral model 4. Get 400 error **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 1. Install Mistral API pipe in OpenWebUI from Functions 2. Configure with valid Mistral API key 3. Try to chat with any Mistral model (e.g., mistral-large-latest) 4. Send message "Hello" 5. Observe 400 error repeating 3 times due to retry logic 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: - Replace simple .replace() with proper prefix detection - Handle "mistral_api_." prefix that OpenWebUI sends - After fix, Mistral API responds normally The issue is in the pipe() method where model name cleaning is incomplete.
GiteaMirror added the bug label 2026-04-25 07:49:28 -05:00
Author
Owner

@tjbck commented on GitHub (Sep 28, 2025):

Issue should be raised to the pipe author.

<!-- gh-comment-id:3343859246 --> @tjbck commented on GitHub (Sep 28, 2025): Issue should be raised to the pipe author.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#33943