server-inference
यह क्या करती है
यह स्किल एजेंट को सिखाती है कि MLX-VLM सर्वर शुरू कैसे करें और उसकी समस्याएँ कैसे ठीक करें, जिसे दूसरे टूल OpenAI जैसे API से कॉल करते हैं। इसमें हेल्थ जाँच, मॉडल सूची और चैट अनुरोध शामिल हैं।
कब इस्तेमाल करें
- ✓जब उपयोगकर्ता चैट या API कॉल के लिए स्थानीय MLX-VLM सर्वर शुरू करना चाहता है।
- ✓जब सर्वर पर अनुरोध फ़ेल हो और उपयोगकर्ता को कारण जानना हो।
- ✓जब उपयोगकर्ता OpenAI-संगत ऐप को स्थानीय सर्वर से जोड़ना चाहता है।
Skill का लिंक
https://github.com/Blaizzy/mlx-vlm/blob/main/skills/skills/server-inference/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरा MLX-VLM सर्वर शुरू कीजिए और दिखाइए कि मेरे ऐप से चैट अनुरोध कैसे भेजूँ।”
हर हफ़्ते 5 नई skills, 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
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
cli-inference
5.7kआपके एजेंट को कमांड लाइन से MLX-VLM मॉडल इनफ़रेंस चलाने या उसकी समस्याएँ ठीक करने देती है, टेक्स्ट, इमेज और ऑडियो इनपुट के साथ, और हर काम के लिए सही फ़्लैग ढूँढते हुए।
convert-quantize
5.7kआपके एजेंट को Hugging Face मॉडल को MLX फ़ॉर्मैट में बदलने और क्वांटाइज़ेशन से छोटा करने में मदद करती है, स्थानीय डिवाइस के लिए बिट आकार, मोड और कैलिब्रेशन चुनते हुए।
hf-cache-models
5.7kआपके एजेंट को चल रहे MLX-VLM सर्वर पर दिखने वाले मॉडल की सूची बनाने में मदद करती है, जिनमें कैश्ड, कस्टम और लोड किए गए मॉडल शामिल हैं।
reproducible-github-issues
5.7kआपके एजेंट को MLX-VLM के लिए साफ़ और दोबारा परखी जा सकने वाली GitHub इश्यू लिखने में मदद करती है, बग या धीमे नतीजों के लिए, वातावरण के विवरण, सटीक कमांड और छोटे उदाहरण के साथ।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।