Local Multimodal Inference: Don’t Overlook the Projector Configuration

    When a locally deployed vision-language model can chat normally but ignores uploaded images, the problem is often not the model itself but a missing or misconfigured multimodal projector. This article explains how to diagnose text-only degradation, verify that the vision encoder and projector are actually loaded, design a controlled comparison across four abstract candidate models, and evaluate OCR and screenshot-to-page generation with layered metrics. It also provides a deployment checklist and tuning guidance covering request format, image token budget, precision, VRAM, latency, hallucination rate, and code maintainability.

    1. The Symptom: The Service Can Chat but Cannot See Images

    A common misjudgment when deploying a vision-language model locally is assuming that multimodal capability is ready because the language model weights load successfully, text chat works, and the API returns results. In practice, a different set of symptoms may appear: after an image is uploaded, the service either ignores the image entirely and answers only from the text prompt, returns a message such as “unable to view the image,” or produces an answer without errors that clearly does not use the image content.

    These issues often do not mean the model lacks vision support. Instead, the startup configuration may be missing the multimodal projector. A vision-language model typically works through three cooperating parts:

    1. Vision encoder: splits the image into patches or regions and extracts visual features.
    2. Multimodal projector: maps visual features into the language model’s embedding space so the language model can “understand” them.
    3. Language model: receives text instructions and projected visual features to perform recognition, understanding, generation, and other tasks.

    If only the language model weights are loaded without the projector, or if the projector path, precision, switch, or request format does not match, the service degrades to text-only mode. It may not report an error because the text pipeline is still intact. Capability-wise, this is like buying a device with a camera but using it only for phone calls.

    Therefore, the first step in troubleshooting multimodal issues is not to switch models, but to confirm whether the projector is actually active.

    2. Why the Projector Is Easy to Overlook

    Projector configuration is easy to miss for several reasons.

    First, multimodal capability usually consists of multiple weight files. The language model, vision encoder, and projector may be stored separately, and startup parameters may be spread across different configuration sections. Checking only the main model path can easily miss auxiliary components.

    Second, some services silently degrade when the projector is missing. Text requests still work, image requests may be ignored, and logs may not contain a prominent error. If developers run smoke tests only with text prompts, they may not notice that the vision path is not connected.

    Third, request formats and templates are also error-prone. Even if the projector is loaded, the image still will not enter the model context if the request does not correctly include the image field or the chat template does not support image placeholders.

    Fourth, VRAM and precision settings affect loading results. The projector may be saved in a different precision. If it does not match the runtime configuration, loading may fail, fall back, or produce precision anomalies. Such issues require combined analysis of logs, VRAM usage, and actual output.

    An abstracted configuration example is shown below. Field names are only for illustration; actual names vary by framework:

    1. multimodal:
    2. enabled: true
    3. language_model: /models/base-language-model
    4. vision_encoder: /models/vision-encoder
    5. projector: /models/multimodal-projector
    6. image_token_budget: 4096
    7. max_image_resolution: 1280
    8. server:
    9. host: 0.0.0.0
    10. port: 8080
    11. warmup_multimodal: true

    After deployment, verify the vision path with an image request rather than sending only text prompts. A pseudo-request example:

    1. {
    2. "messages": [
    3. {
    4. "role": "user",
    5. "content": [
    6. {"type": "text", "text": "Recognize the text in the image and output it in a table structure"},
    7. {"type": "image", "image": "/data/doc.png"}
    8. ]
    9. }
    10. ]
    11. }

    During validation, focus on the following: whether the service logs show the vision encoder and projector being loaded; whether the request is recognized as a multimodal request; whether the output references specific image content; and whether VRAM usage changes due to additional image tokens. If these signals are missing, return to the configuration layer first.

    3. Designing a Side-by-Side Evaluation of Four Candidate Models

    Once the projector is confirmed to be active, multiple candidate vision-language models can be compared. This article does not focus on specific brands or products. Instead, it abstracts four candidates as A, B, C, and D and focuses on a general evaluation methodology.

    The evaluation should control variables as much as possible: use a fixed single-GPU 24GB VRAM environment, fixed quantization precision, fixed context length, fixed temperature parameter, and fixed image preprocessing strategy. Record first-token latency, total time, peak VRAM, and failure rate. The test set should be layered rather than containing only a few clean screenshots.

    At minimum, cover the following dimensions:

    • Printed documents: regular paragraphs, headings, headers and footers, numbered lists;
    • Complex tables: merged cells, multi-level headers, numeric columns, footnotes;
    • Handwriting: cursive writing, low contrast, skewed capture;
    • Multilingual mixed content: Chinese and English, numbers, and symbols mixed together;
    • Receipts and stamps: small text, stamp occlusion, curved text;
    • Page generation: generating structured page code from screenshots or wireframes.

    Evaluation metrics should also be layered. For OCR tasks, examine character accuracy, field extraction accuracy, table structure restoration, layout order, and hallucination rate. For image-to-page generation tasks, examine semantic structure, visual fidelity, responsive layout, code readability, maintainability, and security. A single aggregate score is not enough, because candidates often diverge significantly across subcategories.

    4. Scenario 1: OCR Is More Than “Reading Characters”

    OCR tasks may look simple, but they heavily test visual token allocation and layout understanding. In testing, the four candidates are likely to diverge on complex tables, handwriting, multilingual content, and receipt or stamp scenarios. Some candidates may be stable on printed paragraphs but misalign columns around merged cells. Some may restore table structure well but miss small text. Some may fluctuate on multilingual mixed content. Others may fill in content that does not exist when a stamp occludes part of the image.

    Therefore, OCR evaluation should not count only “how many characters were recognized.” It must also check whether the structure is correct. For example, if the model outputs a reference comparison table screenshot as continuous text with column names and values misaligned, the post-processing cost remains high even if character accuracy is not low. A more practical approach is to require the model to output a Markdown table while preserving headers, row-column relationships, and empty cells. For receipts and forms, require structured field output and flag uncertain fields.

    Hallucination also requires attention. Vision models may “guess characters” when images are blurry, especially for IDs, amounts, dates, and stamp text. Evaluation should include low-quality images and adversarial samples, and measure whether the model admits it cannot see clearly or fabricates content. In production scenarios, a reviewable “uncertain” result is more valuable than a confident error.

    5. Scenario 2: Image-to-Page Generation Depends on Structure and Maintainability

    Image-to-page generation is another typical task: given a page screenshot, wireframe, or design mockup, the model must output HTML/CSS or component code. This task tests not only visual understanding but also the language model’s instruction following and code organization.

    The four candidates may show different tendencies in testing: some produce complete page structures but only moderate detail fidelity; some achieve better visual fidelity but generate redundant code; some use semantic tags more consistently; and some lose hierarchy in complex layouts. When selecting a model, do not judge only by whether the first glance “looks similar.” Also check:

    • Whether the semantic structure is reasonable and avoids excessive non-semantic containers;
    • Whether the layout is maintainable and avoids hardcoding large amounts of absolute positioning;
    • Whether text, images, buttons, and other elements are replaceable;
    • Whether responsive behavior and basic accessibility are considered;
    • Whether the generated code escapes user content to avoid injection risks;
    • Whether decorative elements from the design are mistakenly written as business content.

    A safer workflow is two-stage generation: first ask the model to output a page structure description and component list, then generate code. After generation, perform static checks and manual spot checks. For complex pages, ask the model to output in blocks to avoid context truncation caused by generating excessively long code at once.

    6. Deployment Checklist and Tuning Recommendations

    Before launch, confirm each item in the following checklist:

    1. The paths for the main language model, vision encoder, and projector all exist and are readable.
    2. The multimodal switch is enabled, and startup logs confirm that the projector loaded successfully.
    3. The projector precision matches the runtime configuration, and peak VRAM is within budget.
    4. The request body correctly includes the image field, and the chat template supports image placeholders.
    5. Image preprocessing resolution and token budget are reasonable, avoiding excessive compression or token explosion.
    6. Text smoke tests and multimodal smoke tests are executed separately.
    7. Failed requests, timeouts, VRAM overflows, and degradation behavior are recorded.
    8. Manual spot checks and post-processing rules are set separately for OCR and page generation.

    For tuning, consider adaptive image resolution, image tiling, token budget caps, projector precision, batching and caching, and concurrency limiting. Higher resolution is not always better. Small-text documents need sufficient resolution, but oversized page screenshots should be scaled or tiled first. Projector precision should not be lowered blindly either; the trade-off between VRAM and recognition quality must be measured in practice.

    7. Conclusion

    The real challenge of multimodal inference often lies not in model leaderboards but in the configuration path and evaluation methodology. A single overlooked projector setting can degrade a service to text-only mode, and an unreasonable evaluation set can distort model selection conclusions. First confirm that the vision path is truly active, then build layered evaluations around OCR and image-to-page generation. Combine latency, VRAM, hallucination rate, and maintainability in the final judgment. Only then can a local multimodal service move from “it runs” to “it is usable.”