mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #20126] feat: extend Mistral OCR with base64 mode for LLM proxy compatibility #25475
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/20126
Author: @KevinRohn
Created: 12/22/2025
Status: 🔄 Open
Base:
dev← Head:dev📝 Commits (10+)
3ca208cfeat: add LiteLLM/Azure compatibility for Mistral OCR61fd9c2Merge branch 'open-webui:dev' into dev99c0ce0Merge branch 'open-webui:dev' into dev8ff00f6Merge branch 'open-webui:dev' into devfad7514Merge branch 'open-webui:dev' into dev5eb9651Merge branch 'open-webui:dev' into dev9450d5aMerge branch 'open-webui:dev' into dev7d84782Merge branch 'open-webui:dev' into deve162af0Merge branch 'open-webui:dev' into dev306c598Merge branch 'open-webui:dev' into dev📊 Changes
6 files changed (+186 additions, -14 deletions)
View changed files
📝
backend/open_webui/config.py(+12 -0)📝
backend/open_webui/main.py(+4 -0)📝
backend/open_webui/retrieval/loaders/main.py(+2 -0)📝
backend/open_webui/retrieval/loaders/mistral.py(+123 -14)📝
backend/open_webui/routers/retrieval.py(+18 -0)📝
src/lib/components/admin/Settings/Documents.svelte(+27 -0)📄 Description
Changelog Entry
MISTRAL_OCR_USE_BASE64andMISTRAL_OCR_MODELenvironment variables were added to enable LLM proxy compatibility (e.g., LiteLLM) for Mistral OCR, allowing base64 data URI format instead of file upload and configurable OCR model selection.Description
Added LLM proxy compatibility for Mistral OCR with base64 encoding support and custom model selection. LLM proxies like LiteLLM wrap providers (e.g., Azure AI Foundry) to expose an OCR endpoint following the Mistral OCR API spec (https://docs.mistral.ai/capabilities/vision/#optical-character-recognition-ocr).
Mistral OCR only works with the official API endpoint atm using file upload with signed URLs.
This change allows to select between the upload method and base64 data URI format.
Added
MISTRAL_OCR_USE_BASE64environment variable and UI toggle to enable base64 data URI format instead of file uploadMISTRAL_OCR_MODELenvironment variable and UI input to configure the OCR model name (default:mistral-ocr-latest)Changed
MISTRAL_OCR_USE_BASE64andMISTRAL_OCR_MODELpersistent config variablesMistralLoader_process_ocr_base64()and_process_ocr_base64_async()methods with conditional workflow selection (I hope this naming is good here)Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
Screenshots or Videos
Using custom model
mistral-document-ai-2505:UI Config



Request
LiteLLM request
Using custom model
azure-doc-intel(Large document):UI Config



Request
LiteLLM request
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.