server-inference
What it does
This skill teaches an agent how to start and troubleshoot an MLX-VLM server that other tools call through an OpenAI-style API. It covers the health check, the model list, and chat requests.
When to use it
- ✓When a user wants to start a local MLX-VLM server for chat or API calls.
- ✓When a request to the server fails and the user needs to find out why.
- ✓When a user wants to connect an OpenAI-compatible app to the local server.
Skill link
https://github.com/Blaizzy/mlx-vlm/blob/main/skills/skills/server-inference/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Start my MLX-VLM server and show me how to send a chat request from my app.”
5 new skills a week. 1 minute to read.
How it works
The agent starts the server, checks its health and model list, then sends a test request. Keeping startup problems separate from request problems makes the cause easier to find.
Technical content (original SKILL.md)
Original text by the author, straight from 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").
FAQ
Which address does the server use?
The examples use a local address on port 8080, which the user can change.
Does it support streaming?
Yes. The skill says streaming and non-streaming requests should be tested separately.
What checks should come first?
The skill recommends the health and model list checks before debugging generation.
Details
Original description by the author
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
Popularity
- GitHub stars
- 5.7k
- Ranking position
- #14752
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
cli-inference
5.7kHelps your agent run or troubleshoot MLX-VLM model inference from the command line, with text, image, and audio inputs, and find the right flags for each task.
convert-quantize
5.7kHelps your agent convert a Hugging Face model into MLX format and shrink it with quantization, choosing the bit size, mode, and calibration for a local device.
hf-cache-models
5.7kHelps your agent list the models a running MLX-VLM server can see, including cached, custom, and loaded models, by querying its model discovery endpoint.
reproducible-github-issues
5.7kHelps your agent write a clear, reproducible GitHub issue for MLX-VLM, with environment details, exact commands, and a small example, for bugs or slow results.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.