mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[PR #2725] [MERGED] feat: add RAG_EMBEDDING_OPENAI_BATCH_SIZE to batch multiple embeddings #21072
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/2725
Author: @cheahjs
Created: 6/2/2024
Status: ✅ Merged
Merged: 6/3/2024
Merged by: @tjbck
Base:
dev← Head:feat/openai-embeddings-batch📝 Commits (2)
0cb8163feat: add RAG_EMBEDDING_OPENAI_BATCH_SIZE to batch multiple embeddings92d9b38Merge branch 'dev' into feat/openai-embeddings-batch📊 Changes
39 files changed (+112 additions, -19 deletions)
View changed files
📝
backend/apps/rag/main.py(+16 -2)📝
backend/apps/rag/utils.py(+27 -16)📝
backend/config.py(+6 -0)📝
src/lib/apis/rag/index.ts(+1 -0)📝
src/lib/components/documents/Settings/General.svelte(+28 -1)📝
src/lib/i18n/locales/ar-BH/translation.json(+1 -0)📝
src/lib/i18n/locales/bg-BG/translation.json(+1 -0)📝
src/lib/i18n/locales/bn-BD/translation.json(+1 -0)📝
src/lib/i18n/locales/ca-ES/translation.json(+1 -0)📝
src/lib/i18n/locales/ceb-PH/translation.json(+1 -0)📝
src/lib/i18n/locales/de-DE/translation.json(+1 -0)📝
src/lib/i18n/locales/dg-DG/translation.json(+1 -0)📝
src/lib/i18n/locales/en-GB/translation.json(+1 -0)📝
src/lib/i18n/locales/en-US/translation.json(+1 -0)📝
src/lib/i18n/locales/es-ES/translation.json(+1 -0)📝
src/lib/i18n/locales/fa-IR/translation.json(+1 -0)📝
src/lib/i18n/locales/fi-FI/translation.json(+1 -0)📝
src/lib/i18n/locales/fr-CA/translation.json(+1 -0)📝
src/lib/i18n/locales/fr-FR/translation.json(+1 -0)📝
src/lib/i18n/locales/he-IL/translation.json(+1 -0)...and 19 more files
📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
Add
RAG_EMBEDDING_OPENAI_BATCH_SIZEthat controls how many texts are batched together in a single OpenAI embedding call. OpenAI has a limit of 2048 in a single request.This reduces the number of calls and thus latency of large number of embeddings, and is helpful when limited by the number of API calls instead of tokens embedded (such as Cohere's 5 RPM, 96 texts/embed or Geminis 150 RPM, 100 texts/embed)
Screenshots or Videos
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.