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…
Generates text with a 4B Qwen3 model that switches between a thinking mode for hard reasoning and a plain mode for quick chat. Suits developers who want a small chat model.
Qwen3-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 -U huggingface_hub hf download Qwen/Qwen3-4B
Qwen3-4B is a 4B parameter text generation model from the Qwen3 series, built on Qwen3-4B-Base. One model covers two modes: a thinking mode for math, code and logic, and a non-thinking mode for everyday dialogue. It also works with external tools and supports 100+ languages and dialects.
Developers and teams who want a small open model for chat, reasoning or tool-using agents, hosted by themselves or run on a laptop with a local app.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Software | Developers | Run a small chat and reasoning model in their own app | Serve it behind an OpenAI-compatible endpoint |
| Localization | Translators | Handle instructions and translation across many languages | Ask it to translate a short note |
| Agents | Agent builders | Let the model call external tools | Use thinking mode for a multi-step task |
If you need a model with far more parameters, you can skip this one.
| Use case | Who | What they get back |
|---|---|---|
| Reasoning in thinking mode | Students and developers | Step-by-step reasoning on math, code and logic |
| Quick chat in non-thinking mode | App builders | Fast general-purpose replies |
| Creative writing and role-play | Writers | Natural multi-turn conversation |
pip install -U huggingface_hub hf download Qwen/Qwen3-4B
To serve it as an endpoint, the card gives these commands:
python -m sglang.launch_server --model-path Qwen/Qwen3-4B --reasoning-parser qwen3
vllm serve Qwen/Qwen3-4B --enable-reasoning --reasoning-parser deepseek_r1
Load the tokenizer and model, build a chat message list, and apply the chat template. The enable_thinking flag switches between thinking and non-thinking modes, and it defaults to True.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Qwen/Qwen3-4B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)| Tool | What it does |
|---|---|
| AutoTokenizer | Loads the tokenizer and applies the chat template |
| AutoModelForCausalLM | Loads the model and generates the reply |
| enable_thinking | Switches thinking mode on or off |
You send the message asking for a short introduction to large language models. In thinking mode the reply holds the reasoning first and the answer after it, and you can parse the two parts apart.
If you are new, load the model with the snippet above and send one short question. Leave thinking on for hard problems and turn it off when you only want a quick answer.
The model has 36 layers and grouped query attention, 32 heads for queries and 8 for keys and values. Context is 32,768 tokens natively and 131,072 with YaRN. If you see endless repetition, the card advises its sampling settings and a presence_penalty of 1.5.
Generates text with a 4B Qwen3 model that switches between a thinking mode for hard reasoning and a plain mode for quick chat. Suits developers who want a small chat model.
Made by Qwen 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: Qwen3-4B is a 4B parameter text generation model from the Qwen3 series, built on Qwen3-4B-Base. One model covers two modes: a thinking mode for math, code and logic, and a non-thinking mode for everyday dialogue. It also works with external tools and supports 100+ languages and dialects.
Who it suits: Developers and teams who want a small open model for chat, reasoning or tool-using agents, hosted by themselves or run on a laptop with a local app.
Industry | Who uses it | How they use it | Example
Software | Developers | Run a small chat and reasoning model in their own app | Serve it behind an OpenAI-compatible endpoint
Localization | Translators | Handle instructions and translation across many languages | Ask it to translate a short note
Agents | Agent builders | Let the model call external tools | Use thinking mode for a multi-step task
If you need a model with far more parameters, you can skip this one.
Where to use it:
Use case | Who | What they get back
Reasoning in thinking mode | Students and developers | Step-by-step reasoning on math, code and logic
Quick chat in non-thinking mode | App builders | Fast general-purpose replies
Creative writing and role-play | Writers | Natural multi-turn conversation
How to set it up:
pip install -U huggingface_hub
hf download Qwen/Qwen3-4B
To serve it as an endpoint, the card gives these commands:
python -m sglang.launch_server --model-path Qwen/Qwen3-4B --reasoning-parser qwen3
vllm serve Qwen/Qwen3-4B --enable-reasoning --reasoning-parser deepseek_r1
How to use it: Load the tokenizer and model, build a chat message list, and apply the chat template. The enable_thinking flag switches between thinking and non-thinking modes, and it defaults to True.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Qwen/Qwen3-4B"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
Tool | What it does
AutoTokenizer | Loads the tokenizer and applies the chat template
AutoModelForCausalLM | Loads the model and generates the reply
enable_thinking | Switches thinking mode on or off
Example: You send the message asking for a short introduction to large language models. In thinking mode the reply holds the reasoning first and the answer after it, and you can parse the two parts apart.
For newcomers and experts: If you are new, load the model with the snippet above and send one short question. Leave thinking on for hard problems and turn it off when you only want a quick answer.
The model has 36 layers and grouped query attention, 32 heads for queries and 8 for keys and values. Context is 32,768 tokens natively and 131,072 with YaRN. If you see endless repetition, the card advises its sampling settings and a presence_penalty of 1.5.
Download the files or load them with transformers
Build messages and apply the chat template
Choose thinking or non-thinking mode
Generate and read the reply
Good to know:
Title: Context length in tokens
Native: 32768 tokens
With YaRN: 131072 tokens
Download its files with Hugging Face's command line:
pip install -U huggingface_hub
hf download Qwen/Qwen3-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 |
|---|---|---|---|---|---|
| Qwen3-4B This page | 3,186,531 | 798 | 4B | apache-2.0 | |
| Qwen3-0.6BShares qwen3 · text-generation · conversational | 19,718,599 | 1,894 | 752M | apache-2.0 | |
| Qwen3-14BShares qwen3 · text-generation · conversational | 12,965,376 | 540 | 14.8B | apache-2.0 | |
| Qwen3-8BShares qwen3 · text-generation · conversational | 6,269,141 | 2,184 | 8.2B | apache-2.0 | |
| Qwen3-1.7BShares qwen3 · text-generation · conversational | 3,203,490 | 618 | 2B | apache-2.0 | |
| Qwen3-4B-Instruct-2507Shares qwen3 · text-generation · conversational | 2,592,168 | 1,053 | 4B | 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.