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
[HER Hack-Astron #8] [Spark × SkillHub] SafeOps procurement intake
Project and track
Documents and extraction
Browser review and new cases (24 November)
Download the browser demo and run evidence (ZIP)
The review screen puts the total beside the selected notice. The operator can open its cited line, read the raw Spark response, and choose whether to record the draft. The test register reports the result after the click.
Decline, zero rows · Missing line total, zero rows
The final run covered six scenarios on five public notices. Spark matched 16/16 fields and their source lines among the fields it had to choose. In two notices the supplier line total was blank, so the checker constrained that field to null before inference. SQLite readback showed 1, 0, 0, 1, 0, 1 rows. The browser clicks were scripted. Repeated confirmation kept one row, and stale confirmations were rejected.
The first frozen version passed one of two independently prepared cases. Spark copied the correct CNY 8,500,000.00 amount, but the checker blocked it because it did not recognize Line total (budget). It correctly held the other case, which had a contract budget but a blank supplier total. Both runs are in the archive. After the fix, a third source was revealed. Its first run matched all three fields and recorded the CNY 20,000.00 projector line once.
The inputs are factual transcriptions with one item per record and fictional intake details. Some figures are published estimates. Codex built and ran the demo. A separate agent prepared the held-back examples and references. The original CLI run follows below.
Pasig procurement notice
Before the single local run, the reference specified item 7 (Desktop, 1 set), its approved line budget of PHP 85,200.00, and the decision to confirm the draft. Spark-X2.6-4B matched all three fields from the transcribed notice in its first raw response. After a scripted browser confirmation, the SQLite test register contained one row for that amount.
Using the neighboring laptop total of PHP 344,806.68 would overstate the desktop’s recorded budget by PHP 259,606.68.
Official notice, pp. 1–2 · First-run evidence (ZIP)
User and task
A procurement coordinator gets a short note and has to turn it into a draft, check the amounts, and chase any missing information. SafeOps puts a line number next to each field so the coordinator can check it before recording anything.
The public notice lists 68 desktop computers at a line total of CNY 408,000 and a project budget of CNY 497,000. The demo turns those facts into a short intake with a fictional requester, department, filing date and delivery date. A second input removes the desktop total and leaves the project budget in place. fixtures/reference.json records the expected fields and write counts from before the first call to Spark. Hubei Normal University procurement notice
SkillHub skill and Spark-X2.6-4B
Codex used Workflow A from global/approval-flow-copilot 1.0.2. The field matrix and form guided the draft. The extraction rules say to keep dates as written and mark fields the source does not provide. skill-in-use.md lists the four files consulted and the archive hash. SkillHub listing
Local Spark received the numbered intake and returned JSON values with source line numbers. SafeOps checked the citations and the full amount on the Cost line, then displayed the form. A separate terminal reply controlled the SQLite write.
Demo
These four frames follow the recorded approval case. They were rendered from the saved input, raw response, terminal transcript and SQLite readback. A script supplied the operator replies in the recorded cases.
The intake includes both amounts. The project budget is on line 4 and the desktop total is on line 5.
Spark returned CNY 408,000 with line 5. The response file preserves the original JSON text.
SafeOps displayed the checked draft before asking whether to record it.
After confirmation, a separate verifier opened the database read-only and checked the saved row against the reference.
Reproduction
Download the reproducibility bundle (ZIP).
The package includes safeops.py, verify.py, the fixtures and the full run files. README.md gives the three commands and the operator replies. The runner uses Python 3.12.6 on Windows with Ollama 0.40.14 and a GeForce RTX 4070 (12 GiB). The SparkLLM/Spark-X2.6-4B:q4_k_m weights match the official GGUF at 9d716770ac7477776de5f891f70cdf98b003a5cd. The three requests use temperature 0, seed 42, context 4096, an output limit of 768 tokens, and thinking off. The exact prompt and schema are in each request.json. Ollama tag · GGUF revision
Results and limitations
| Case | What happened | SQLite rows | Ollama time |
|---|---|---|---|
| Missing desktop total | Asked for the amount | 0 | 1.84 s |
| Complete intake, declined | Returned the draft without saving it | 0 | 1.95 s |
| Complete intake, approved | Saved the draft and read it back | 1 | 1.94 s |
Each case made a separate call. The last two used the same intake to isolate the operator's decision. On the three final runs, 20 of 24 raw field-and-line pairs matched the reference exactly. Spark kept “I'm the” in the requester field three times and “support” in the purpose once. The form trims those two prefixes after checking the source. All 24 final fields matched the reference, including the one missing value. The model was already loaded and Ollama reused cached prompt tokens in all three timed calls.
In the first trial Spark left the amount empty and cited the project budget line. SafeOps rejected that response and the register stayed empty. The revised schema requires an absent value and an absent citation to occur together. The initial request and response are included in evidence/initial-attempt/.
The demo covers one procurement layout and two inputs from one notice. The operator still has to check the meaning of extracted text. Recording an entry is the last step in the demo. The database is a test register.
Contributors and disclosure
Individual entry by Marsiqque, who chose the project and set the scope. Codex prepared the fixtures, implemented and ran the demo, reviewed the evidence and drafted the entry. The confirmation step builds on SafeOps from Round 5. The procurement intake and test register were made for Round 8. Marsiqque · Round 5 SafeOps





