mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[PR #12307] [MERGED] feat: Added support for Mistral OCR for Content Extraction #38526
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/12307
Author: @paddy313
Created: 4/1/2025
Status: ✅ Merged
Merged: 4/2/2025
Merged by: @tjbck
Base:
dev← Head:feature/mistral_ocr📝 Commits (4)
1ac6879Add Mistral OCR integration and configuration support93d7702refactor: move MistralLoader to a separate module and just use the requests package instead of mistralaic5a8d2frefactor: update MistralLoader documentation and adjust parameters for signed URL retrieval0ac00b9refactor: update import path for MistralLoader📊 Changes
6 files changed (+282 additions, -5 deletions)
View changed files
📝
backend/open_webui/config.py(+5 -0)📝
backend/open_webui/main.py(+2 -0)📝
backend/open_webui/retrieval/loaders/main.py(+12 -0)➕
backend/open_webui/retrieval/loaders/mistral.py(+225 -0)📝
backend/open_webui/routers/retrieval.py(+16 -0)📝
src/lib/components/admin/Settings/Documents.svelte(+22 -5)📄 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.Changelog Entry
Description
As proposed in discussion #11386 and #12062, this PR introduces Mistral OCR support for PDF content extraction within Open Web UI. Mistral OCR excels at interpreting complex document elements—including images, math, tables, and LaTeX layouts—enabling deeper understanding of rich documents like scientific papers with charts, graphs, and equations.
I added support for Mistral OCR integration into the backend and frontend of Open Web UI. The changes include adding configuration options, implementing the Mistral OCR loader, and updating the relevant components to handle the new OCR engine.
Added
MISTRAL_OCR_API_KEYconfiguration inbackend/open_webui/config.pyand updated the application state to include this key (backend/open_webui/config.py,backend/open_webui/main.py,backend/open_webui/routers/retrieval.py).MistralLoaderclass for handling OCR processing via Mistral API inbackend/open_webui/retrieval/loaders/mistral.py.src/lib/components/admin/Settings/Documents.svelte.Changed
_get_loadermethod inbackend/open_webui/retrieval/loaders/main.pyto include the Mistral OCR loader.Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
Screenshots or Videos
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.