Skill
MLX VLM local vision inference
Native Apple-Silicon VLM inference via MLX-VLM: zero-server, a vision-feature cache that speeds up prompt processing for repeat questions about the same image (opt-in in the Python API; see the primitive mlx-vlm-vision-cache-opt-in), CLI + Python API + FastAPI server + LoRA fine-tuning
Corrected on 2026-11-01: '11x batch speedup' was replaced: the mlx-vlm README (v0.7.11) reports 11x+ faster prompt processing for repeat questions about the same image, with generation speed unaffected — not an 11x speedup of batches (see the primitive mlx-vlm-vision-cache-opt-in, corrected the same day).
Primitives inside (5)
deepseek-ocr-normalized-coordsreferenceDeepSeek-OCR(-2) grounding output uses coordinates normalized to 0-1000 (not pixels) in <ref>text</ref><box>[[x1,y1,x2,y2]]</box> — scale by image_dimension/1000 before drawing or cropping; the <|grounding|> prompt prefix triggers document-to-markdown mode.
When: Post-processing DeepSeek-OCR output into pixel-space boxes, crops, or markdown documents.
mlx-vlm-generate-returns-dataclassgotcha-fixmlx_vlm.generate() returns a GenerationResult dataclass, not a str — read .text for the answer (with free stats in .generation_tps/.peak_memory/.cached_tokens); str(result) yields the full dataclass repr.
When: Consuming generate() output programmatically — writing answers to files, feeding downstream prompts, parsing.
mlx-vlm-lora-flag-namesgotcha-fixmlx_vlm.lora takes --model-path and --dataset — NOT --model / --data as older docs show; wrong flags fail at argparse (verified against v0.6.4 --help).
When: Launching VLM LoRA fine-tuning with python -m mlx_vlm.lora.
mlx-vlm-memory-fit-calibrationcalibrationUnified-memory sizing for MLX-VLM on Apple Silicon starts from the weight size (mlx-community repos on Hugging Face, checked 2026-11-01): Qwen2-VL-2B-Instruct-4bit 1.25 GB, Qwen2-VL-7B-Instruct-4bit 4.67 GB, DeepSeek-OCR-2-bf16 6.78 GB, gemma-3-27b-it-4bit 16.8 GB, Qwen2-VL-72B-Instruct-4bit 41.3 GB — so the 72B-4bit class does not fit a 32 GB Mac; leave headroom beyond the weights for the image, the context and macOS.
When: Choosing a VLM/OCR model for a specific Mac before downloading weights.
Corrected on 2026-11-01: the sizes are now the measured weight sizes of the mlx-community repos on Hugging Face (checked 2026-11-01); the unsourced '~4-5 GB' for the 2B model was removed, and the 72B-4bit class no longer appears to fit a 32 GB Mac (its weights alone are 41-42 GB).
mlx-vlm-vision-cache-opt-ingotcha-fixWhen asking several questions about the same image with MLX-VLM, keep them in ONE process/session AND make the vision-feature cache actually engage: in the Python API the cache is OPT-IN — plain generate() never caches — so create ONE VisionFeatureCache for the whole batch and pass vision_cache=cache on every call (LRU, keyed by image path or PIL content hash); only CLI --chat mode and the server create it automatically (the server whenever it loads a model; --vision-cache-size only sets its maximum, default 20); with the cache engaged, repeat questions about the same image skip the vision encoder; the mlx-vlm README (v0.7.11) reports 11x+ faster prompt processing over 10 multi-turn turns on gemma-4-26b-a4b-it, with generation speed unaffected.
When: Multi-question interrogation of a single image (QA gates, structured extraction via question lists, per-image QA over generated assets) on Apple Silicon with MLX-VLM.
Corrected on 2026-11-01: the '~11x' is now stated as the mlx-vlm README reports it (v0.7.11, Performance table): 11x+ faster prompt processing over 10 multi-turn turns on gemma-4-26b-a4b-it, with generation speed unaffected — not ~11x faster queries; and the server creates the cache whenever it loads a model, --vision-cache-size only sets its size.
Get the whole skill
All 5 primitives of this skill as one package, with the order to apply them.
Buy only the primitives you need
Each primitive is 1 credit (≈ €0.10). Pick them from the list above — the button is next to each one.
Upgrade your own skill
Paste your skill; we pick the 5 primitives from the shelf that fit it best, as one bundle for 5 credits (≈ €0.50).
Upgrade my skillNeighbour skills
Skills whose primitives are closest to this one (bge-m3 similarity):