मुख्य सामग्री पर जाएँ
Skillpedia
API और सर्वर (backend)5.7k · #14752

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 पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/Blaizzy/mlx-vlm/blob/main/skills/skills/server-inference/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरा MLX-VLM सर्वर शुरू कीजिए और दिखाइए कि मेरे ऐप से चैट अनुरोध कैसे भेजूँ।”

हर हफ़्ते 5 नई skills, 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
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

cli-inference

5.7k

आपके एजेंट को कमांड लाइन से MLX-VLM मॉडल इनफ़रेंस चलाने या उसकी समस्याएँ ठीक करने देती है, टेक्स्ट, इमेज और ऑडियो इनपुट के साथ, और हर काम के लिए सही फ़्लैग ढूँढते हुए।

कोडिंगसामान्य कोडिंग

convert-quantize

5.7k

आपके एजेंट को Hugging Face मॉडल को MLX फ़ॉर्मैट में बदलने और क्वांटाइज़ेशन से छोटा करने में मदद करती है, स्थानीय डिवाइस के लिए बिट आकार, मोड और कैलिब्रेशन चुनते हुए।

कोडिंगसामान्य कोडिंग

hf-cache-models

5.7k

आपके एजेंट को चल रहे MLX-VLM सर्वर पर दिखने वाले मॉडल की सूची बनाने में मदद करती है, जिनमें कैश्ड, कस्टम और लोड किए गए मॉडल शामिल हैं।

कोडिंगAPI और सर्वर (backend)

reproducible-github-issues

5.7k

आपके एजेंट को MLX-VLM के लिए साफ़ और दोबारा परखी जा सकने वाली GitHub इश्यू लिखने में मदद करती है, बग या धीमे नतीजों के लिए, वातावरण के विवरण, सटीक कमांड और छोटे उदाहरण के साथ।

कोडिंगसामान्य कोडिंग

मिलती-जुलती skills