Local VLM Inference in Practice: A Four-Model Showdown
This article walks through a hands-on comparison of four vision language models (VLMs) running on a single local GPU. It starts with the launch parameter most developers overlook—the vision projection file—and explains why a text-only startup silently disables image input. It then covers a two-scenario test design (table OCR and screenshot-to-code), the observed strengths and weaknesses of general-purpose, document-parsing, and coding-oriented models, a reusable selection framework, and a practical engineering checklist for validation, consistency checks, degradation, and cost control.
1. The Overlooked Parameter: From Text-Only to Actually Seeing Images
Many local inference setups already support multimodal input but have never had it enabled. The typical symptom: the service runs in text-only mode, the model loads fine and chats smoothly, but as soon as an image goes into the request, you get a vague description or an outright error.
The problem is usually not the model but how it was started. In local inference frameworks, a vision language model (VLM) has two parts: a language backbone that handles understanding and generation, and a vision projection layer that maps the high-dimensional features from the image encoder into the language model’s embedding space. The backbone decides whether the model can talk; the projection layer decides whether it can see. If the projection weights are not explicitly loaded at startup, you are running a pure text model, and image input is ignored or dropped.
In mainstream local inference frameworks, this switch is usually a separate projection file parameter:
# Example: load the language backbone + vision projection layer./server \-m ./models/vlm-language-part.gguf \--mmproj ./models/vlm-vision-projection.gguf \-c 8192 \--host 0.0.0.0 --port 8080
Three practical points:
- The projection file must strictly match the backbone version. When a projection layer exported from a different training batch does not match the backbone, the model still produces text but answers the wrong question—harder to diagnose than a hard failure.
- Precision affects both VRAM usage and quality. Higher-precision projection files are more stable, quantized versions save VRAM, and precision that is too low noticeably weakens fine-detail recognition.
- A missing parameter fails silently. The service starts normally and passes health checks; only a real image request exposes the problem. Run a smoke test with an image of known content before going live.
The takeaway: the capability boundary of a local deployment is often set by configuration, not hardware. Ten minutes spent reading the startup parameter documentation may pay off more than a new GPU.
2. Test Design: Two Scenarios, Four Models, One GPU
A benchmark is only useful if the scenarios resemble real workflows. Scores detached from real tasks offer almost no guidance for engineering decisions. This evaluation followed three principles: realistic tasks, controlled variables, and verifiable metrics.
Hardware and conditions: a single 24 GB consumer GPU, with all local inference services run at the same context length and the same sampling parameters, so randomness is not mistaken for model differences.
Scenario 1: text recognition (OCR). The input is a screenshot of a comparison table with multi-level headers, merged cells, and percentage values. The required output is structured plain text or markup. The focus is column alignment, numeric precision, and whether table semantics get flattened.
Scenario 2: screenshot to web code. The input is a screenshot of a web application interface you designed yourself, and the required output is runnable markup and style code. The focus is layout fidelity, understanding of component hierarchy, and whether the generated code is usable.
The four models span three technical routes: general-purpose vision language models, document-parsing specialist models, and a coding model with vision capability. The point of this mix is to test a common misconception—“larger or more general” does not mean “better on your task.”
3. Scenario 1 Recap: OCR Is More Than Reading Characters
Table images are the worst case for OCR. The reason is that the hard part of OCR has never been single-character recognition but reconstructing layout structure: reading order, cell membership, and row/column spans across lines. Many models recognize every character correctly yet flatten a two-dimensional table into one-dimensional running text that downstream programs cannot parse.
Three patterns emerged:
First, document-parsing specialist models had a clear advantage on structure metrics. They typically introduce layout analysis and table reconstruction objectives during training, so they are more stable on merged cells and borderless tables.
Second, general-purpose VLMs were fine on readability but weaker on parseability. They tend to produce a description that reads smoothly for humans rather than strictly aligned rows and columns.
Third, handwriting, stamps, and multiple languages are shared weak spots. These samples differ substantially from printed text in glyph distribution, so any model losing points here is expected. Weight selection by the real proportion of such samples in your business, not by the overall score.
Engineering advice: if downstream code consumes the result, state the output format constraints explicitly in the prompt and keep one structural validation step. Example:
Convert the table in the image to markup text, with these requirements:1. Preserve the original row and column order;2. Fill merged cells with placeholders;3. Output numbers and percent signs as-is, with no conversion;4. Output only the table markup, with no explanation.
4. Scenario 2 Recap: Where Screenshot-to-Code Splits
“Look at an image and build the page” is a high-value test of visual understanding because it demands recognition, reasoning, and generation at once. The split was clear:
- Layout fidelity: whether the model correctly judges grid relationships and alignment instead of stacking everything into a vertical list.
- Component abstraction: whether repeated visual units are recognized as list items or cards rather than hard-coded one by one.
- Code usability: whether the generated markup and styles are properly closed, class names are self-consistent, and the result renders directly.
- Detail faithfulness: whether colors, spacing, and font sizes stay close to the original or fall back to a “looks about right” template.
A counterintuitive result: general-purpose large models tend to generate pages that are “pretty but wrong,” while coding-oriented vision models tend to produce output that is “plain but close.” For pixel-level reproduction, the latter is more practical; for quickly producing an iterable prototype, the former is acceptable.
Prompt engineering paid off more than switching models here. The effective approach is layered questioning: first have the model describe the layout, then have it output code, then have it self-check the differences. Example flow:
Step 1: Describe only the layout, no code (regions, alignment, hierarchy).Step 2: Output the full markup and styles based on that description.Step 3: List three details you cannot determine from the image, and give default values.
Step 3 matters most: it makes the model’s guesses explicit so a human can correct them quickly, instead of leaving traps inside code that looks complete.
5. Selection Methodology: Turning the Showdown into a Decision Table
A four-model melee should end as a reusable decision table, not a one-off winner. Suggested dimensions:
- Task fit: structured documents favor the specialist route, interface reproduction favors the coding-oriented route, open-ended Q&A favors the general-purpose route.
- VRAM and throughput: on 24 GB, account for both backbone and projection layer usage and leave room for the context cache; for batch workloads, also evaluate latency drift under concurrency.
- Output parseability: whether format constraints are followed reliably determines whether you need extra post-processing and retry logic.
- Tolerance for failure modes: “answers the wrong question” or “format collapses”? The former is hard to notice, the latter is easy to catch with a fallback, so prefer models whose failures are observable.
- Iteration cost: switching models is easy, changing prompts and the evaluation set is expensive. Build the evaluation set first, then optimize.
6. A Practical Engineering Checklist
- Validate at startup: after initialization, automatically run a built-in sample image, compare key fields, and refuse to go live on failure.
- Dual-file consistency: write the backbone and projection layer version numbers into the config and validate them before startup to prevent mismatches.
- Layered degradation: if the vision path is unavailable, fall back to text-only capability automatically so the main flow is not interrupted.
- Observable results: log the input image fingerprint, prompt version, output structure, and latency to support regression comparison.
- Cost control: route high-frequency simple tasks to a small-parameter model with rule-based fallbacks, and send complex samples to the large-parameter model.
7. Conclusion
One startup parameter decides whether your local environment is “a phone that can make calls” or “a smart device that can take photos.” What the four-model comparison really shows is not which model is stronger, but that capability must be defined by the scenario: structured extraction depends on layout reconstruction, interface reproduction depends on abstraction and faithfulness, and open-ended understanding depends on generalization. Get the evaluation set, format constraints, and degradation strategy right, and the model melee becomes a clear selection table.
