[PR #4715] [MERGED] feat: support ollama batch processing embeddings #44592

Closed
opened 2026-04-29 18:43:36 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/4715
Author: @Peter-De-Ath
Created: 8/18/2024
Status: Merged
Merged: 10/8/2024
Merged by: @tjbck

Base: devHead: ollama-batch-embeddings


📝 Commits (3)

  • 885b9f1 refactor: Update GenerateEmbeddingsForm to support batch processing
  • 3fcdca2 backwards comp: use RAG_EMBEDDING_OPENAI_BATCH_SIZE
  • b242460 formatting

📊 Changes

6 files changed (+84 additions, -97 deletions)

View changed files

📝 backend/open_webui/apps/ollama/main.py (+29 -55)
📝 backend/open_webui/apps/retrieval/main.py (+10 -14)
📝 backend/open_webui/apps/retrieval/utils.py (+25 -17)
📝 backend/open_webui/config.py (+7 -4)
📝 src/lib/apis/retrieval/index.ts (+1 -1)
📝 src/lib/components/admin/Settings/Documents.svelte (+12 -6)

📄 Description

feat: support batch embedding with ollama

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.

Before submitting, make sure you've checked the following:

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests for validating the changes?
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Prefix: To cleary categorize this pull request, prefix the pull request title, using one of the following:
    • BREAKING CHANGE: Significant changes that may affect compatibility
    • build: Changes that affect the build system or external dependencies
    • ci: Changes to our continuous integration processes or workflows
    • chore: Refactor, cleanup, or other non-functional code changes
    • docs: Documentation update or addition
    • feat: Introduces a new feature or enhancement to the codebase
    • fix: Bug fix or error correction
    • i18n: Internationalization or localization changes
    • perf: Performance improvement
    • refactor: Code restructuring for better maintainability, readability, or scalability
    • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
    • test: Adding missing tests or correcting existing tests
    • WIP: Work in progress, a temporary label for incomplete or ongoing work

Changelog Entry

Description

Add support for batch embedding with ollama api

  • [Concisely describe the changes made in this pull request, including any relevant motivation and impact (e.g., fixing a bug, adding a feature, or improving performance)]

Added

Support for batch embedding in a single ollama request

Removed

RAG_EMBEDDING_OPENAI_BATCH_SIZE environment variable

  • [List any removed features, files, or functionalities]

Breaking Changes

  • BREAKING CHANGE: [List any breaking changes affecting compatibility or functionality]
    changed RAG_EMBEDDING_OPENAI_BATCH_SIZE to RAG_EMBEDDING_BATCH_SIZE

Screenshots or Videos

image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/4715 **Author:** [@Peter-De-Ath](https://github.com/Peter-De-Ath) **Created:** 8/18/2024 **Status:** ✅ Merged **Merged:** 10/8/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `ollama-batch-embeddings` --- ### 📝 Commits (3) - [`885b9f1`](https://github.com/open-webui/open-webui/commit/885b9f1ece8f0fc9a4de3390164592c9dbc67282) refactor: Update GenerateEmbeddingsForm to support batch processing - [`3fcdca2`](https://github.com/open-webui/open-webui/commit/3fcdca2f283378f37d55237df5ea112eaa0e0e99) backwards comp: use RAG_EMBEDDING_OPENAI_BATCH_SIZE - [`b242460`](https://github.com/open-webui/open-webui/commit/b242460874967d3e0e9d50bce17ad6f1dff9e7b4) formatting ### 📊 Changes **6 files changed** (+84 additions, -97 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/apps/ollama/main.py` (+29 -55) 📝 `backend/open_webui/apps/retrieval/main.py` (+10 -14) 📝 `backend/open_webui/apps/retrieval/utils.py` (+25 -17) 📝 `backend/open_webui/config.py` (+7 -4) 📝 `src/lib/apis/retrieval/index.ts` (+1 -1) 📝 `src/lib/components/admin/Settings/Documents.svelte` (+12 -6) </details> ### 📄 Description feat: support batch embedding with ollama # Pull Request Checklist ### Note to first-time contributors: Please open a discussion post in [Discussions](https://github.com/open-webui/open-webui/discussions) and describe your changes before submitting a pull request. **Before submitting, make sure you've checked the following:** - [x] **Target branch:** Please verify that the pull request targets the `dev` branch. - [x] **Description:** Provide a concise description of the changes made in this pull request. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [ ] **Testing:** Have you written and run sufficient tests for validating the changes? - [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [x] **Prefix:** To cleary categorize this pull request, prefix the pull request title, using one of the following: - **BREAKING CHANGE**: Significant changes that may affect compatibility - **build**: Changes that affect the build system or external dependencies - **ci**: Changes to our continuous integration processes or workflows - **chore**: Refactor, cleanup, or other non-functional code changes - **docs**: Documentation update or addition - **feat**: Introduces a new feature or enhancement to the codebase - **fix**: Bug fix or error correction - **i18n**: Internationalization or localization changes - **perf**: Performance improvement - **refactor**: Code restructuring for better maintainability, readability, or scalability - **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.) - **test**: Adding missing tests or correcting existing tests - **WIP**: Work in progress, a temporary label for incomplete or ongoing work # Changelog Entry ### Description Add support for batch embedding with ollama api - [Concisely describe the changes made in this pull request, including any relevant motivation and impact (e.g., fixing a bug, adding a feature, or improving performance)] ### Added Support for batch embedding in a single ollama request ### Removed RAG_EMBEDDING_OPENAI_BATCH_SIZE environment variable - [List any removed features, files, or functionalities] ### Breaking Changes - **BREAKING CHANGE**: [List any breaking changes affecting compatibility or functionality] changed RAG_EMBEDDING_OPENAI_BATCH_SIZE to RAG_EMBEDDING_BATCH_SIZE --- ### Screenshots or Videos ![image](https://github.com/user-attachments/assets/bf7d867a-d88a-4ac7-9d1c-968e315da7e4) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-29 18:43:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#44592