Add LFM2.5-VL 3B as a curated llama.cpp OCR model with its own prompt - #14552
Merged
Conversation
LFM2.5-VL-3B (Liquid AI, Q8_0 + mmproj) measured on the 14-image subtitle corpus: 0.00% character error across all eight scripts, italics, busy video backgrounds and small text, where GLM-OCR misreads one Russian word. It is a general instruction-following vision model, though, and answers the shared OCR prompt's "identify the number of lines" clause literally - every result began with a bare "2" line - and drops ♪ marks unless the prompt names them. So it ships with its own PromptTemplate (13/14 exact, 14/14 text-only, no merged lines, ♪ kept) and a new LlamaCppServerManager.ResolveOcrPrompt that applies a model's prompt only while the user's shared prompt is still the default; an edited shared prompt drives every model. Wired at all four OCR entry points (OCR window, Video OCR, batch convert, seconv). Ranked second behind GLM-OCR: 2.5x the download and ~2.5x slower per image. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds LiquidAI/LFM2.5-VL-3B-GGUF (Q8_0 + Q8_0 mmproj, 3.5 GB) to the curated llama.cpp OCR model list, ranked second behind GLM-OCR.
Why
Measured 2026-09-05 on the 14-image subtitle corpus (EN/DE/FR/ES/IT/RU/ZH/JA, ♪ cue, SDH
#cue, italics, two video-frame burn-ins, small strip), SE's flags/square-pad/temperature 0, llama.cpp b10507:Character recognition is flawless, but it is a general instruction-following VLM: given the shared prompt's "Identify the number of lines, then..." it answers with a bare
2line before the text, every time, and it drops ♪ unless the prompt mentions symbols. Its one miss with the tuned prompt over-splits a line; it never merges.How
SeOcrDefaults.LlamaCppOcrPromptLfm25Vland aPromptTemplateon the model entry (reusing the field the translate models already have).LlamaCppServerManager.ResolveOcrPrompt(model, userPrompt): the model's prompt applies only while the shared OCR prompt is still the default. A user who edited the shared prompt drives every model with it, and the prompt box never changes under them, so the earlier per-model-prompt objection does not apply.--ocr-urlmodes;--ocr-promptstill overrides).LlamaCppOcrPromptResolveTests(6) plus the existing order/mmproj guards.Verified end to end with seconv on a real Blu-ray
.sup: no count prefix, line breaks intact.🤖 Generated with Claude Code