---
title: "Training and Serving Multimodal LLMs in Production"
description: "Canva built a custom vision-language model to review hundreds of thousands of images daily against more than 30 content and quality criteria, replacing expensive third-party LLMs. The team fine-tuned a 4B model using QLoRA with rank-24 LoRA applied to all linear layers, focusing the loss exclusively on boolean response tokens. To serve structured JSON outputs with confidence scores, they enforced the JSON format and extracted a probability for each review check. They accelerated inference with speculative decoding, which verifies multiple tokens in a single forward pass by exploiting the predictable output structure. The custom model cut costs by 85%, halved the false negative rate without increasing false positives, and reduced p50 production latency by 15x."
---

# Training and Serving Multimodal LLMs in Production

[Canva](https://yomu.fyi/company/canva) · Sachinthaka Abeywardana · Nov 30, 2026

**Type:** Tutorial

## Summary

Canva built a custom vision-language model to review hundreds of thousands of images daily against more than 30 content and quality criteria, replacing expensive third-party LLMs. The team fine-tuned a 4B model using QLoRA with rank-24 LoRA applied to all linear layers, focusing the loss exclusively on boolean response tokens. To serve structured JSON outputs with confidence scores, they enforced the JSON format and extracted a probability for each review check. They accelerated inference with speculative decoding, which verifies multiple tokens in a single forward pass by exploiting the predictable output structure. The custom model cut costs by 85%, halved the false negative rate without increasing false positives, and reduced p50 production latency by 15x.

## Context

Canva needed to review hundreds of thousands of images daily against 30+ content and quality criteria. Using third-party LLMs became too expensive at scale, so they built a custom vision-language model to perform these checks more accurately and at lower cost.

## Approach / What changed

Fine-tuned a 4B vision-language model (Qwen3.5) using QLoRA with rank-24 LoRA applied to all linear layers, loss masking focused on boolean response tokens, and speculative decoding that verifies multiple tokens in a single forward pass by exploiting the predictable JSON output structure.

## Takeaways

- Fine-tuning a small vision-language model with QLoRA reduced LLM costs by approximately 85% compared to using third-party hosted models for high-volume content review.
- Focusing the loss exclusively on boolean response tokens (true/false) during a second training stage improved accuracy on the classification task without requiring the model to learn JSON formatting.
- Speculative decoding that verifies multiple tokens in a single forward pass, combined with prefix caching and exact max\_tokens, reduced p50 production latency by 15x.

## FAQ

### How did QLoRA help fit the model into GPU memory?

QLoRA stores the frozen base weights in 4-bit form, freeing enough GPU memory to increase batch size from 4 to 24. This allows fine-tuning a 4B model within a limited GPU memory budget.

### How is the loss masked during training?

Loss is calculated only on the assistant's response tokens, not on the prompt or image tokens. In a second stage, loss is further focused exclusively on the boolean (true/false) positions, so formatting tokens no longer contribute to the loss.

### How does speculative decoding accelerate inference?

Speculative decoding uses the predictable JSON output structure to verify many tokens in a single forward pass. The decoder masks only two tokens at each boolean slot, and temperature is set to 0.0 since there is no reason to sample for boolean classification.

**Tags:** [Fine-Tuning](https://yomu.fyi/topic/fine-tuning), [LoRA](https://yomu.fyi/topic/lora), [QLoRA](https://yomu.fyi/topic/qlora), [Speculative Decoding](https://yomu.fyi/topic/speculative-decoding), [Vision-Language Models](https://yomu.fyi/topic/vision-language-models)

- Source: [Canva](https://www.canva.dev/blog/engineering/local-jev-multimodal-llms-in-production)
- Source URL: https://www.canva.dev/blog/engineering/local-jev-multimodal-llms-in-production
- Ingested by Yomu: 2026-11-30T06:00:14.523Z

[Read original post](https://www.canva.dev/blog/engineering/local-jev-multimodal-llms-in-production)
