I have searched for any existing and/or related issues.
I have searched for any existing and/or related discussions.
I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
I am using the latest version of Open WebUI.
Installation Method
Docker
Open WebUI Version
v0.8.10-slim
Ollama Version (if applicable)
0.17.8
Operating System
Ubuntu 24.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 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
When model parameters (e.g., num_ctx etc.) are configured in the model settings via the admin interface and saved to the database as model.params, these parameters should be automatically applied to all requests made to embedding endpoints, similar to how they work for chat completion endpoints.
For example, if an Ollama embedding model qwen3-embedding:4b has params.num_ctx: 32000 configured in the model settings, requests to /api/embeddings and /ollama/api/embed should automatically use this context length without requiring explicit options in each request.
Actual Behavior
The model parameters stored in model.params are completely ignored by embedding endpoints. When making requests to:
/api/embeddings (OpenAI-compatible endpoint)
/ollama/api/embed (Ollama proxy endpoint)
Only the parameters explicitly provided in the request body are forwarded to Ollama. The configured model parameters from the database are never merged or applied.
This behavior is inconsistent with chat completion endpoints, where apply_params_to_form_data() is called in process_chat_payload() to merge model parameters with request parameters.
Steps to Reproduce
Configure an Ollama embedding model via admin interface (e.g., qwen3-embedding:4b)
Set model parameters in the model settings, specifically:
{"params":{"num_ctx":32000}}
Make an embedding request without explicit options:
Working reference: backend/open_webui/utils/middleware.py:2143-2267 - process_chat_payload()
Code Reference - Current Broken Implementation
# backend/open_webui/routers/ollama.py:1064-1069r=requests.request(method="POST",url=f"{url}/api/embed",headers=headers,data=form_data.model_dump_json(exclude_none=True).encode(),# Only request data, no model.params)
Suggested Fix
Add parameter merging similar to chat completions:
# In backend/open_webui/routers/ollama.py around line 1055# After getting the model from MODELS statefromopen_webui.utils.payloadimportapply_model_params_to_body_ollama# Get model infomodel_info=models.get(form_data.model,{})model_params=model_info.get("params",{})# Merge model params with request optionspayload_dict=form_data.model_dump(exclude_none=True)ifmodel_params:payload_dict["options"]=apply_model_params_to_body(model_params,payload_dict.get("options",{})or{},{}# mappings from apply_model_params_to_body_ollama)r=requests.request(method="POST",url=f"{url}/api/embed",headers=headers,data=json.dumps(payload_dict).encode(),)
Additional Findings
Third broken endpoint:/ollama/api/embeddings (ollama.py:1099-1175) - line 1153 also ignores model.params when proxying to Ollama's /api/embeddings.
Available utility functions:backend/open_webui/utils/payload.py contains:
apply_model_params_to_body() (line 46)
apply_model_params_to_body_openai() (line 90)
apply_model_params_to_body_ollama() (line 124)
Originally created by @R-omk on GitHub (Mar 14, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22677
### 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 have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
- [x] I am using the latest version of Open WebUI.
### Installation Method
Docker
### Open WebUI Version
v0.8.10-slim
### Ollama Version (if applicable)
0.17.8
### Operating System
Ubuntu 24.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 **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
When model parameters (e.g., `num_ctx` etc.) are configured in the model settings via the admin interface and saved to the database as `model.params`, these parameters should be automatically applied to all requests made to embedding endpoints, similar to how they work for chat completion endpoints.
For example, if an Ollama embedding model `qwen3-embedding:4b` has `params.num_ctx: 32000` configured in the model settings, requests to `/api/embeddings` and `/ollama/api/embed` should automatically use this context length without requiring explicit `options` in each request.
### Actual Behavior
The model parameters stored in `model.params` are completely ignored by embedding endpoints. When making requests to:
- `/api/embeddings` (OpenAI-compatible endpoint)
- `/ollama/api/embed` (Ollama proxy endpoint)
Only the parameters explicitly provided in the request body are forwarded to Ollama. The configured model parameters from the database are never merged or applied.
This behavior is inconsistent with chat completion endpoints, where `apply_params_to_form_data()` is called in `process_chat_payload()` to merge model parameters with request parameters.
### Steps to Reproduce
1. Configure an Ollama embedding model via admin interface (e.g., `qwen3-embedding:4b`)
2. Set model parameters in the model settings, specifically:
```json
{
"params": {
"num_ctx": 32000
}
}
```
3. Make an embedding request without explicit options:
```bash
curl -X POST "http://localhost:8080/api/embeddings" \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{"model": "ollama1.qwen3-embedding:4b", "input": "test"}'
```
4. Check the loaded model context via Ollama `ps` endpoint
5. Observe that the context length defaults to the Ollama global setting (e.g., 16384) instead of the configured 32000
### Logs & Screenshots
[not applicable]
### Additional Information
**Workaround**: Parameters are only applied when explicitly specified in the request:
```bash
curl -X POST "http://localhost:8080/api/embeddings" \
-H "Authorization: Bearer <api_key>" \
-H "Content-Type: application/json" \
-d '{"model": "ollama1.qwen3-embedding:4b", "input": "test", "options": {"num_ctx": 32000}}'
```
### Root Cause Analysis
The issue stems from missing parameter merging logic in embedding endpoints:
**Chat Completions (Works correctly):**
- File: `backend/open_webui/utils/middleware.py:2011-2059`
- Function: `apply_params_to_form_data()` is called from `process_chat_payload()` at line 2149
- Logic: Merges `model.params` with `form_data.params` and转发 to Ollama as `options`
**Embeddings (Broken):**
- File: `backend/open_webui/routers/ollama.py:1068`
- Endpoint: `/ollama/api/embed`
- Line 1068: `data=form_data.model_dump_json(exclude_none=True).encode()`
- Issue: Only sends request parameters, completely ignoring `model.params`
- File: `backend/open_webui/utils/embeddings.py:24-88`
- Function: `generate_embeddings()`
- Endpoint: `/api/embeddings`
- Issue: No call to `apply_params_to_form_data()` or similar logic
### Code Locations
- **Model parameter configuration**: `backend/open_webui/models/models.py` - `params` field in Model table
- **Parameter merging function**: `backend/open_webui/utils/middleware.py:2011` - `apply_params_to_form_data()`
- **Broken endpoint 1**: `backend/open_webui/routers/ollama.py:1016-1089` - `/ollama/api/embed`
- **Broken endpoint 2**: `backend/open_webui/main.py:1656-1680` - `/api/embeddings`
- **Working reference**: `backend/open_webui/utils/middleware.py:2143-2267` - `process_chat_payload()`
### Code Reference - Current Broken Implementation
```python
# backend/open_webui/routers/ollama.py:1064-1069
r = requests.request(
method="POST",
url=f"{url}/api/embed",
headers=headers,
data=form_data.model_dump_json(exclude_none=True).encode(), # Only request data, no model.params
)
```
### Suggested Fix
Add parameter merging similar to chat completions:
```python
# In backend/open_webui/routers/ollama.py around line 1055
# After getting the model from MODELS state
from open_webui.utils.payload import apply_model_params_to_body_ollama
# Get model info
model_info = models.get(form_data.model, {})
model_params = model_info.get("params", {})
# Merge model params with request options
payload_dict = form_data.model_dump(exclude_none=True)
if model_params:
payload_dict["options"] = apply_model_params_to_body(
model_params,
payload_dict.get("options", {}) or {},
{} # mappings from apply_model_params_to_body_ollama
)
r = requests.request(
method="POST",
url=f"{url}/api/embed",
headers=headers,
data=json.dumps(payload_dict).encode(),
)
```
## Additional Findings
**Third broken endpoint:** `/ollama/api/embeddings` (ollama.py:1099-1175) - line 1153 also ignores model.params when proxying to Ollama's `/api/embeddings`.
**Available utility functions:** `backend/open_webui/utils/payload.py` contains:
- `apply_model_params_to_body()` (line 46)
- `apply_model_params_to_body_openai()` (line 90)
- `apply_model_params_to_body_ollama()` (line 124)
GiteaMirror
added the bug label 2026-04-25 09:32:57 -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 @R-omk on GitHub (Mar 14, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22677
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.8.10-slim
Ollama Version (if applicable)
0.17.8
Operating System
Ubuntu 24.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When model parameters (e.g.,
num_ctxetc.) are configured in the model settings via the admin interface and saved to the database asmodel.params, these parameters should be automatically applied to all requests made to embedding endpoints, similar to how they work for chat completion endpoints.For example, if an Ollama embedding model
qwen3-embedding:4bhasparams.num_ctx: 32000configured in the model settings, requests to/api/embeddingsand/ollama/api/embedshould automatically use this context length without requiring explicitoptionsin each request.Actual Behavior
The model parameters stored in
model.paramsare completely ignored by embedding endpoints. When making requests to:/api/embeddings(OpenAI-compatible endpoint)/ollama/api/embed(Ollama proxy endpoint)Only the parameters explicitly provided in the request body are forwarded to Ollama. The configured model parameters from the database are never merged or applied.
This behavior is inconsistent with chat completion endpoints, where
apply_params_to_form_data()is called inprocess_chat_payload()to merge model parameters with request parameters.Steps to Reproduce
qwen3-embedding:4b)psendpointLogs & Screenshots
[not applicable]
Additional Information
Workaround: Parameters are only applied when explicitly specified in the request:
Root Cause Analysis
The issue stems from missing parameter merging logic in embedding endpoints:
Chat Completions (Works correctly):
backend/open_webui/utils/middleware.py:2011-2059apply_params_to_form_data()is called fromprocess_chat_payload()at line 2149model.paramswithform_data.paramsand转发 to Ollama asoptionsEmbeddings (Broken):
File:
backend/open_webui/routers/ollama.py:1068Endpoint:
/ollama/api/embedLine 1068:
data=form_data.model_dump_json(exclude_none=True).encode()Issue: Only sends request parameters, completely ignoring
model.paramsFile:
backend/open_webui/utils/embeddings.py:24-88Function:
generate_embeddings()Endpoint:
/api/embeddingsIssue: No call to
apply_params_to_form_data()or similar logicCode Locations
backend/open_webui/models/models.py-paramsfield in Model tablebackend/open_webui/utils/middleware.py:2011-apply_params_to_form_data()backend/open_webui/routers/ollama.py:1016-1089-/ollama/api/embedbackend/open_webui/main.py:1656-1680-/api/embeddingsbackend/open_webui/utils/middleware.py:2143-2267-process_chat_payload()Code Reference - Current Broken Implementation
Suggested Fix
Add parameter merging similar to chat completions:
Additional Findings
Third broken endpoint:
/ollama/api/embeddings(ollama.py:1099-1175) - line 1153 also ignores model.params when proxying to Ollama's/api/embeddings.Available utility functions:
backend/open_webui/utils/payload.pycontains:apply_model_params_to_body()(line 46)apply_model_params_to_body_openai()(line 90)apply_model_params_to_body_ollama()(line 124)@tjbck commented on GitHub (Mar 15, 2026):
Embedding models aren't supported.