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.mdSao 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
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
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
- 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.
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
Bình luận
- …
Thêm skill từ kho mã này
convert-quantize
5.7kGiúp agent chuyển mô hình từ Hugging Face sang định dạng MLX và thu nhỏ bằng lượng tử hóa, chọn số bit, chế độ và hiệu chỉnh cho thiết bị cục bộ.
hf-cache-models
5.7kGiúp agent của bạn liệt kê model mà server MLX-VLM đang chạy thấy được, gồm model đã cache, tùy chỉnh và đã tải, qua endpoint khám phá model.
reproducible-github-issues
5.7kGiúp agent của bạn viết issue GitHub rõ ràng, tái hiện được cho MLX-VLM, kèm thông tin môi trường, lệnh chính xác và ví dụ nhỏ, khi gặp lỗi hoặc chạy chậm.
server-inference
5.7kGiúp agent của bạn chạy và gỡ lỗi server API MLX-VLM, gồm kiểm tra tình trạng, yêu cầu chat và responses, streaming và các lỗi thường gặp.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.