[PR #4553] [MERGED] Add batch embedding support for Ollama embedding provider #4675

Closed
opened 2026-02-22 18:36:18 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4553
Author: @shatfield4
Created: 10/15/2025
Status: Merged
Merged: 11/25/2025
Merged by: @timothycarambat

Base: masterHead: 4529-feat-ollamaembedder-support-batched-or-parallel-embeddings-to-improve-performance


📝 Commits (6)

  • 9edc759 add batch embedding support for ollama embedding provider
  • cdc2a02 lint
  • 9cd6b0c Merge branch 'master' into 4529-feat-ollamaembedder-support-batched-or-parallel-embeddings-to-improve-performance
  • 98f943c Merge branch 'master' into 4529-feat-ollamaembedder-support-batched-or-parallel-embeddings-to-improve-performance
  • 139d8ad simplify ollama embedder input
  • 80a1bb7 Merge branch 'master' into 4529-feat-ollamaembedder-support-batched-or-parallel-embeddings-to-improve-performance

📊 Changes

4 files changed (+79 additions, -15 deletions)

View changed files

📝 frontend/src/components/EmbeddingSelection/OllamaOptions/index.jsx (+43 -1)
📝 server/models/systemSettings.js (+1 -0)
📝 server/utils/EmbeddingEngines/ollama/index.js (+31 -14)
📝 server/utils/helpers/updateENV.js (+4 -0)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #4529

What is in this change?

  • Switched embed() call to use input param vs the old prompt param to support batch processing
  • Adds new advanced options item to allow for adjusting batch size in Ollama provider (default is 1)
  • Updated logging to show batch sizes and progress

Additional Information

  • Ran into this issue that is on Ollama's end: https://github.com/ollama/ollama/issues/6094
  • Reduce Max embedding chunk length in Ollama settings to get past this error
  • Had to change nomic-embed-text which usually has context of 2048 to 1024

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 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/Mintplex-Labs/anything-llm/pull/4553 **Author:** [@shatfield4](https://github.com/shatfield4) **Created:** 10/15/2025 **Status:** ✅ Merged **Merged:** 11/25/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `4529-feat-ollamaembedder-support-batched-or-parallel-embeddings-to-improve-performance` --- ### 📝 Commits (6) - [`9edc759`](https://github.com/Mintplex-Labs/anything-llm/commit/9edc759172300fe5866e8d8b63cbefb778e05d06) add batch embedding support for ollama embedding provider - [`cdc2a02`](https://github.com/Mintplex-Labs/anything-llm/commit/cdc2a02bbc65524270806b8e90000c9f9fc7f0ed) lint - [`9cd6b0c`](https://github.com/Mintplex-Labs/anything-llm/commit/9cd6b0c83f70463ce2b9e57ff852663ac70cf740) Merge branch 'master' into 4529-feat-ollamaembedder-support-batched-or-parallel-embeddings-to-improve-performance - [`98f943c`](https://github.com/Mintplex-Labs/anything-llm/commit/98f943cb8ea566aa358a3e206b87a78761fefbf0) Merge branch 'master' into 4529-feat-ollamaembedder-support-batched-or-parallel-embeddings-to-improve-performance - [`139d8ad`](https://github.com/Mintplex-Labs/anything-llm/commit/139d8ad2f2191644faa5a6a640b866059007647f) simplify ollama embedder input - [`80a1bb7`](https://github.com/Mintplex-Labs/anything-llm/commit/80a1bb7ad459bbb88b179a7e2c682b74cea47f30) Merge branch 'master' into 4529-feat-ollamaembedder-support-batched-or-parallel-embeddings-to-improve-performance ### 📊 Changes **4 files changed** (+79 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/EmbeddingSelection/OllamaOptions/index.jsx` (+43 -1) 📝 `server/models/systemSettings.js` (+1 -0) 📝 `server/utils/EmbeddingEngines/ollama/index.js` (+31 -14) 📝 `server/utils/helpers/updateENV.js` (+4 -0) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #4529 ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> - Switched `embed()` call to use `input` param vs the old `prompt` param to support batch processing - Adds new advanced options item to allow for adjusting batch size in Ollama provider (default is 1) - Updated logging to show batch sizes and progress ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> - Ran into this issue that is on Ollama's end: https://github.com/ollama/ollama/issues/6094 - Reduce `Max embedding chunk length` in Ollama settings to get past this error - Had to change `nomic-embed-text` which usually has context of 2048 to 1024 ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:18 -05:00
yindo closed this issue 2026-02-22 18:36:18 -05:00
yindo changed title from [PR #4553] Add batch embedding support for Ollama embedding provider to [PR #4553] [MERGED] Add batch embedding support for Ollama embedding provider 2026-06-05 15:19:45 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4675