Instructions to use XHToken/Spark-X2.6-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use XHToken/Spark-X2.6-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="XHToken/Spark-X2.6-4B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("XHToken/Spark-X2.6-4B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use XHToken/Spark-X2.6-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "XHToken/Spark-X2.6-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XHToken/Spark-X2.6-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/XHToken/Spark-X2.6-4B
- SGLang
How to use XHToken/Spark-X2.6-4B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "XHToken/Spark-X2.6-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XHToken/Spark-X2.6-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "XHToken/Spark-X2.6-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XHToken/Spark-X2.6-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use XHToken/Spark-X2.6-4B with Docker Model Runner:
docker model run hf.co/XHToken/Spark-X2.6-4B
Spark-X2.6 4B: community local API serving smoke report
Alongside your Spark-MLX-LLM instructions, sharing a community HTTP-serving integration for Spark-X2.6 4B. The measured conversion is abenzerps/Spark-X2.6-4B-MLX-4bit@253181296bd0c643880b0f64daa0049a42148d4a, served using Rapid-MLX's spark-x2.6-4b-4bit alias.
The 2026-10-25 run used an M4 Pro 48 GiB, macOS 26.5.1, Python 3.12.15, MLX 0.32.4, mlx-lm 0.31.3 and mlx-vlm 0.7.2. The report also records a 2026-10-26 repeat on an M3 Ultra 256 GiB.
English/Chinese chat, structured weather tools and thinking on/off passed the recorded probes. Important client detail: this backend coalesced the short SSE answer into one content delta plus usage/end events. Accepting stream=true therefore should not be described as demonstrated token-by-token delivery. The path used the installed spark2_5 implementation, without opting into repository Python execution.
The short tests do not validate the million-token context configuration shown in your deployment guide or reproduce your reasoning-effort benchmarks. The report includes the exact pins and launch command for a narrowly scoped community example.
Evidence and reproduction details: checked-in qualification report. These are historical results, not a new inference run or an upstream endorsement.
Disclosure: I maintain Rapid-MLX; this contribution was prepared with AI assistance under my direction. Anonymous usage-metadata telemetry is enabled by default; DO_NOT_TRACK=1 disables it. Model and conversion licenses still apply.