본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)5.7k · #14752

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/Blaizzy/mlx-vlm/blob/main/skills/skills/server-inference/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 MLX-VLM 서버를 시작하고, 제 앱에서 채팅 요청을 보내는 방법을 보여 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 서버를 시작하고 상태와 모델 목록을 확인한 뒤 테스트 요청을 보냅니다. 시작 문제와 요청 문제를 나눠서 보면 원인을 찾기 쉽습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Server Inference

Use this workflow for the FastAPI server and API-compatible inference.

First Checks

  1. Identify the server command, model, port, request endpoint, request body, and expected response.
  2. Start with health/model-list checks before debugging generation.
  3. Separate server startup failures from request-handling failures.
  4. 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/count for token counting.
  • Audio: /v1/audio/speech (TTS), /v1/audio/transcriptions and /v1/audio/translations (STT).
  • Images: /v1/images/generations and /v1/images/edits (diffusion image models).
  • Cache & metrics: /v1/cache/stats, /v1/cache/reset, /v1/metrics.
  • Models: /v1/models lists loaded models and model candidates in the shared Hugging Face cache, with a loaded boolean indicating which are in memory — see Skill("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/models after preload/load changes.
  • For OpenAI client issues, reproduce with curl before 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 TestProcessToolCalls in mlx_vlm/tests/test_server.py and 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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬