mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[PR #18872] [CLOSED] feat: Add more Mistral OCR configuration options and update UI #40638
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/18872
Author: @paddy313
Created: 11/2/2025
Status: ❌ Closed
Base:
dev← Head:feature/mistral_ocr📝 Commits (10+)
671bb06feat: Add Mistral OCR configuration options and update UI for endpoint and model34372fdfeat: Add MISTRAL_OCR_USE_BASE64 configuration option538d00afeat: Add validation option for MistralLoader to control API limits checking07ccff4fix: Disable debug logging in MistralLoader for cleaner output8fcf438refactor: Remove Mistral API limits validation from MistralLoadercab3dadfeat: Add Mistral OCR configuration options and update UI for endpoint and model48fd1adfeat: Add MISTRAL_OCR_USE_BASE64 configuration option1fb6770feat: Add validation option for MistralLoader to control API limits checking15cf676fix: Disable debug logging in MistralLoader for cleaner outpute6ca93crefactor: Remove Mistral API limits validation from MistralLoader📊 Changes
7 files changed (+704 additions, -154 deletions)
View changed files
📝
backend/open_webui/config.py(+18 -0)📝
backend/open_webui/main.py(+6 -0)📝
backend/open_webui/retrieval/loaders/main.py(+8 -1)📝
backend/open_webui/retrieval/loaders/mistral.py(+590 -149)📝
backend/open_webui/routers/retrieval.py(+27 -0)📝
backend/open_webui/utils/middleware.py(+1 -3)📝
src/lib/components/admin/Settings/Documents.svelte(+54 -1)📄 Description
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:
devbranch. Not targeting thedevbranch may lead to immediate closure of the PR.Changelog Entry
Description
Updated the Mistral OCR loader to allow for defining additional endpoints and models, and to support two different methods (upload/base64) to use with the API.
Previously, defining different endpoints was not possible. However, given that the Mistral OCR API can be used with LiteLLM or in Azure AI Foundry, it was necessary to enhance the Mistral loader to use diverse endpoints and model names.
LiteLLM and Azure AI Foundry do not support document upload with a signed URL; they only permit sending PDFs as base64 encoded strings. The official Mistral OCR API supports both methods. The upload method is faster for larger files. Consequently, I have provided the option in the UI, allowing users to choose between the two methods based on endpoint support.
Added
MISTRAL_OCR_ENDPOINT: Custom endpoint supportMISTRAL_OCR_MODEL: Model name configurationMISTRAL_OCR_USE_BASE64: Method selection flagChanged
config.pyandmain.py: Added environment variable handlingretrieval/loaders/main.py: Updated Mistral loader constructor with new parametersretrieval/loaders/mistral.py: Implemented base64 encoding support for API compatibilityrouters/retrieval.py: Added configuration variable managementDocuments.svelte: Added input fields for endpoint and model selectionFixed
Additional Information
Screenshots or Videos
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.