server-inference
하는 일
이 스킬은 OpenAI 스타일 API로 다른 도구가 호출하는 MLX-VLM 서버를 시작하고 문제를 해결하는 방법을 에이전트에게 가르칩니다. 상태 확인, 모델 목록, 채팅 요청을 다룹니다.
사용하는 경우
- ✓채팅이나 API 호출을 위해 로컬 MLX-VLM 서버를 시작하고 싶을 때.
- ✓서버 요청이 실패해서 사용자가 이유를 찾아야 할 때.
- ✓OpenAI 호환 앱을 로컬 서버에 연결하고 싶을 때.
스킬 링크
https://github.com/Blaizzy/mlx-vlm/blob/main/skills/skills/server-inference/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 MLX-VLM 서버를 시작하고, 제 앱에서 채팅 요청을 보내는 방법을 보여 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 서버를 시작하고 상태와 모델 목록을 확인한 뒤 테스트 요청을 보냅니다. 시작 문제와 요청 문제를 나눠서 보면 원인을 찾기 쉽습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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").
자주 묻는 질문
서버는 어떤 주소를 사용하나요?
예시는 포트 8080의 로컬 주소를 사용하며, 사용자가 바꿀 수 있습니다.
스트리밍을 지원하나요?
네. 스트리밍 요청과 비스트리밍 요청을 따로 테스트해야 한다고 스킬이 설명합니다.
어떤 점검을 먼저 해야 하나요?
생성 문제를 디버그하기 전에 상태와 모델 목록 점검을 먼저 하도록 권장합니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 5.7k
- 순위
- #14752
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
cli-inference
5.7k명령줄에서 텍스트, 이미지, 오디오 입력으로 MLX-VLM 모델 추론을 실행하거나 문제를 해결하고, 각 작업에 맞는 옵션을 찾도록 에이전트를 돕습니다.
convert-quantize
5.7kHugging Face 모델을 MLX 형식으로 변환하고 양자화로 줄이며, 로컬 기기에 맞는 비트 크기, 모드, 보정을 고르도록 에이전트를 돕습니다.
hf-cache-models
5.7k에이전트가 실행 중인 MLX-VLM 서버가 볼 수 있는 모델을 캐시, 사용자 정의, 로드 여부까지 포함해 확인하도록 돕습니다.
reproducible-github-issues
5.7k에이전트가 MLX-VLM의 버그나 느린 결과에 대해 환경 세부 정보, 정확한 명령, 작은 예제를 담은 재현 가능한 GitHub 이슈를 작성하도록 돕습니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.