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 # 7] Notice Reader — local community notices in plain English
Project name and track
Notice Reader — Accessibility.
Who this helps and what problem it solves
Notice Reader is intended for adults who find dense community notices difficult to read. A library membership notice, a bus-stop change or a community event can put several conditions into one paragraph. The application turns that paragraph into a heading and short bullet points, offers larger text, and keeps the original available for comparison. The intended benefit is easier access to everyday community information on a computer that can run the model locally.
How Spark-X2.6-4B is used
Spark-X2.6-4B generates the rewritten notice. A separate numeric-token comparison flags missing or new numbers. The browser interface and Python server run locally; no hosted inference service is used.
Model: https://huggingface.co/XHToken/Spark-X2.6-4B
Revision: 66e3ae7bee54e0a523d692cb8ef841f35409807b
Runtime: https://github.com/XHToken/Spark-MLX-LLM at d7bffc415962d714c4ccfb4bea987de5c8ee7fa8.
Illustrated demo
The screenshots below show the running local application using the pinned model, captured on 23 October 2026. The inputs are fictional community notices.
- Select the repair-cafe example or paste a notice.
- Press Make it easier to read. The local model returns the rewrite.
- Use Larger text and Compare with the original to read and check it.
The library example demonstrates larger text with its original expanded for comparison.
At a 390-pixel browser viewport, the panels stack vertically and the result stays within the page width.
Actual input:
The Riverside Library repair cafe takes place on Saturday 31 October from 10:00 to 13:00. Bring one small electrical item. Repairs are free. Please book a slot by calling 01632 960123. Step-free access is available through the garden entrance.
Actual model output shown in the browser:
Riverside Library Repair Cafe
- Saturday 31 October, 10:00 to 13:00
- Bring one small electrical item
- Repairs are free
- Book a slot by calling 01632 960123
- Step-free access is available through the garden entrance
How to reproduce
Source code and evaluation records.
The project contains notice_reader.py, index.html, pinned requirements.txt, download/qualification and evaluation scripts, tests, and exact recorded inputs and outputs.
python3.12 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
HF_HOME="$PWD/hf-cache" HF_HUB_DISABLE_TELEMETRY=1 .venv/bin/python qualify_runtime.py
.venv/bin/python notice_reader.py
Open http://127.0.0.1:8765. While the server is running, run .venv/bin/python evaluate_model.py to record the three example requests. Run .venv/bin/python -m unittest -v test_reader.py for the HTTP boundary tests.
Recorded environment: Apple M4 Pro, 24 GiB memory, macOS 26.3, Python 3.12.14, MLX 0.32.4 and mlx-lm 0.31.3. The model uses BF16 on the GPU without quantization. Sampling uses temperature 0, seed 0 and thinking disabled. The app accepts up to 4,000 characters and generates at most 512 tokens. It rejects truncated generation and asks for a shorter section.
The exact prompt is SYSTEM_PROMPT in notice_reader.py: rewrite in plain English using a short heading and hyphen bullets, preserve dates, times, costs, contact numbers, conditions and access details, and add no new facts. The source is delimited as notice data.
Results and limitations
Three original synthetic examples were run through the actual application and pinned checkpoint. Exact inputs, outputs and settings are included in evaluation.json.
| Example | Source / output words | Generation time |
|---|---|---|
| repair | 39 / 38 | 4.38 s |
| library | 58 / 64 | 4.00 s |
| bus | 55 / 61 | 3.71 s |
Comparison against the 24 listed source facts found them represented in the three outputs. The numeric checker reported no added or missing numeric tokens in these examples. Five separate automated tests passed for HTTP handling, Unicode, numeric differences and output-limit handling; those tests use a stub model. Browser checks exercised two real model examples, larger text, source comparison, empty-input handling and the 390-pixel layout. Changing the source clears the previous result, and the source controls remain disabled while a rewrite is running.
A fourth actual request used a 3,447-character synthetic notice listing 30 events. It reached the output limit; the application returned HTTP 422 after 23.35 seconds with a request for a shorter section and did not return partial notice text. The exact request and response are in limit-evaluation.json.
The library and bus examples mainly converted the original sentences into bullets and became longer. The numeric check cannot establish semantic equivalence or detect every error. The results do not establish improved reading comprehension. The current runtime requires Apple Silicon and enough memory for the roughly 8.3 GB original checkpoint. The interface currently handles English text.
Contributors and disclosure
Individual entry: jollysoundcake1 · GitHub: soundcake.
Codex was used to implement the application, tests and documentation and to run the recorded evaluations. Spark-X2.6-4B generates the demonstrated notice rewrites. The application uses no other inference service.
All example notices were created for this demonstration and describe fictional events or services. The model, Spark-MLX-LLM, MLX, mlx-lm, Transformers and other pinned dependencies are acknowledged in the setup files and retain their respective licenses. The model is Apache-2.0.


