Langsung ke konten
Skillpedia
Pemrograman umum5.7k Β· #14748

cli-inference

Fungsinya

Skill ini mengajari agent cara menjalankan model visi dan bahasa MLX-VLM dari terminal. Skill ini mencakup masukan teks, gambar, dan audio, serta membantu memperbaiki error tentang pemuatan atau pemrosesan.

Kapan dipakai

  • βœ“Saat pengguna ingin menjalankan model visi atau bahasa di Mac dari baris perintah.
  • βœ“Saat perintah MLX-VLM memberi error tentang model, prompt, atau bobot yang hilang.
  • βœ“Saat pengguna ingin perintah yang bisa diulang untuk menguji model dengan file gambar atau audio.

Link skill

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

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/Blaizzy/mlx-vlm/blob/main/skills/skills/cli-inference/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œTunjukkan perintah untuk mendeskripsikan gambar ini dengan model MLX-VLM lokal saya dan buat jawabannya singkat.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent memeriksa model, prompt, dan file media, lalu membaca keluaran bantuan perintah untuk flag terbaru. Agent membangun perintah yang sesuai dengan tugasnya.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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.
Pertanyaan umum

Apakah ini mengunduh model besar?

Skill menyatakan tidak mengunduh model besar kecuali pengguna memintanya.

Bisakah ini menangani audio dan video?

Bisa. Skill mencakup masukan gambar, audio, dan video.

Di mana saya harus memeriksa flag terlebih dulu?

Skill menyatakan keluaran bantuan perintah adalah sumber yang benar.

Detail

Deskripsi asli dari pembuat

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

Popularitas

Bintang GitHub
5.7k
Peringkat
#14748
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa