server-inference
Fungsinya
Skill ini mengajari agent cara menyalakan dan memperbaiki server MLX-VLM yang dipanggil alat lain melalui API bergaya OpenAI. Mencakup pemeriksaan kesehatan, daftar model, dan permintaan chat.
Kapan dipakai
- ✓Saat pengguna ingin menyalakan server MLX-VLM lokal untuk chat atau panggilan API.
- ✓Saat permintaan ke server gagal dan pengguna perlu tahu penyebabnya.
- ✓Saat pengguna ingin menghubungkan aplikasi yang kompatibel dengan OpenAI ke server lokal.
Link skill
https://github.com/Blaizzy/mlx-vlm/blob/main/skills/skills/server-inference/SKILL.mdSalin 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
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Nyalakan server MLX-VLM saya dan tunjukkan cara mengirim permintaan chat dari aplikasi saya.”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent menyalakan server, memeriksa kesehatan dan daftar model, lalu mengirim permintaan uji. Memisahkan masalah saat startup dari masalah permintaan membuat penyebabnya lebih mudah ditemukan.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Server Inference
Use this workflow for the FastAPI server and API-compatible inference.
First Checks
- Identify the server command, model, port, request endpoint, request body, and expected response.
- Start with health/model-list checks before debugging generation.
- Separate server startup failures from request-handling failures.
- Keep streaming and non-streaming repros separate.
Startup
uv run mlx_vlm.server \
--model <model-or-path> \
--port 8080
Useful startup flags include --adapter-path, --trust-remote-code, --log-level, --enable-thinking, --thinking-budget, --draft-model, --draft-kind, --kv-bits, --kv-quant-scheme, --max-kv-size, and --vision-cache-size.
Minimal Checks
curl http://127.0.0.1:8080/health
curl http://127.0.0.1:8080/v1/models
curl http://127.0.0.1:8080/metrics
Minimal chat request:
curl -s http://127.0.0.1:8080/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{
"model": "<model-or-path>",
"messages": [{"role": "user", "content": "Say hello."}],
"max_tokens": 32,
"stream": false
}'
Minimal Responses API request:
curl -s http://127.0.0.1:8080/v1/responses \
-H 'Content-Type: application/json' \
-d '{
"model": "<model-or-path>",
"input": "Say hello.",
"max_output_tokens": 32
}'
Endpoint Surface (beyond chat/responses)
The server exposes more than chat — cover or route to these as needed:
- Anthropic Messages API:
/v1/messages, plus/v1/messages/countfor token counting. - Audio:
/v1/audio/speech(TTS),/v1/audio/transcriptionsand/v1/audio/translations(STT). - Images:
/v1/images/generationsand/v1/images/edits(diffusion image models). - Cache & metrics:
/v1/cache/stats,/v1/cache/reset,/v1/metrics. - Models:
/v1/modelslists loaded models and model candidates in the shared Hugging Face cache, with aloadedboolean indicating which are in memory — seeSkill("mlx-vlm-skills:hf-cache-models").
Match the model kind to the endpoint (an image endpoint needs a diffusion/image model, audio endpoints need an audio model); a mismatch returns a clear 4xx, not a crash.
Debugging Rules
- Capture the server command, server logs, request body, response status, and response body.
- Test
/v1/modelsafter preload/load changes. - For OpenAI client issues, reproduce with
curlbefore blaming the client SDK. - For streaming bugs, save raw event chunks and compare with non-streaming.
- For structured outputs, isolate the JSON schema and confirm whether the same request works without schema constraints.
- For tool calls, inspect native support and the parser inferred from the loaded processor's actual chat template. Follow Tool Calling for parser registration and validation.
Validation
- For route/schema changes, run
uv run pytest mlx_vlm/tests/test_server.py -q. - For structured output changes, include
uv run pytest mlx_vlm/tests/test_generate.py -q -k 'thinking_aware or json_schema'. - For tool parser changes, add compact regressions to
TestProcessToolCallsinmlx_vlm/tests/test_server.pyand run the shared tool streaming tests in that module, plus any existing tests for affected parsers. Reuse consolidated tests instead of creating a new test file. - If the result is a user-facing bug report, switch to
Skill("mlx-vlm-skills:reproducible-github-issues").
Pertanyaan umum
Alamat mana yang dipakai server?
Contohnya memakai alamat lokal di port 8080, yang bisa diubah pengguna.
Apakah mendukung streaming?
Ya. Skill ini menyebutkan permintaan streaming dan non-streaming sebaiknya diuji secara terpisah.
Pemeriksaan apa yang harus dilakukan lebih dulu?
Skill ini menyarankan pemeriksaan kesehatan dan daftar model sebelum memeriksa proses pembuatan teks.
Detail
Deskripsi asli dari pembuat
Use this skill when the user wants to run or debug MLX-VLM server inference, including uv run mlx_vlm.server, /v1/models, /v1/chat/completions, /v1/responses, streaming, OpenAI-compatible clients, health checks, metrics, model unload/reload, adapters, trust-remote-code, and server request/response failures.
repo: Blaizzy/mlx-vlm
Popularitas
- Bintang GitHub
- 5.7k
- Peringkat
- #14752
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- …
Skill lain dari repositori ini
cli-inference
5.7kMembantu agent Anda menjalankan atau memperbaiki inferensi model MLX-VLM dari baris perintah, dengan masukan teks, gambar, dan audio, serta menemukan flag yang tepat untuk setiap tugas.
convert-quantize
5.7kMembantu agent Anda mengonversi model Hugging Face ke format MLX dan memperkecilnya dengan kuantisasi, dengan memilih ukuran bit, mode, dan kalibrasi untuk perangkat lokal.
hf-cache-models
5.7kMembantu agent Anda melihat daftar model yang bisa dibaca server MLX-VLM yang sedang berjalan, termasuk model cache, kustom, dan yang sudah dimuat.
reproducible-github-issues
5.7kMembantu agent Anda menulis laporan GitHub issue untuk MLX-VLM yang jelas dan bisa diulang, dengan detail lingkungan, perintah, dan contoh kecil.
Skill serupa
api-connector-builder
280kMembuat agent Anda membangun koneksi API baru mengikuti pola yang sudah ada. Gunakan saat ingin menambah integrasi lagi tanpa membuat cara baru.
api-design
280kMembantu agent Anda merancang REST API sesuai praktik terbaik. Berguna untuk mengatur cara API berkomunikasi, menampilkan error, dan mengorganisasi data.
backend-patterns
280kMembantu agent Anda dengan pola arsitektur sisi server dan optimasi database. Berguna untuk membangun atau meninjau kode yang berjalan di server.