mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-24 11:58:31 -05:00
[PR #18014] [CLOSED] feat: add filter processing to ollama and openai embedding endpoints #40269
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/18014
Author: @Simon-Stone
Created: 10/2/2025
Status: ❌ Closed
Base:
dev← Head:apply-filters-to-embedding-requests📝 Commits (1)
73767fdfeat: add filter processing to ollama and openai embedding endpoints📊 Changes
2 files changed (+134 additions, -0 deletions)
View changed files
📝
backend/open_webui/routers/ollama.py(+98 -0)📝
backend/open_webui/routers/openai.py(+36 -0)📄 Description
feat: Add inlet filter support to embedding endpoints
Before submitting, make sure you've checked the following:
devbranchfeat- Introduces new feature (inlet filter support for embeddings)Changelog Entry
Description
This PR adds inlet filter support to embedding endpoints, ensuring that embedding requests go through attached inlet filters just like completion endpoints do. Previously, requests to
/api/embed,/api/embeddings, and OpenAI-compatible embedding endpoints bypassed pipeline inlet filters, preventing filters from intercepting, modifying, logging, or validating embedding requests.Potential use-cases for this:
The implementation includes:
process_filter_functions()into all embedding endpointsAdded
/api/embedendpoint (ollama.py:1067-1098)/api/embeddingsendpoint (ollama.py:1192-1220)embeddings()function (openai.py:1009-1027)Security
Additional Information
Technical Details:
The implementation follows the same pattern used in
tasks.pyfor completion endpoints.Testing:
To verify the changes work correctly:
/api/embed,/api/embeddings, or OpenAI-compatible embedding endpointsRelated Issues:
This change ensures consistent behavior between completion and embedding endpoints, allowing administrators to apply the same filtering, logging, and validation logic to all API requests.
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.