Chuyển đến nội dung
Skillpedia
Lập trình chung5.7k · #14748

cli-inference

Skill này làm gì

Skill này dạy agent cách chạy các mô hình thị giác và ngôn ngữ MLX-VLM từ terminal. Nó bao quát đầu vào văn bản, hình ảnh và âm thanh, và giúp sửa các lỗi về tải hoặc xử lý.

Khi nào nên dùng

  • ✓Khi người dùng muốn chạy mô hình thị giác hoặc ngôn ngữ trên Mac từ dòng lệnh.
  • ✓Khi một lệnh MLX-VLM báo lỗi về mô hình, lời nhắc hoặc trọng số bị thiếu.
  • ✓Khi người dùng muốn một lệnh lặp lại được để thử mô hình với tệp hình ảnh hoặc âm thanh.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/Blaizzy/mlx-vlm/blob/main/skills/skills/cli-inference/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy cho tôi lệnh để mô tả hình ảnh này bằng mô hình MLX-VLM trên máy và giữ câu trả lời ngắn.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent kiểm tra mô hình, lời nhắc và các tệp đa phương tiện, rồi đọc đầu ra trợ giúp để lấy các cờ hiện hành. Sau đó nó tạo lệnh khớp với tác vụ.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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.
Câu hỏi thường gặp

Điều này có tải các mô hình lớn không?

Skill nói không tải mô hình lớn trừ khi người dùng yêu cầu.

Nó có xử lý âm thanh và video không?

Có. Skill bao quát đầu vào hình ảnh, âm thanh và video.

Nên kiểm tra cờ ở đâu trước?

Skill nói đầu ra trợ giúp của lệnh là nguồn chuẩn.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
5.7k
Vị trí xếp hạng
#14748
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự