cli-inference
What it does
This skill teaches an agent how to run MLX-VLM vision and language models from a terminal. It covers text, image, and audio inputs, and helps fix errors about loading or processing.
When to use it
- ✓When a user wants to run a vision or language model on a Mac from the command line.
- ✓When a command for MLX-VLM gives an error about a model, a prompt, or missing weights.
- ✓When a user wants a repeatable command to test a model with an image or audio file.
Skill link
https://github.com/Blaizzy/mlx-vlm/blob/main/skills/skills/cli-inference/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Show me the command to describe this image with my local MLX-VLM model and keep the answer short.”
5 new skills a week. 1 minute to read.
How it works
The agent checks the model, the prompt, and the media files, then reads the help output for current flags. It builds a command that matches the task.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
CLI Inference
Use this workflow for uv run mlx_vlm.generate and related command-line inference tasks.
First Checks
- Identify the model ID or local path, modality, prompt, media files, and expected output.
- Prefer an existing local model path or cached Hugging Face model when reproducing. Do not download a large model unless the user asks.
- Check model-specific docs first when the family has a README under
mlx_vlm/models/<family>/README.md. - Use
uv run mlx_vlm.generate --helpto verify current flags before giving a final command.
Command Patterns
Text:
uv run mlx_vlm.generate \
--model <model-or-path> \
--prompt "Write a short answer." \
--max-tokens 128
Image:
uv run mlx_vlm.generate \
--model <model-or-path> \
--image /path/to/image.jpg \
--prompt "Describe this image." \
--max-tokens 128
Audio or multimodal:
uv run mlx_vlm.generate \
--model <model-or-path> \
--image /path/to/image.jpg \
--audio /path/to/audio.wav \
--prompt "Describe what you see and hear." \
--max-tokens 128
More Flags & Modalities
uv run mlx_vlm.generate --help is the source of truth (the CLI lives in the mlx_vlm/generate/ package). Beyond --model/--prompt/--image/--audio/--max-tokens, common flags:
--chat— interactive multi-turn session.--adapter-path— apply a LoRA adapter.--eos-tokensand sampling flags — use greedy/low-temp when debugging quality.--trust-remote-code— needed for some custom processors.--kv-bits/--kv-quant-scheme/--max-kv-size— quantized/bounded KV cache.--draft-model/--draft-kind— speculative decoding.- Image generation/editing:
--output-modality image,--output <file>, and the--diffusion-*flags drive diffusion image models — not just text-out VLMs.
Reproducibility Rules
- Include the exact command, model ID/path, media file type and size, Python version, package version or git commit, and full error.
- Use low-temperature or greedy settings when debugging quality or regressions.
- Bound output with
--max-tokens. - Preserve shell quoting exactly, especially prompts with JSON, XML-like thinking tokens, or newlines.
- If the failure depends on an image/audio/video file, record dimensions, duration, codec, and whether a small synthetic input reproduces it.
Common Failure Routing
model_typeunsupported: inspectconfig.jsonand current folders undermlx_vlm/models/.- Missing weights: check for
.safetensorsormodel.safetensors.index.json. - Processor/chat template errors: inspect
processing_*.py,prompt_utils.py, and model-specific README examples. - Media shape errors: test one image/audio/video item first, then multi-input cases.
- If the user needs an issue report rather than a fix, switch to
Skill("mlx-vlm-skills:reproducible-github-issues").
Validation
- Run the smallest command that exercises the requested modality.
- For code changes touching CLI parsing, run
uv run pytest mlx_vlm/tests/test_cli.py -q. - For generation behavior, prefer focused tests such as
test_generate.py,test_processors.py, or a model-specific test file before broad suites.
FAQ
Does this download large models?
The skill says not to download a large model unless the user asks for it.
Can it handle audio and video?
Yes. The skill covers image, audio, and video inputs.
Where should I check the flags first?
The skill says the help output of the command is the source of truth.
Details
Original description by the author
Use this skill when the user wants to run or debug MLX-VLM inference from the command line, including uv run mlx_vlm.generate, image/audio/video inputs, local model paths, Hugging Face model IDs, deterministic repro commands, and CLI errors around processors, prompts, model loading, or missing weights.
repo: Blaizzy/mlx-vlm
Popularity
- GitHub stars
- 5.7k
- Ranking position
- #14748
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
convert-quantize
5.7kHelps your agent convert a Hugging Face model into MLX format and shrink it with quantization, choosing the bit size, mode, and calibration for a local device.
hf-cache-models
5.7kHelps your agent list the models a running MLX-VLM server can see, including cached, custom, and loaded models, by querying its model discovery endpoint.
reproducible-github-issues
5.7kHelps your agent write a clear, reproducible GitHub issue for MLX-VLM, with environment details, exact commands, and a small example, for bugs or slow results.
server-inference
5.7kHelps your agent run and debug the MLX-VLM API server, covering health checks, chat and responses requests, streaming, and common request errors.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.