[GH-ISSUE #12821] issue: Bug in the /ollama/api/embed API with models lacking tags (and with prefixes). #103719

Closed
opened 2026-05-18 01:14:33 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @gmammolo on GitHub (Apr 13, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12821

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Git Clone

Open WebUI Version

0.6.4

Ollama Version (if applicable)

0.6.5

Operating System

Ubuntu 22.04

Browser (if applicable)

No response

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 listed steps to reproduce the bug in detail.

Expected Behavior

The POST $HOSTNAME/ollama/api/embed should succeed and respond as if the request were made directly to Ollama.

Actual Behavior

The tests were conducted with the nomic-embed-text:latest model in Ollama.
Ollama is connected to OpenWebUI with the prefix “core”.

curl -X POST -H "Authorization: Bearer sk-xxxxxx"  https://<HOSTNAME>/ollama/api/embed  -H "Content-Type: application/json" -d '{ 
  "model": "nomic-embed-text", 
  "input": "Open WebUI is great!"
}'
{"detail":"Model 'nomic-embed-text' was not found"}

Currently, it’s not possible to specify a valid model without encountering this error.

Steps to Reproduce

  1.  Enable the Ollama APIs.
    
  2.  Download an embedding model to Ollama.
    
  3.  Make a CURL request.
    

Logs & Screenshots

curl -X POST -H "Authorization: Bearer sk-xxxxxx"  https://<HOSTNAME>/ollama/api/embed  -H "Content-Type: application/json" -d '{ 
  "model": "core.nomic-embed-text", 
  "input": "Open WebUI is great!"
}'
{"detail":"Model 'core.nomic-embed-text' was not found"}

Additional Information

I’ve already implemented a fix and will submit it as a pull request as soon as possible.
The issue is in the file ./backend/open_webui/routers/ollama.py.
On line 354, valid models are filtered, automatically excluding those without an explicit tag (or with the 'latest' tag).

Furthermore, the API currently only works if Ollama doesn't have a prefix.
If the Ollama server has a prefix, the model must be entered as core.nomic-embed-tex, but this is sent to Ollama as-is, resulting in an error.
Therefore, I’ve also added a fix that allows entering $PREFIX_ID.nomic-embed-tex (to also specify which Ollama server to use for the request), but removes the prefix before making the request.

Originally created by @gmammolo on GitHub (Apr 13, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/12821 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Git Clone ### Open WebUI Version 0.6.4 ### Ollama Version (if applicable) 0.6.5 ### 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 The POST $HOSTNAME/ollama/api/embed should succeed and respond as if the request were made directly to Ollama. ### Actual Behavior The tests were conducted with the nomic-embed-text:latest model in Ollama. Ollama is connected to OpenWebUI with the prefix “core”. ```bash curl -X POST -H "Authorization: Bearer sk-xxxxxx" https://<HOSTNAME>/ollama/api/embed -H "Content-Type: application/json" -d '{ "model": "nomic-embed-text", "input": "Open WebUI is great!" }' {"detail":"Model 'nomic-embed-text' was not found"} ``` Currently, it’s not possible to specify a valid model without encountering this error. ### Steps to Reproduce 1. Enable the Ollama APIs. 2. Download an embedding model to Ollama. 3. Make a CURL request. ### Logs & Screenshots ```bash curl -X POST -H "Authorization: Bearer sk-xxxxxx" https://<HOSTNAME>/ollama/api/embed -H "Content-Type: application/json" -d '{ "model": "core.nomic-embed-text", "input": "Open WebUI is great!" }' {"detail":"Model 'core.nomic-embed-text' was not found"} ``` ### Additional Information I’ve already implemented a fix and will submit it as a pull request as soon as possible. The issue is in the file `./backend/open_webui/routers/ollama.py`. On line 354, valid models are filtered, automatically excluding those without an explicit tag (or with the 'latest' tag). Furthermore, the API currently only works if Ollama doesn't have a prefix. If the Ollama server has a prefix, the model must be entered as core.nomic-embed-tex, but this is sent to Ollama as-is, resulting in an error. Therefore, I’ve also added a fix that allows entering `$PREFIX_ID.nomic-embed-tex` (to also specify which Ollama server to use for the request), but removes the prefix before making the request.
GiteaMirror added the bug label 2026-05-18 01:14:33 -05:00
Author
Owner

@tjbck commented on GitHub (Apr 14, 2025):

https://github.com/open-webui/open-webui/issues/8719

<!-- gh-comment-id:2800952293 --> @tjbck commented on GitHub (Apr 14, 2025): https://github.com/open-webui/open-webui/issues/8719
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#103719