Text Generation
Transformers
Safetensors
Dutch
English
qwen3
dutch
nederlands
instruction-tuned
conversational
question-answering
summarization
text-generation-inference
Instructions to use ToetsChecker-Research/boterham with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ToetsChecker-Research/boterham with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ToetsChecker-Research/boterham") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ToetsChecker-Research/boterham") model = AutoModelForCausalLM.from_pretrained("ToetsChecker-Research/boterham", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ToetsChecker-Research/boterham with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ToetsChecker-Research/boterham" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ToetsChecker-Research/boterham", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ToetsChecker-Research/boterham
- SGLang
How to use ToetsChecker-Research/boterham 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 "ToetsChecker-Research/boterham" \ --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": "ToetsChecker-Research/boterham", "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 "ToetsChecker-Research/boterham" \ --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": "ToetsChecker-Research/boterham", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ToetsChecker-Research/boterham with Docker Model Runner:
docker model run hf.co/ToetsChecker-Research/boterham
Improve bilingual model card
Browse files
README.md
CHANGED
|
@@ -8,59 +8,251 @@ datasets:
|
|
| 8 |
library_name: transformers
|
| 9 |
pipeline_tag: text-generation
|
| 10 |
tags:
|
| 11 |
-
- nederlands
|
| 12 |
- dutch
|
| 13 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
---
|
| 15 |
|
| 16 |
-
#
|
| 17 |
|
| 18 |
-
|
| 19 |
-
verkregen materiaal: publiek domein en permissief gelicentieerde
|
| 20 |
-
bronnen. Geen geschraapt web, geen destillatie uit een ander model.
|
| 21 |
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
|
|
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
-
| | |
|
| 31 |
|---|---|
|
| 32 |
-
|
|
| 33 |
-
|
|
| 34 |
-
|
|
| 35 |
-
|
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
|
| 40 |
-
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
|
| 48 |
-
##
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
|
| 57 |
-
|
| 58 |
-
trainingsdata, want daar bestaat geen rechtmatige Nederlandstalige
|
| 59 |
-
bron van omvang voor. Dat is een bewuste keuze en geen omissie.
|
| 60 |
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
rechtspraak) of permissief gelicentieerd (CC BY, CC BY-SA, CC0).
|
| 66 |
-
Per document staat de herkomst in de datasheet bij de dataset.
|
|
|
|
| 8 |
library_name: transformers
|
| 9 |
pipeline_tag: text-generation
|
| 10 |
tags:
|
|
|
|
| 11 |
- dutch
|
| 12 |
+
- nederlands
|
| 13 |
+
- instruction-tuned
|
| 14 |
+
- conversational
|
| 15 |
+
- question-answering
|
| 16 |
+
- summarization
|
| 17 |
+
- qwen3
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# Boterham 0.5B
|
| 21 |
+
|
| 22 |
+
## English
|
| 23 |
+
|
| 24 |
+
### Model description
|
| 25 |
+
|
| 26 |
+
**Boterham 0.5B** is a compact, primarily Dutch decoder-only language model
|
| 27 |
+
developed by ToetsChecker Research. It was pretrained from scratch and then
|
| 28 |
+
instruction-tuned for working with Dutch text and documents. The model is
|
| 29 |
+
particularly intended for grounded tasks: give it a passage and ask it to
|
| 30 |
+
extract an answer, summarize the passage, or abstain when the requested
|
| 31 |
+
information is absent.
|
| 32 |
+
|
| 33 |
+
The Hugging Face export uses the `Qwen3ForCausalLM` implementation because the
|
| 34 |
+
architectures are compatible. **Boterham does not use Qwen weights and is not a
|
| 35 |
+
fine-tune or derivative of Qwen**; its tokenizer and model weights were trained
|
| 36 |
+
from scratch.
|
| 37 |
+
|
| 38 |
+
| Property | Value |
|
| 39 |
+
|---|---|
|
| 40 |
+
| Parameters | 488.3M total; 447.4M excluding tied token embeddings |
|
| 41 |
+
| Architecture | Decoder-only Transformer, RMSNorm, GQA, RoPE, SwiGLU, QK-norm |
|
| 42 |
+
| Layers / hidden size | 26 / 1,280 |
|
| 43 |
+
| Attention heads | 20 query heads, 4 key/value heads |
|
| 44 |
+
| Context length | 2,048 tokens |
|
| 45 |
+
| Vocabulary | 32,002-token byte-level BPE |
|
| 46 |
+
| Languages | Primarily Dutch; some English and Dutch-English translation data |
|
| 47 |
+
| License | Apache 2.0 |
|
| 48 |
+
|
| 49 |
+
### Intended tasks
|
| 50 |
+
|
| 51 |
+
The instruction-tuning mixture contains the following task families:
|
| 52 |
+
|
| 53 |
+
- grounded extractive question answering;
|
| 54 |
+
- abstention when an answer is not present in the supplied text;
|
| 55 |
+
- Dutch document summarization;
|
| 56 |
+
- arithmetic and short worked calculations;
|
| 57 |
+
- grammar and multiple-choice classification;
|
| 58 |
+
- Dutch-English translation;
|
| 59 |
+
- open questions, basic factual questions and short conversation.
|
| 60 |
+
|
| 61 |
+
Its main intended use is experimentation with Dutch NLP, document-grounded
|
| 62 |
+
assistants and retrieval-augmented generation. It is not intended as a
|
| 63 |
+
high-stakes decision system or as an authoritative source of facts.
|
| 64 |
+
|
| 65 |
+
### Training
|
| 66 |
+
|
| 67 |
+
The base model was pretrained from scratch on approximately **8.0 billion
|
| 68 |
+
tokens**. The corpus consists of public-domain and permissively licensed
|
| 69 |
+
material, including Dutch government publications, legislation, parliamentary
|
| 70 |
+
proceedings, case law and Wikimedia sources. The documented source dataset is
|
| 71 |
+
available at [ToetsChecker-Research/beleg](https://huggingface.co/datasets/ToetsChecker-Research/beleg).
|
| 72 |
+
No general web crawl or model-generated distillation dataset was used.
|
| 73 |
+
|
| 74 |
+
Instruction tuning used 575,211 training examples and a held-out set of 1,000
|
| 75 |
+
examples. It ran for **2 epochs / 4,786 optimizer steps** on four NVIDIA L4
|
| 76 |
+
GPUs, with a peak learning rate of `5e-5` and a cosine schedule. Training loss
|
| 77 |
+
was applied only to answer tokens and weighted globally by the number of answer
|
| 78 |
+
tokens. The best held-out validation loss was **0.8348**.
|
| 79 |
+
|
| 80 |
+
The instruction data was built from verifiable source documents where
|
| 81 |
+
possible. Extractive answers must occur in the context; abstention examples are
|
| 82 |
+
checked so that the answer is absent; and reference summaries originate from
|
| 83 |
+
the source collection. The model uses the Boterham chat tokens included in the
|
| 84 |
+
published tokenizer.
|
| 85 |
+
|
| 86 |
+
### Usage with Transformers
|
| 87 |
+
|
| 88 |
+
```bash
|
| 89 |
+
pip install "transformers>=4.51" torch
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
```python
|
| 93 |
+
import torch
|
| 94 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 95 |
+
|
| 96 |
+
model_id = "ToetsChecker-Research/boterham"
|
| 97 |
+
|
| 98 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 99 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 100 |
+
model_id,
|
| 101 |
+
dtype=torch.bfloat16 if torch.cuda.is_available() else torch.float32,
|
| 102 |
+
).to("cuda" if torch.cuda.is_available() else "cpu")
|
| 103 |
+
|
| 104 |
+
messages = [{
|
| 105 |
+
"role": "user",
|
| 106 |
+
"content": (
|
| 107 |
+
"Answer only from the text. If the answer is absent, say exactly: "
|
| 108 |
+
"Ik weet dit niet.\n\n"
|
| 109 |
+
"Tekst: De vergadering begint vrijdag om 14.00 uur in Utrecht.\n\n"
|
| 110 |
+
"Vraag: Hoe laat begint de vergadering?"
|
| 111 |
+
),
|
| 112 |
+
}]
|
| 113 |
+
|
| 114 |
+
prompt = tokenizer.apply_chat_template(
|
| 115 |
+
messages,
|
| 116 |
+
tokenize=False,
|
| 117 |
+
add_generation_prompt=True,
|
| 118 |
+
)
|
| 119 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 120 |
+
|
| 121 |
+
with torch.inference_mode():
|
| 122 |
+
output = model.generate(
|
| 123 |
+
**inputs,
|
| 124 |
+
max_new_tokens=128,
|
| 125 |
+
do_sample=False,
|
| 126 |
+
eos_token_id=tokenizer.eos_token_id,
|
| 127 |
+
pad_token_id=tokenizer.pad_token_id,
|
| 128 |
+
)
|
| 129 |
+
|
| 130 |
+
generated = output[0, inputs.input_ids.shape[1]:]
|
| 131 |
+
raw = tokenizer.decode(generated, skip_special_tokens=False)
|
| 132 |
+
|
| 133 |
+
# Some prompts produce a private reasoning block before the final answer.
|
| 134 |
+
answer = raw.split("<|einde_denken|>")[-1].split("<|einde|>")[0].strip()
|
| 135 |
+
print(answer)
|
| 136 |
+
```
|
| 137 |
+
|
| 138 |
+
For the most reproducible task evaluation, use greedy decoding
|
| 139 |
+
(`do_sample=False`) and reproduce the benchmark's required answer format.
|
| 140 |
+
|
| 141 |
+
### Checkpoints in this repository
|
| 142 |
+
|
| 143 |
+
- Root-level `model.safetensors`: compact Transformers inference export.
|
| 144 |
+
- `sft-0.5B/beste.pt`: best instruction-tuned native PyTorch checkpoint.
|
| 145 |
+
- `sft-0.5B/laatste.pt`: final native checkpoint including optimizer state,
|
| 146 |
+
intended for resuming training.
|
| 147 |
+
- `boterham-0.5B/`: original pretrained native checkpoints.
|
| 148 |
+
|
| 149 |
+
### Limitations
|
| 150 |
+
|
| 151 |
+
Boterham is a small experimental model. It has limited world knowledge and can
|
| 152 |
+
produce incorrect, fabricated or biased text. Factual claims about people,
|
| 153 |
+
dates, numbers, law, medicine or current events should not be trusted without
|
| 154 |
+
verification and supporting context. Its 2,048-token context window is short by
|
| 155 |
+
current standards. Open-ended conversation and creative writing received less
|
| 156 |
+
training emphasis than document-grounded tasks.
|
| 157 |
+
|
| 158 |
+
Official EuroEval benchmark results have not yet been published. Validation
|
| 159 |
+
loss is a training diagnostic and must not be interpreted as a benchmark score.
|
| 160 |
+
|
| 161 |
---
|
| 162 |
|
| 163 |
+
## Nederlands
|
| 164 |
|
| 165 |
+
### Modelbeschrijving
|
|
|
|
|
|
|
| 166 |
|
| 167 |
+
**Boterham 0.5B** is een compact, voornamelijk Nederlandstalig decoder-only
|
| 168 |
+
taalmodel van ToetsChecker Research. Het model is vanaf nul voorgetraind en
|
| 169 |
+
daarna instructiegetuned voor het werken met Nederlandse tekst en documenten.
|
| 170 |
+
Het is vooral bedoeld voor gegronde taken: geef het een passage en laat het een
|
| 171 |
+
antwoord uit de tekst halen, de passage samenvatten, of aangeven dat gevraagde
|
| 172 |
+
informatie ontbreekt.
|
| 173 |
|
| 174 |
+
De Hugging Face-export gebruikt `Qwen3ForCausalLM` omdat de architecturen
|
| 175 |
+
compatibel zijn. **Boterham gebruikt geen Qwen-gewichten en is geen finetune of
|
| 176 |
+
afgeleide van Qwen**; zowel de tokenizer als de modelgewichten zijn vanaf nul
|
| 177 |
+
getraind.
|
| 178 |
|
| 179 |
+
| Eigenschap | Waarde |
|
| 180 |
|---|---|
|
| 181 |
+
| Parameters | 488,3M totaal; 447,4M zonder de gedeelde tokenembeddings |
|
| 182 |
+
| Architectuur | Decoder-only Transformer, RMSNorm, GQA, RoPE, SwiGLU, QK-norm |
|
| 183 |
+
| Lagen / verborgen breedte | 26 / 1.280 |
|
| 184 |
+
| Attention-heads | 20 query-heads, 4 key/value-heads |
|
| 185 |
+
| Contextlengte | 2.048 tokens |
|
| 186 |
+
| Woordenschat | byte-level BPE met 32.002 tokens |
|
| 187 |
+
| Talen | Vooral Nederlands; ook Engels en Nederlands-Engelse vertaaldata |
|
| 188 |
+
| Licentie | Apache 2.0 |
|
| 189 |
+
|
| 190 |
+
### Taken
|
| 191 |
+
|
| 192 |
+
De instructiefinetuning bevat de volgende taakfamilies:
|
| 193 |
+
|
| 194 |
+
- extractieve vraagbeantwoording op basis van meegegeven tekst;
|
| 195 |
+
- onthouding wanneer het antwoord niet in de tekst staat;
|
| 196 |
+
- samenvatten van Nederlandse documenten;
|
| 197 |
+
- rekenen en korte uitgewerkte berekeningen;
|
| 198 |
+
- grammatica- en meerkeuzeclassificatie;
|
| 199 |
+
- Nederlands-Engelse vertaling;
|
| 200 |
+
- open vragen, eenvoudige feitenvragen en korte gesprekken.
|
| 201 |
+
|
| 202 |
+
Het belangrijkste gebruiksdoel is onderzoek naar Nederlandse NLP,
|
| 203 |
+
documentgestuurde assistenten en retrieval-augmented generation. Het model is
|
| 204 |
+
niet bedoeld voor beslissingen met grote gevolgen of als gezaghebbende
|
| 205 |
+
feitenbron.
|
| 206 |
+
|
| 207 |
+
### Training
|
| 208 |
+
|
| 209 |
+
Het basismodel is vanaf nul voorgetraind op ongeveer **8,0 miljard tokens**.
|
| 210 |
+
Het corpus bestaat uit publiek domein en permissief gelicentieerd materiaal,
|
| 211 |
+
waaronder Nederlandse overheidspublicaties, wetgeving, parlementaire
|
| 212 |
+
Handelingen, rechtspraak en Wikimedia-bronnen. De gedocumenteerde brondataset
|
| 213 |
+
staat op [ToetsChecker-Research/beleg](https://huggingface.co/datasets/ToetsChecker-Research/beleg).
|
| 214 |
+
Er is geen algemene webcrawl of door een ander model gegenereerde
|
| 215 |
+
destillatiedataset gebruikt.
|
| 216 |
+
|
| 217 |
+
De instructiefinetuning gebruikte 575.211 trainingsvoorbeelden en 1.000
|
| 218 |
+
apart gehouden validatievoorbeelden. De run duurde **2 epochs / 4.786
|
| 219 |
+
optimizerstappen** op vier NVIDIA L4-GPU's, met een maximale learning rate van
|
| 220 |
+
`5e-5` en een cosine schedule. Alleen antwoordtokens telden mee voor de loss;
|
| 221 |
+
de weging gebeurde globaal op basis van het aantal antwoordtokens. De beste
|
| 222 |
+
validatieloss was **0,8348**.
|
| 223 |
|
| 224 |
+
Waar mogelijk is de instructiedata opgebouwd uit controleerbare
|
| 225 |
+
brondocumenten. Extractieve antwoorden moeten letterlijk in de context staan,
|
| 226 |
+
bij onthoudingsvoorbeelden wordt gecontroleerd dat het antwoord ontbreekt, en
|
| 227 |
+
referentiesamenvattingen komen uit de broncollectie. Het model gebruikt de
|
| 228 |
+
Boterham-chattokens die in de gepubliceerde tokenizer zijn opgenomen.
|
| 229 |
|
| 230 |
+
### Gebruik met Transformers
|
| 231 |
|
| 232 |
+
Het Python-voorbeeld in de Engelse sectie is direct bruikbaar. De belangrijke
|
| 233 |
+
stappen zijn `AutoTokenizer.from_pretrained`,
|
| 234 |
+
`AutoModelForCausalLM.from_pretrained` en `tokenizer.apply_chat_template`.
|
| 235 |
+
Gebruik voor reproduceerbare evaluatie greedy decoding (`do_sample=False`) en
|
| 236 |
+
houd het antwoordformaat van de benchmark exact aan.
|
| 237 |
|
| 238 |
+
### Checkpoints in deze repository
|
| 239 |
|
| 240 |
+
- `model.safetensors` in de hoofdmap: compacte Transformers-export voor
|
| 241 |
+
inference en benchmarks.
|
| 242 |
+
- `sft-0.5B/beste.pt`: beste native PyTorch-checkpoint na instructiefinetuning.
|
| 243 |
+
- `sft-0.5B/laatste.pt`: laatste native checkpoint inclusief optimizerstaat,
|
| 244 |
+
bedoeld om training te hervatten.
|
| 245 |
+
- `boterham-0.5B/`: oorspronkelijke voorgetrainde native checkpoints.
|
| 246 |
|
| 247 |
+
### Beperkingen
|
|
|
|
|
|
|
| 248 |
|
| 249 |
+
Boterham is een klein experimenteel model. Het heeft beperkte wereldkennis en
|
| 250 |
+
kan onjuiste, verzonnen of bevooroordeelde tekst produceren. Feiten over
|
| 251 |
+
personen, datums, getallen, recht, geneeskunde of actuele gebeurtenissen mogen
|
| 252 |
+
niet zonder controle en ondersteunende context worden vertrouwd. Het
|
| 253 |
+
contextvenster van 2.048 tokens is naar huidige maatstaven kort. Open
|
| 254 |
+
conversatie en creatief schrijven kregen minder nadruk dan documentgebonden
|
| 255 |
+
taken.
|
| 256 |
|
| 257 |
+
Officiële EuroEval-benchmarkresultaten zijn nog niet gepubliceerd.
|
| 258 |
+
Validatieloss is een trainingsdiagnose en geen benchmarkscore.
|
|
|
|
|
|