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-9B (Qwen 3.5 9B Version)
Thank you for the great work you’re doing! It would be fantastic to see a 9B version of this model that incorporates all the latest improvements and optimizations, making it suitable for local coding on budget-friendly consumer laptops. That would make these advancements much more accessible to developers who want a capable local coding assistant without needing expensive hardware.
It would be absolute peak to see a 8-12B spark. Qwen seems to have dropped support for small models, with no plans to release anything below the 27B model for qwen4 as of now. Most other lab's releases for this size range have been subpar, so we've essentially been stuck choosing between qwen 9b and gemma 4 12b for the past 6+ months. I realize that model training is quite expensive and time consuming, but maaaaybe they can hear our prayers lol.
I thank them for this 4B gem either way.
Frankly, this 4b model is amazing already. Sure I would like an 8-12B which is perfect for many reasons, but so far in using this 4b it has been great for sub-agent tasks and tool calling. Only thing missing is vision native.
all right, let's rock.
all right, let's rock.
(im sure they will make a 8-12gb savior model,good luck!)
Hi SparkLLM team, thanks for releasing Spark-X2.6-4B and for the detailed answer on τ³-Banking in discussion #4. It made that number reproducible.
I'm trying to reproduce the SWE-bench results (Pro 54.3, Verified 62.8, Multilingual 64.7) locally with the official bf16 weights on vLLM + Spark-plugin, thinking=high, temperature=1.0, top_p=0.95, top_k=-1. Could you share the setup you used?
- Agent scaffold and version (OpenHands, mini-swe-agent, SWE-agent, Claude Code, an in-house harness…)
- Context window used during evaluation (128K, 256K, 1M?) and max output tokens per turn
- Max steps / turns and any wall-clock timeout per task
- Task set: the full public SWE-bench Pro set (731 tasks), Verified (500), Multilingual (300), or a subset?
- Number of runs per task (pass@1 single run, or avg@k?)
- Anti-hacking measures (network disabled, git history removed…)
- For the starred Qwen3.5 numbers (SWE Verified 53.1 / 38.8, SWE Pro 33.8 / 29.4): which card or paper are they taken from? I couldn't find them on the Qwen3.5-9B / 4B model cards.
Thanks a lot!