Local Multimodal Deployment: The Overlooked Projection Parameter

    This article walks through switching on multimodal (vision) capability in a locally deployed LLM inference service by loading the often-overlooked multimodal projection weight, then documents a hands-on comparison of four local vision-language models across five real-world tasks. It explains how local VLM inference is structured, how to budget VRAM on a single 24GB consumer GPU, how to pass images through a standard multimodal chat API, and how to design repeatable, bias-controlled evaluations. It shares concrete findings on screenshot-to-code generation, invoice and field extraction, drawing and chart reading, long-document Q&A, and pure-text coding, and closes with a model-selection decision table plus production pitfalls (silent degradation, undersized context defaults, missing authentication) to help readers pick the right model and safely productionize local multimodal inference.

    A Foreword: Vision That Was Locked Up for Months

    For a long time, my main development workhorse was a locally deployed, ~27B-class text model. When I started the local inference service, I loaded only a set of text weights and never mounted any vision-related components. For everyday script generation, explaining errors, and refactoring modules, this was plenty, so I basically never touched the launch parameters again. The only annoyance: whenever a colleague dropped a screenshot of API documentation or a page design mockup, I first had to find another tool to convert it into text and then paste the result back into the chat window. I repeated this workaround dozens of times without ever questioning it.

    The turning point came from a random browse through the launch-parameter docs. There was an option for specifying the “multimodal projection weight file” that I had been ignoring:

    1. # Mount multimodal projection weights in addition to the text main model (flag name varies by framework)
    2. ./local-inference-server \
    3. --model /path/to/llm-text-model.gguf \
    4. --proj /path/to/vision-mmproj-F16.gguf \
    5. --ctx-size 8192 \
    6. --host 127.0.0.1 \
    7. --port 8080

    That’s it? That’s it. For months I had been running text tasks on hardware that included “vision” capability, but I never connected its eyes. To use an analogy, it’s like buying a phone with a camera but only using it to make calls. The capability was always in the hardware; all that was missing was a switch.

    Now that I’d found it, I couldn’t let it sit idle. I dug out four locally available multimodal models and compared them item by item on real tasks: generating pages from screenshots, invoice recognition, reading part drawings, and Q&A on report slides with charts. What follows is a record of the whole calling process, the testing methodology, the selection conclusions, and the pitfalls I hit along the way.

    1. How Local Services Suddenly Understand Images

    To judge whether this switch is reliable, you first need to understand the basic structure of local multimodal inference. Mainstream local vision-language models (VLMs) are mostly assembled from three parts:

    1. Vision encoder: slices an image into patches and extracts visual features for each patch. This step can reuse a mature vision backbone, so the parameter count is relatively manageable.
    2. Multimodal projection layer: usually just a few linear layers or a small network, responsible for mapping visual features into the language model’s token embedding space.
    3. Language backbone: takes an input sequence formed by concatenating text embeddings with the projected visual embeddings, and performs autoregressive generation just like it would for ordinary text.

    When the local inference framework loads only text weights, parts 1 and 2 don’t exist, so the service can naturally only read text. Once you add the projection weights, image information can enter the context in the form of “special visual tokens” and participate in attention computation alongside text tokens. The model isn’t literally “seeing” the image; it’s interpreting a set of encoded visual features using the language model’s world knowledge.

    Understanding this naturally leads to three practical conclusions:

    • Multimodality is essentially context expansion. Images consume the context window. A common implementation roughly treats every 14×14 pixels as one visual patch, so a 1024×1024 screenshot often corresponds to hundreds or even thousands of visual tokens. Long documents and high-resolution drawings need to be sliced or scaled, otherwise they’re easily truncated.
    • Text capability and vision capability share the same “brain.” The language backbone determines the ceiling for reasoning, instruction following, and code generation, while projection quality determines how clearly the “eyes” see. Swapping the vision part won’t change the model’s programming level, so during selection you should evaluate “backbone capability” and “vision capability” separately.
    • Pure text tasks don’t have to bear the vision overhead. The vision encoder can be unloaded on demand without affecting the conversation, so the same text weights can support both workloads at once.

    2. Preparation: Allocating VRAM on a Single 24GB GPU

    For local multimodal deployment, the first step isn’t choosing a model but calculating VRAM. Total usage can be approximated as:

    1. VRAM usage ≈ language backbone weights + projection weights + vision encoder weights (when resident)
    2. + KV cache + temporary vision encoding overhead

    The KV cache can be roughly estimated with a simplified formula (half-precision storage):

    1. KV cache ≈ 2 × layers × KV heads × head dimension × 2 bytes × context token count

    Take a common ~30B-class model structure (60 layers, 8 KV heads, head dimension 128): roughly 0.24GB per 1K of context. If you keep 1K of text and 1.5K of visual tokens at once and reserve 1K of generation space, a single request’s KV cache is around 0.84GB.

    This test used a consumer-grade GPU with 24GB of VRAM. With a baseline of “model quantized to roughly 4-bit, vision encoder resident, 2GB system margin reserved,” here is a budget table (numbers are order-of-magnitude illustrations):

    Language backbone size Weights Projection weights Usable context (incl. reserve) Concurrent requests
    ~8B ~4.5GB ~0.3GB ~12K ~4
    ~14B ~8GB ~0.5GB ~10K ~2
    ~32B ~19GB ~0.8GB ~2K 1

    Two easily overlooked details:

    • Quantization must be aligned. Projection weights are usually higher precision (e.g., half precision or 8-bit) and typically work fine alongside a quantized backbone, but you must confirm both come from the same model and the same version. Mixing is the most common source of errors.
    • A 32B-class backbone can run, but it’s hard to “look and chat at the same time.” Once the weights approach 20GB, little room is left for context. A few high-resolution screenshots fill the window, and there’s almost no concurrency headroom beyond a single request. If the input is mainly high-resolution drawings, it’s better to put vision preprocessing on a GPU node with more headroom and then connect it to the text backbone service.

    Once the budget is set, start a “multimodal instance.” The key is to keep a pure-text instance as a control, which you’ll need later. The parameters mean:

    • --ctx-size: context length, which must hold both text and visual tokens;
    • --no-mm-offload: turn off GPU offloading of the vision encoder, leaving vision computation to the CPU;
    • --mmproj-use-gpu: control whether the projection layer participates in GPU computation; combined with the above, this lets you “scale with available VRAM.”

    3. The Interface: Adding an Image to a Standard Request

    After startup, sending an image request directly will probably fail. The reason is simple: an ordinary text interface’s request body only accepts strings, so there’s nowhere to put image information. Mainstream compatible interface formats today design the message content field as an array, allowing text and images to be mixed. Take invoice recognition as an example:

    1. import base64
    2. import requests
    3. # Sample code: the image is inlined into the standard multimodal message structure as a data URL
    4. with open("invoice.png", "rb") as f:
    5. image_b64 = base64.b64encode(f.read()).decode()
    6. payload = {
    7. "model": "local-vlm",
    8. "messages": [
    9. {
    10. "role": "user",
    11. "content": [
    12. {
    13. "type": "text",
    14. "text": "Extract the issue date, amount, and buyer name from the invoice. Output as JSON with English field names.",
    15. },
    16. {
    17. "type": "image_url",
    18. "image_url": {"url": f"data:image/png;base64,{image_b64}"},
    19. },
    20. ],
    21. }
    22. ],
    23. "temperature": 0.1,
    24. "max_tokens": 512,
    25. }
    26. resp = requests.post(
    27. "http://127.0.0.1:8080/v1/chat/completions", json=payload, timeout=60
    28. )
    29. print(resp.json()["choices"][0]["message"]["content"])

    This request was itself part of the test. At first I sent it to an instance with only text weights, and the model didn’t error out; instead it earnestly “analyzed” the invoice: “You didn’t provide an image, so here’s a general example of invoice fields…” The reply was fluent but entirely fabricated. If you judge only by “does it reply normally,” it’s easy to mistakenly think vision is already working.

    So the most reliable way to judge whether vision is loaded is to ask a question whose answer exists only in the image and see whether the reply lands on concrete, pixel-level details. If the model repeatedly says “I can’t see an image” or only gives generic descriptions, check three things first:

    1. Whether the inference service loaded projection weights that match the backbone;
    2. Whether the vision encoder has been unloaded (when VRAM is tight, the framework may automatically fall back to text-only mode);
    3. Whether the image was silently cropped or truncated because it exceeded resolution or context limits.

    One caution: local inference services usually have no authentication by default, and the example above deliberately binds to the local address. It’s only appropriate to listen on an external address in a trusted intranet environment; if you really need to expose the capability, put an API gateway with authentication and rate limiting in front of it, and never expose the service directly to the public internet.

    4. Evaluation: Four Contenders, Five Tests

    The four locally available multimodal models have very different positioning (for discussion, call them A, B, C, and D):

    • A: a 32B-class general chat model + projection. Strongest language backbone, strong coding ability, and it handles my daily programming.
    • B: a 9B-class native vision-language model. Jointly modeled on images, text, and video from the pretraining stage, so it’s relatively sensitive to layout structure and chart relationships.
    • C: a 3B-class native vision-language model. Small, and a common 4-bit quantized version fits on an 8GB GPU.
    • D: a 4B-class native vision-language model. Specifically optimized for document and graphics scenarios, with long-document understanding as a strength.

    The evaluation deliberately avoided public leaderboards and instead designed five tests around “the work you’d really hand to a local service,” following competition-style rules — a fixed test topic, fixed scoring criteria, and evaluators who don’t know the contenders’ identities in advance — to constrain subjective bias:

    Scenario Task description Scoring criteria
    ① Screenshot to page Given a screenshot of a course-schedule app home page, generate single-file HTML+CSS Layout fidelity, style fidelity, detail completeness, runnability
    ② Invoice/receipt recognition 50 real invoice images of varied formats; extract key fields and compare field by field with manual annotations Field accuracy, JSON format compliance rate
    ③ Drawing and object reading Water-cup three-view (with dimension labels), photo of a mechanical part, star map, user-feedback screenshot Whether answers land on concrete details, whether anything is fabricated
    ④ Chart data interpretation Trend chart with dual Y-axes, bar chart, stacked area chart Trend judgment, value reading, whether conclusions exceed what’s shown
    ⑤ Long-document Q&A Cross-page questions about a 30-page product manual (e.g., “how does the warranty scope connect with the warranty period described in Section 3”) Retrieval completeness, cross-page integration, basis for the answer

    For execution, I followed several principles:

    • Each model ran each task 3 times, taking the median to reduce single-run randomness;
    • Prompts were unified, stating only the task goal and output format, without giving solution steps;
    • Text and images were fixed in the same message;
    • For recognition tasks, I used a fixed random seed and a unified temperature parameter.

    Test ①: Screenshot to page. One prompt sufficed, with no multi-turn revisions:

    1. Based on this course-schedule app home page screenshot, generate complete single-file HTML (inline CSS),
    2. so that when opened in a browser it closely matches the screenshot. Don't output explanations, only code.
    Contender Result summary
    A Structure basically correct, header gradient and course-card rounded corners reproduced well; color scheme drifted; missing the scroll indicator bar
    B Highest detail fidelity; icons, card shadows, and bottom navigation close to the original; generation time about half of A’s
    C Main sections present, spacing and hierarchy differ, colors approximate; overall usable, low tweaking cost
    D Clear page skeleton, mostly accurate copy; average visual fidelity, bottom navigation simplified to text links

    The original screenshot looked like this:

    1. ┌─────────────────────────┐
    2. │ ≡ My Timetable ⚙ │
    3. │ ┌─────────────────────┐ │
    4. │ │ September October │ │
    5. │ ├─────────────────────┤ │
    6. │ │ Mon Tue Wed Thu Fri│ │
    7. │ │ 28 29 30 1 2 │ │
    8. │ ├─────────────────────┤ │
    9. │ │ 10:00 │ │
    10. │ │ ┌───────┐ ┌───────┐ │ │
    11. │ │ │Calculus│ │English│ │ │
    12. │ │ │A-301 │ │B-205 │ │ │
    13. │ │ │ Zhang │ │ Wang │ │ │
    14. │ │ └───────┘ └───────┘ │ │
    15. │ │ 14:00 │ │
    16. │ │ ┌───────┐ │ │
    17. │ │ │ DS │ │ │
    18. │ │ │C-102 │ │ │
    19. │ │ │ Chen │ │ │
    20. │ │ └───────┘ │ │
    21. │ └─────────────────────┘ │
    22. │ ● ○ ○ (scroll dots) │
    23. └─────────────────────────┘

    Tests ②③: The “first tier” of recognition and format discipline. B’s field-by-field accuracy was 48 of 50 fully correct, tying with D in the first tier; A got 45 and C got 39. More noteworthy is “fabricated fields”: some receipts aren’t standard invoices, and A would fill in invoice codes and check digits from experience. In finance and contract scenarios, fields that appear out of nowhere are more dangerous than missing fields, because downstream systems treat them as real data. Recognition tasks should prefer vision-language models specially trained on document and graphics data, and the prompt should explicitly require “return null for fields not present in the image.”

    D’s answers also reflected the typical traits of a long-document model: willing to pursue details over multiple turns, such as asking “is the buyer’s tax ID complete” and “does the tax-inclusive total match the amount in words.” If you connect it to a business system, you shouldn’t take only the first-turn output; you can organize the continuous follow-ups into a complete “recognize + verify” flow.

    Tests ③④: The watershed between generalist and specialist. A could say the water cup is “higher on the left, lower on the right, opening off to one side,” and could identify a hex bolt head in a part photo, but needed two prompts before giving a complete answer, averaging over 30 seconds across three runs. Facing the water-cup drawing’s “φ70, 95” dimension labels, D directly refused to answer, saying “there’s no corresponding information in the image,” and only after some follow-up did it extract the values from the drawing — showing a strong conservative tendency. C answered correctly on the three-view and was the fastest, but when facing the star map it mistook the Summer Triangle for Orion, a typical small-model hallucination. B answered correctly on the first try for the three-view, the part photo, and the star map, taking about a third of A’s time.

    From this you can see that selection should distinguish two technical routes: “general chat model + projection” versus “native vision-language model”:

    • The former has a stronger language backbone but did less “vision homework.” Vision and text were likely trained separately at different stages, with the projection layer doing only lightweight alignment, so the model can perceive “objects” in the image but can’t read structural relationships and fine text accurately.
    • The latter jointly modeled in a multimodal way from the pretraining stage, making it more sensitive to layout, charts, and coordinate axes, and often more cost-effective at small sizes.
    • The cost is a smaller language backbone, so on pure-text tasks its long-chain reasoning and coding ability generally falls short of a same-class or larger general text model.

    Tests ④⑤: Speed, capability, and “knowing your limits” are equally important.

    Contender Time to first token (32B spec) Generation speed Pure-text coding mini-tasks (10) Test ⑤ accuracy (10)
    A ~4.1s ~6.5 token/s 9/10 6/10
    B ~1.2s ~21 token/s 6/10 8/10
    C ~0.3s ~46 token/s 4/10 5/10
    D ~1.5s ~18 token/s 5/10 9/10

    The pure-text task was “write a script to batch-rename files, including files with Chinese names,” scored as “passes on the first try / usable with minor edits / unusable.” This round, C used only 4-bit quantization, B was at roughly 8-bit level, and A was at roughly 4-bit level.

    On Test ④, B could read the units and magnitude of the axes and accurately point out “a peak near the end of the third quarter”; D was also correct but added “the chart doesn’t label specific values.” A, on the other hand, explained the relationship between the dual-Y-axis curves backwards, twice out of three runs.

    On Test ⑤, D got 9 right, A got 6, and C only 5. Worth noting: when a question touched on something like “refund conditions” that the document didn’t cover at all —

    • C fabricated a “7-day no-questions-asked” clause;
    • A answered “the original doesn’t state it, but by common e-commerce convention…”;
    • B and D both clearly stated the document had no relevant content.

    For Q&A meant to plug into a business system, “knowing your limits” is itself a core capability.

    Overall, A didn’t lose at its own strength: it got 9 of 10 pure-text coding mini-tasks right, the only one of the four that can directly handle complex coding tasks. It simply fell behind the vision-specialized models at “seeing images.” This confirms the judgment from part one: language ability sets the ceiling of the “brain,” while vision ability depends on whether the “eyes” were specially trained — the two need to be evaluated separately.

    5. From Evaluation to Model Selection: A Decision Table You Can Follow

    Use-case scenario Preferred choice Reason
    Screenshot/design mockup to frontend code Native vision-language model (small-to-medium size, 8-bit-level quantization) Good layout and style fidelity, fast response
    Receipt/ID/contract extraction Document-graphics-specialized vision-language model High field accuracy, proactively asks and verifies
    Complex chart reasoning, long-document Q&A Long-document-optimized model + large-model complement Former strong at retrieval and integration, latter fills in complex reasoning
    Pure-text coding, refactoring, error explanation Large general text model (can unload the vision encoder) Strongest language backbone capability
    Low-VRAM devices, offline real-time image recognition 3B-class vision-language model Runs on 8GB VRAM, lowest latency

    Three lessons for implementation:

    1. Combine on demand rather than chasing an “all-rounder.” When VRAM allows, use a pure-text instance for coding tasks, a small vision-model instance for recognition tasks, and a scheduling layer to route by request type — often more cost-effective than one 32B-class multimodal model trying to do everything.
    2. Replace gut feeling with repeatable evaluation. Turn real business images into a small regression test set, rerun it after each model or quantization-version change, and score with fixed criteria. This is also the most worthwhile competition logic from the evaluation: who’s stronger or weaker only counts when measured.
    3. Explicitly output “unknown.” Require in the prompt “answer ‘cannot be determined’ for any information not provided in the image,” and validate in post-processing whether the output matches the required format. This effectively suppresses “fabricated fields” and “over-interpretation.”

    Going from personal testing to team production, local deployment is only the starting point; a few layers of engineering capability still need to be filled in:

    • Service and scheduling: containerize the inference service and use an API gateway for authentication, rate limiting, and routing;
    • Elasticity and hosting: when inference volume has peaks and troughs, you can scale up and down on demand via cloud container platforms; teams without GPU operations experience can also evaluate model-hosting cloud services — vendors such as Baidu AI Cloud offer related capabilities, so refer to the official documentation for specifics;
    • Observability: use logging and monitoring alerts to collect time to first token, generation speed, VRAM usage, and failure rate, so performance degradation is caught before it affects users;
    • Model asset management: version-register and checksum the backbone and projection files to ensure they’re updated as a pair;
    • Input security: uploaded images may contain sensitive information like IDs and contracts. When you need to send them to a third-party service, evaluate the cloud vendor’s data-processing and privacy-compliance terms, and prefer solutions where the data stays within your own domain.

    6. Pitfalls Hidden in the Details

    1. Loading only the backbone doesn’t error — but it starts “making up stories.” This is the most dangerous failure mode, and you need “pixel-level verification” to catch it.
    2. The default context is too small. A common default is 2048, and a single high-resolution screenshot can eat more than half of it. When visual tokens far exceed expectations, text instructions get pushed to the edge of attention and you get “answers that miss the question.”
    3. Silent degradation from insufficient VRAM. Some frameworks automatically fall the vision encoder back to the CPU when VRAM is tight, or even switch to text-only mode. You should bring the relevant logs into monitoring rather than only watching whether the endpoint returns 200.
    4. Resolution and format. Ultra-long screenshots, transparent-channel images, and huge-resolution drawings may get cropped or compressed during preprocessing, blurring text and losing detail. Normalize scaling and format conversion before integration.
    5. “Invisible instructions” in prompts. A user-uploaded screenshot may contain text like “ignore previous instructions,” and the model may execute text found in the image as instructions. For tool-calling scenarios, isolate and filter recognition results.
    6. An unauthenticated inference service. A locally listening service, once exposed directly to the public internet, lets anyone consume your VRAM and even read sensitive content through the model. You must add authentication and rate limiting before serving externally.

    Conclusion

    Looking back, the biggest takeaway from this trial by fire isn’t picking the “strongest model,” but realizing one thing: the multimodal capability of a local inference service is often just one projection parameter away from being switched on; and once it’s on, choosing the right model matters more than choosing a big one.

    • If your main work is coding, the original pure-text setup wasn’t wrong — it just took a detour whenever screenshots came up;
    • If your workflow is full of screenshots, receipts, and drawings, then an 8B-to-9B-class native vision-language model may suit you better than a 32B-class general multimodal model: faster, more VRAM-efficient, and better at “seeing images”;
    • If it’s only occasional use, adding a projection parameter to the inference service, loading on demand and unloading when done, may be the most cost-effective option.

    As for the next step, I plan to turn D’s “proactive follow-up” behavior in document scenarios into a complete recognition-plus-verification pipeline, then connect it to the regression test set to see whether it can stably reproduce today’s results on real business data.