mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #16022] [CLOSED] feat: Add Google embeddings support #62863
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/16022
Author: @ipapapa
Created: 7/25/2025
Status: ❌ Closed
Base:
dev← Head:fix-google-embeddings📝 Commits (4)
ffff6fafeat: Add Google embeddings supportb8da4a8refacd7262aaMerge branch 'open-webui:main' into fix-google-embeddingsb21509dfeat: Add Google embeddings support with migration guidance📊 Changes
6 files changed (+190 additions, -19 deletions)
View changed files
📝
README.md(+41 -0)📝
backend/open_webui/config.py(+0 -6)📝
backend/open_webui/env.py(+29 -0)📝
backend/open_webui/main.py(+1 -1)📝
backend/open_webui/retrieval/utils.py(+64 -1)📝
backend/open_webui/utils/auth.py(+55 -11)📄 Description
Add Google embeddings support
Summary
This PR adds support for Google's embedding models (Gemini) to Open WebUI's RAG functionality. Previously, users trying to use Google embeddings would encounter "Unknown embedding engine: google" errors.
Changes Made
Core Implementation
googleto the supported embedding engines list inget_embedding_function()generate_google_batch_embeddings()function following Google's API specificationTechnical Details
models/{model}:batchEmbedContentsAPI endpointx-goog-api-keyheader formatrequestsarray{"embeddings": [{"values": [...]}]}response formatTesting
✅ API Verification: Direct API calls to Google's embedding service succeed
✅ Integration Testing: Open WebUI starts successfully with
RAG_EMBEDDING_ENGINE=google✅ Error Resolution: No more "Unknown embedding engine" errors
✅ Model Recognition: Properly recognizes models like
text-embedding-004Configuration Example
Related Issues
Discussion: https://github.com/open-webui/open-webui/discussions/16043
Closes #11714
Benefits
Backwards Compatibility
This change is fully backwards compatible. Existing configurations continue to work unchanged.
Type of Change
Checklist
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.