anaksor-ocr
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
A 4.1B language model for coding, agent work and long context in English and Chinese, with three thinking levels. For developers building agents that run on their own devices.
Spark-X2.6-4B is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page, a zip of its files. Nothing in it runs by itself.
pip install transformers==4.57.1
Spark-X2.6-4B is a compact general-purpose language model with 4.1B parameters, made for on-device use. It keeps the architecture of Spark-X2.5-4B and gains its improvements from better post-training. It works in English and Chinese, and it has three thinking levels: none, low and high.
It suits developers who want a small model for local agents, coding help and long documents, without sending data to a server.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Software | Developers | Run a local coding and agent assistant | A helper that plans steps and calls tools on a laptop |
| Product teams | App makers | Ship an on-device assistant | A chat feature that works without a cloud model |
| Global teams | Content staff | Work in English and Chinese with one model | Draft and check text in both languages |
| AI research | Researchers | Study the cost of thinking at different levels | Compare scores and output length at high and low effort |
If you need a huge model for the hardest tasks, you can skip it.
| Use case | Who | What they get back |
|---|---|---|
| Coding help | Developers | Code and explanations at the thinking level you choose |
| Agent tasks | Agent builders | Tool-use and multi-step planning from a small model |
| Long-context reading | Analysts | Answers drawn from long inputs |
You need these first:
pip install transformers==4.57.1
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "XHToken/Spark-X2.6-4B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
torch_dtype="auto",
device_map="auto",
)
messages = [{"role": "user", "content": "What is the capital of Anhui Province?"}]Put your question into a list of messages, pass it through the tokenizer's chat template, and generate. The card's example turns thinking on in the template. Choose none, low or high thinking to trade answer quality against speed and cost.
| Tool | What it does |
|---|---|
| enable_thinking=True | Turns thinking on in the chat template example |
| Thinking levels | None, low or high, so you balance quality, latency and cost |
| trust_remote_code=True | Lets the code that ships with the model run when it loads |
| device_map="auto" | Places the model on the devices you have |
You ask, "Write a function that checks whether a string is a palindrome." With thinking on, the model reasons first and then returns the function. With thinking at none, it answers faster with less reasoning.
This is a small model that you can run on your own machine. A good first step is the short Python example above, with thinking on, and then the same question with thinking off.
The authors say the gains come from post-training alone, with the architecture unchanged from the earlier release. They report that it matches or beats some models of about 9B parameters, and that its inference speed is on par with Qwen3.5-4B and Gemma-E4B.
Lower thinking effort costs a little accuracy and saves output length, by the card's numbers.
A 4.1B language model for coding, agent work and long context in English and Chinese, with three thinking levels. For developers building agents that run on their own devices.
Made by XHToken on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.
What it is: Spark-X2.6-4B is a compact general-purpose language model with 4.1B parameters, made for on-device use. It keeps the architecture of Spark-X2.5-4B and gains its improvements from better post-training. It works in English and Chinese, and it has three thinking levels: none, low and high.
Who it suits: It suits developers who want a small model for local agents, coding help and long documents, without sending data to a server.
Industry | Who uses it | How they use it | Example
Software | Developers | Run a local coding and agent assistant | A helper that plans steps and calls tools on a laptop
Product teams | App makers | Ship an on-device assistant | A chat feature that works without a cloud model
Global teams | Content staff | Work in English and Chinese with one model | Draft and check text in both languages
AI research | Researchers | Study the cost of thinking at different levels | Compare scores and output length at high and low effort
If you need a huge model for the hardest tasks, you can skip it.
Where to use it:
Use case | Who | What they get back
Coding help | Developers | Code and explanations at the thinking level you choose
Agent tasks | Agent builders | Tool-use and multi-step planning from a small model
Long-context reading | Analysts | Answers drawn from long inputs
How to set it up: You need these first:
pip install transformers==4.57.1
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "XHToken/Spark-X2.6-4B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
trust_remote_code=True,
torch_dtype="auto",
device_map="auto",
)
messages = [{"role": "user", "content": "What is the capital of Anhui Province?"}]
How to use it: Put your question into a list of messages, pass it through the tokenizer's chat template, and generate. The card's example turns thinking on in the template. Choose none, low or high thinking to trade answer quality against speed and cost.
Tool | What it does
enable_thinking=True | Turns thinking on in the chat template example
Thinking levels | None, low or high, so you balance quality, latency and cost
trust_remote_code=True | Lets the code that ships with the model run when it loads
device_map="auto" | Places the model on the devices you have
Example: You ask, "Write a function that checks whether a string is a palindrome." With thinking on, the model reasons first and then returns the function. With thinking at none, it answers faster with less reasoning.
For newcomers and experts: This is a small model that you can run on your own machine. A good first step is the short Python example above, with thinking on, and then the same question with thinking off.
The authors say the gains come from post-training alone, with the architecture unchanged from the earlier release. They report that it matches or beats some models of about 9B parameters, and that its inference speed is on par with Qwen3.5-4B and Gemma-E4B.
You write messages for the model
The chat template adds the thinking setting
The model reasons, then answers
You read the text it returns
Good to know: Lower thinking effort costs a little accuracy and saves output length, by the card's numbers.
Title: Average score drop from high to low effort
Spark-X2.6-4B: 1.7 points
Spark-X2.6-1.7B: 4.0 points
Download its files with Hugging Face's command line:
pip install -U huggingface_hub
hf download XHToken/Spark-X2.6-4B
Then follow the usage in its model card. Nothing in this kit runs by itself.
README.md 5 KB
Listed Hugging Face models in the same category that share the most tags with this one.
| Product | Downloads, last 30 days | Likes | Parameters | License | Last change |
|---|---|---|---|---|---|
| Spark-X2.6-4B This page | 28,117 | 1,041 | 4.1B | apache-2.0 | |
| Spark-X2.5-4BShares sparkx2_5 · spark2_5 · text-generation | 8,697 | 1,442 | 4.1B | apache-2.0 | |
| Spark-X2.6-1.7BShares sparkx2_5 · spark2_5 · text-generation | 5,095 | 84 | 1.7B | apache-2.0 | |
| Spark-X2.6-4B-BaseShares sparkx2_5 · spark2_5 · text-generation | 2,331 | 47 | 4.1B | apache-2.0 | |
| Spark-X2.6-4B-FP8Shares sparkx2_5 · spark2_5 · text-generation | 2,048 | 39 | 4.1B | apache-2.0 | |
| Spark-X2.6-1.7B-BaseShares sparkx2_5 · spark2_5 · text-generation | 1,272 | 15 | 1.7B | apache-2.0 |
Posts and comments that name this project on Hacker News, Bluesky, X, Reddit, Facebook and YouTube, found by a weekly search and on Trendshift. Mindket doesn’t write or check them. Open one to read it where it was posted.
Sokheng · Kit
Reads Khmer and English text from documents, receipts and photos of signs, using a detector for text lines and a recogniser for each line. Suits developers who…
Qwen · Kit
Qwen2.5-7B-Instruct as GGUF files in eight quantization sizes, to chat with locally through llama.cpp. For people who want a capable 7.6B model on their own co…
ACE-Step · Kit
Generates music from text with a 4B diffusion decoder, 50 steps and guidance control, aiming for higher audio quality than the base. For creators with a GPU of…
alirezarezvani · Skill
Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…
block · Kit
Self-hostable workspace where people and AI agents share the same rooms, built on a Nostr relay that logs every action as a signed event. For teams that want t…
backnotprop · Kit
Opens your AI coding agent's plans, specs and code changes in a browser so you can annotate or comment on them and send the feedback straight back to the agent.