Aller au contenu
Skillpedia
Programmation générale5.7k · #14748

cli-inference

Ce qu’il fait

Cette compétence apprend à un agent à exécuter des modèles de vision et de langage MLX-VLM depuis un terminal. Elle couvre les entrées de texte, d'image et d'audio, et aide à corriger les erreurs de chargement ou de traitement.

Quand l’utiliser

  • ✓Quand un utilisateur veut exécuter un modèle de vision ou de langage sur un Mac depuis la ligne de commande.
  • ✓Quand une commande MLX-VLM renvoie une erreur sur un modèle, une invite ou des poids manquants.
  • ✓Quand un utilisateur veut une commande reproductible pour tester un modèle avec un fichier image ou audio.

Lien du skill

https://github.com/Blaizzy/mlx-vlm/blob/main/skills/skills/cli-inference/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/Blaizzy/mlx-vlm/blob/main/skills/skills/cli-inference/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Montre-moi la commande pour décrire cette image avec mon modèle MLX-VLM local, et garde la réponse courte.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

L'agent vérifie le modèle, l'invite et les fichiers médias, puis lit la sortie d'aide pour connaître les drapeaux actuels. Il construit une commande adaptée à la tâche.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

CLI Inference

Use this workflow for uv run mlx_vlm.generate and related command-line inference tasks.

First Checks

  1. Identify the model ID or local path, modality, prompt, media files, and expected output.
  2. Prefer an existing local model path or cached Hugging Face model when reproducing. Do not download a large model unless the user asks.
  3. Check model-specific docs first when the family has a README under mlx_vlm/models/<family>/README.md.
  4. Use uv run mlx_vlm.generate --help to 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-tokens and 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_type unsupported: inspect config.json and current folders under mlx_vlm/models/.
  • Missing weights: check for .safetensors or model.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.
Questions fréquentes

Cela télécharge-t-il de gros modèles ?

La compétence indique de ne pas télécharger un gros modèle sauf si l'utilisateur le demande.

Gère-t-elle l'audio et la vidéo ?

Oui. La compétence couvre les entrées d'image, d'audio et de vidéo.

Où vérifier d'abord les drapeaux ?

La compétence indique que la sortie d'aide de la commande fait foi.

Détails

Description originale de l’auteur

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

Popularité

Étoiles GitHub
5.7k
Position au classement
#14748
Licence
MIT
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires