Text Generation
Transformers
Safetensors
English
Chinese
spark2_5
llm
sparkx2_5
conversational
custom_code
8-bit precision
compressed-tensors
Run this model with HF Jobs
Run XHToken/Spark-X2.6-4B-INT8 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/XHToken/Spark-X2.6-4B-INT8. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/XHToken/Spark-X2.6-4B-INT8 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/XHToken/Spark-X2.6-4B-INT8. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use XHToken/Spark-X2.6-4B-INT8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use XHToken/Spark-X2.6-4B-INT8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="XHToken/Spark-X2.6-4B-INT8", 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-INT8", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use XHToken/Spark-X2.6-4B-INT8 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-INT8" # 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-INT8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/XHToken/Spark-X2.6-4B-INT8
- SGLang
How to use XHToken/Spark-X2.6-4B-INT8 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-INT8" \ --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-INT8", "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-INT8" \ --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-INT8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use XHToken/Spark-X2.6-4B-INT8 with Docker Model Runner:
docker model run hf.co/XHToken/Spark-X2.6-4B-INT8
Update README.md
Browse files58 unmodified lines596061626364122 unmodified lines1871881891901911921936 unmodified lines20020120220320420558 unmodified lines<img src="./images/inference.svg" alt="Spark-X2.6 inference" width="1010"></p>## Quickstart### Transformers122 unmodified lines#### ClientThinking is enabled by default by both the chat template and the Qwen3 reasoning parser. To disable thinking for a specific request, set `"chat_template_kwargs": {"enable_thinking": false}`.```bashcurl -s http://localhost:30000/v1/chat/completions \6 unmodified lines"content": "安徽的省会在哪里?"}],"max_tokens": 131072,"temperature": 1,"top_k": -1,58 unmodified lines5960616263646566676869707172122 unmodified lines1951961971981992002016 unmodified lines20820921021121221321458 unmodified lines<img src="./images/inference.svg" alt="Spark-X2.6 inference" width="1010"></p>## Reasoning Effort ComparisonWe compare high and low reasoning effort across agent, code, math, long-context, and general knowledge tasks. When switching from high to low, Spark-X2.6-1.7B average score decreases by `4.0` points, while its average output length drops by `37.3%`. For Spark-X2.6-4B, the average score decreases by `1.7` points, while average output length drops by `22.0%`. This flexibility allows developers to balance task performance and generation efficiency according to their application needs.<p align="center"><img src="./images/reasoning_effort.svg" alt="Spark-X2.6 reasoning_effort" width="1010"></p>## Quickstart### Transformers122 unmodified lines#### ClientThinking is enabled by default by both the chat template and the Qwen3 reasoning parser, default reasoning_effort set to "high". You can configure thinking behavior for each request through `chat_template_kwargs`: set `reasoning_effort` to "low" or "high", such as `"chat_template_kwargs": {"reasoning_effort": "low"}`, or set `"chat_template_kwargs": {"enable_thinking": false}` to disable thinking.```bashcurl -s http://localhost:30000/v1/chat/completions \6 unmodified lines"content": "安徽的省会在哪里?"}],"chat_template_kwargs": {"reasoning_effort": "low"},"max_tokens": 131072,"temperature": 1,"top_k": -1,
README.md+10-1