{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "xhtoken-spark-x2-6--serve-spark-x26-api-with-sglang-on-nvidia",
 "repo": "XHToken/Spark-X2.6",
 "repo_url": "https://github.com/XHToken/Spark-X2.6",
 "repo_slug": "xhtoken-spark-x2-6",
 "title": "Serve Spark-X2.6-4B as an API with SGLang on NVIDIA GPUs",
 "page_title": "How to serve Spark-X2.6-4B as an API with SGLang on NVIDIA GPUs with Spark X2 6",
 "summary": "Run an OpenAI-compatible endpoint with tool-call and reasoning parsers enabled.",
 "who": "A backend engineer on a GPU server who needs a local model endpoint that agent code can call over HTTP.",
 "problem": "Agent workflows need a stable chat endpoint with tool calling, and calling a hosted model may not fit the data or cost needs of the project.",
 "outcome": "A running SGLang server on port 30000 that answers chat completion requests under the model name spark2.6.",
 "steps": [
  "Run `export MODEL_PATH=/absolute/path/to/Spark-X2.6-4B` with the absolute path to your local checkpoint.",
  "Run `docker pull lmsysorg/sglang:nightly-dev-cu13-20260827-20621aa1` to get the image the README names.",
  "Start the NVIDIA GPU `docker run` block from the README SGLang Server section, which mounts $MODEL_PATH and serves on port 30000.",
  "Send a chat request to http://localhost:30000/v1/chat/completions using the model name spark2.6, following the README Client example.",
  "To skip reasoning for one request, add \"chat_template_kwargs\": {\"enable_thinking\": false} to the request body."
 ],
 "agent_prompt": "Using the Spark-X2.6 README SGLang NVIDIA GPU server block, start an OpenAI-compatible server for the checkpoint at <MODEL_PATH> on port 30000 with served model name spark2.6. Send the chat request <your prompt> to http://localhost:30000/v1/chat/completions and report the reply text. Verify that the response JSON has a choices array with non-empty content.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "2 hours",
 "basis": "readme",
 "caveat": "The README's 1,048,576-token context setting needs sufficient device memory, so lower --context-length on smaller GPUs.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "",
 "requirements": [
  "A machine with an NVIDIA GPU or Ascend NPU for the server use cases, or enough local memory for the Transformers example",
  "Docker installed for the SGLang and vLLM use cases",
  "Python with pip for the Transformers use case, using transformers==4.57.1",
  "Local copy of the model checkpoint or network access to Hugging Face, ModelScope, or Ollama to download it"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/xhtoken-spark-x2-6/serve-spark-x26-api-with-sglang-on-nvidia/",
 "md": "https://dedupedai.com/use-cases/xhtoken-spark-x2-6/serve-spark-x26-api-with-sglang-on-nvidia/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/xhtoken-spark-x2-6--serve-spark-x26-api-with-sglang-on-nvidia.json",
 "api_version": "v1"
}
