Model setup recipes

LFM2.5-VL-3B DSpark: more than 2× faster visual responses on Mac

LFM2.5-VL-3B reads images and answers; DSpark speeds up answer generation

LFM2.5-VL-3B is a 3B-class vision-language model that takes a photo and a question and answers about receipt text or a scene. DSpark has a small draft model propose the next token1 and the main model verify it, shortening generation. Image reading and first-input processing stay the same, so this guide covers both the official per-device figures and how to compare your own run.

DSpark works during the answer-writing stage. Separating image reading or scene understanding from answer generation makes it easier to see which tasks benefit most.

This guide first identifies the hardware and runtimes behind the published results, then covers setup paths for Mac and NVIDIA servers and a way to compare timing on your own tasks.

Requirements and key details
  • On M5 Max with MLX-VLM, decode was 2.30–3.13× faster and total completion 1.56–2.62× faster.
  • On M3 Ultra with llama.cpp, decode improved by 1.57–2.14× and total time by 1.30–1.77×.
  • The roughly 280-million-parameter DSpark draft model also uses extra memory. For short answers, check total time on your actual tasks.

Separate image processing from answer generation

An image question involves image encoding, prefill2 that reads the input context, and decode3 that generates answer tokens. LFM2.5-VL-3B supports a 32K context. DSpark reduces repeated decode computation by having a small draft model propose tokens and the target model verify them. Image encoding and input reading are still required.

Extracting short values such as a date and amount from a receipt produces a short answer, so image processing makes up a larger share of the work. Longer answers, such as a photo description or translation, can reflect decode savings more strongly in total response time. A token-generation speedup shown on a speed page and completion time for an actual task are different measures.

A photo and receipt are fed to a local vision model at a workbench.
LFM2.5-VL-3B reads receipt text or describes a photo.
A larger target model verifies token candidates proposed by a small draft model.
The main model verifies draft candidates to reduce repeated decoding.

Read official speedups together with hardware and runtime

Across six vision tasks published by Liquid AI, decode on M5 Max with MLX-VLM improved by 2.30–3.13× and total completion time by 1.56–2.62×. On M3 Ultra with llama.cpp, decode improved by 1.57–2.14× and total time by 1.30–1.77×. Results vary with hardware, runtime4, and output length even for the same model name.

The model card lists 228 tok/s for the base LFM2.5-VL-3B on Apple M5 Max and 116 tok/s on AMD Ryzen AI Max+ 395. These are baseline figures for the documented paths, not guaranteed speeds for every quantization5 or image. Do not transfer the M5 Max or M3 Ultra DSpark multipliers to other hardware.

Read the published comparison separately by hardware and runtime.
Hardware and runtimeDecode improvementTotal completion improvement
M5 Max · MLX-VLM2.30–3.13×1.56–2.62×
M3 Ultra · llama.cpp1.57–2.14×1.30–1.77×
A test bench compares the same image question on Apple, AMD, and NVIDIA hardware.
Speedups vary by hardware, runtime, and task, so compare matching conditions.

Choose a Mac runtime for your workflow

For a simple start on M5 Max, specify the main model and DSpark draft model together in the MLX-VLM server. When connecting an app, check the OpenAI-compatible endpoint and save a baseline run with one fixed image and the same output length. After enabling acceleration, confirm the answer is preserved and draft acceptance is recorded.

For llama.cpp on M3 Ultra, prepare the target model's F16 GGUF6, vision projector, and DSpark draft file together. The official example starts with context 8192 and maximum draft length 8. Save the launch command and checkpoint7 hashes so you can repeat the comparison with the same files and settings.

Start an MLX-VLM server with DSpark
mlx_vlm.server --model LiquidAI/LFM2.5-VL-3B --draft-model LiquidAI/LFM2.5-VL-3B-DSpark --host 127.0.0.1 --port 8080
Specify the target model and official DSpark draft model together.

Run the SGLang example on an NVIDIA server

The SGLang example specifies the DSpark algorithm, draft model, FlashInfer draft attention8, and block size 9. Start with one request and a short context to verify server startup and image input, then compare the same request without acceleration. Record draft proposals and acceptances together with total completion time.

The draft does not replace the final answer. The main model verifies the candidates, which can preserve the target model's output under greedy-generation settings. Runtime versions or sampling settings change the conditions, so use the same request and generation options in a comparison.

Configure the DSpark draft path in SGLang
python -m sglang.launch_server \
  --model-path LiquidAI/LFM2.5-VL-3B \
  --speculative-algorithm DSPARK \
  --speculative-draft-model-path LiquidAI/LFM2.5-VL-3B-DSpark \
  --speculative-draft-attention-backend flashinfer \
  --speculative-dspark-block-size 9 \
  --disable-radix-cache --mem-fraction-static 0.8 --host 127.0.0.1 --port 30000
Use the options in the official example and check the requirements for your installed SGLang version and model card before running.

Compare total time on your image tasks

Measure the baseline and DSpark runs three times each with the same image and question. Record image submission to first token, first to final token, and total completion time separately. If image preprocessing takes a long time, reducing image size may have a larger effect on total wait.

If draft acceptance is low or answers are short, the cost of loading the extra draft model may exceed its benefit. Choose three real OCR9, captioning, or translation tasks and compare medians. The reduction in total wait on your own work is a better basis for keeping acceleration than a published multiplier.

Terminology notes

  1. Token — A unit into which a model divides input or output for processing.

    Back to the text
  2. Prefill — The stage where an LLM reads the input prompt and computes representations for its tokens. Longer prompts contain more tokens to process.

    Back to the text
  3. Token decoding — The stage that generates successive output tokens using the input and the response produced so far.

    Back to the text
  4. Runtime — The software environment that provides facilities needed while a program runs. In local AI, it can also refer to a model execution engine.

    Back to the text
  5. Quantization — A way to represent model weights or values with fewer bits, reducing storage and memory use. The coarser representation can also affect accuracy.

    Back to the text
  6. GGUF — A file format for model data, widely used by llama.cpp-based tools.

    Back to the text
  7. Checkpoint — A file containing saved model weights and related state. Versions or tasks in one model family may use different checkpoints.

    Back to the text
  8. Attention — A neural-network operation that calculates relationships between input tokens and combines information from each position into the current representation.

    Back to the text
  9. OCR — The process of recognizing characters in images or scanned documents and turning them into text. Table layout and reading order still need the original image to verify.

    Back to the text

Frequently asked questions

What should you check first in this article?
LFM2.5-VL-3B is a 3B-class vision-language model that takes a photo and a question and answers about receipt text or a scene. DSpark has a small draft model propose the next token and the main model verify it, shortening generation. Image reading and first-input processing stay the same, so this guide covers both the official per-device figures and how to compare your own run.