{"slug": "apertus-1-5-8b-two-missing-stop-keys-in-older-ggufs", "title": "Apertus 1.5 8B: two missing stop keys in older GGUFs", "summary": "Two community Apertus 1.5 8B GGUFs published before llama.cpp added official text support in b12898 (PR #32880, December 1, 2026) matched a fresh conversion on perplexity and context limits but ran past tool calls on raw /completion 20 times out of 20 because they lacked two stop-token metadata keys, according to testing on llama.cpp b12974. The community Q8_0 file scored 6.7126 perplexity on wiki.test.raw versus 6.7126 for the official conversion, and the community Q4_K_M reached the same 19,456-token (f16 KV) and 35,840-token (q8_0 KV) context limits under a 7,664 MiB VRAM budget on an A100. The gap traced to the official Apertus1p5Model converter setting end-of-turn token 68 (<|assistant_end|>) and end-of-tool-message token 72 (<|tools_suffix|>), which the community files left unset; adding the two stop keys to the Q4_K_M file without changing its weights fixed the overrun.", "body_md": "# Apertus 1.5 8B: two missing stop keys in older GGUFs\n\nTwo community Apertus 1.5 8B GGUFs from before llama.cpp support gave nearly identical perplexity to a fresh conversion. On an A100 with a 7,664 MiB VRAM budget, the Q4_K_M files had identical measured context limits. Chat tool calls parsed 20/20, but raw completion ran past the call until both missing stop keys were added to the tested Q4_K_M file.\n\nWe tested two community Apertus 1.5 8B GGUFs released before `llama.cpp` added official text support. On `llama.cpp b12974`, the community `Q8_0` file matched a fresh conversion on perplexity (`6.7126`) and on greedy token sequences for all `200` prompts. The community `Q4_K_M` reached the same context lengths as a fresh conversion under our 7,664 MiB VRAM budget: **`19,456` tokens with f16 KV, `35,840` with q8_0**. We applied this budget on an A100 and narrowed each limit to 1,024 context tokens.\n\nThe difference appeared when we bypassed `llama-server`'s chat parser. Its OpenAI-compatible endpoint returned the expected tool calls on all `20` prompts for both community files. With the same prompts sent to raw `/completion`, both community files wrote a tool result themselves after the call, `20` times out of `20`; the fresh conversions stopped at the call. We repaired the community `Q4_K_M` by adding two stop-token metadata keys, leaving its weights unchanged.\n\n### What changed when llama.cpp added Apertus 1.5[#](#what-changed-when-llamacpp-added-apertus-15)\n\n[Apertus](https://huggingface.co/swiss-ai/Apertus-v1.5-8B) is an open multilingual model published by `swiss-ai`. The 1.5 checkpoint also carries vision and audio tokenizer weights; its text part is what runs in `llama.cpp`. Official text support landed in `b12898` ([PR #32880](https://github.com/ggml-org/llama.cpp/pull/32880), December 1, 2026). Before that, people extracted the text weights and published GGUFs themselves. Two of them are the ones we tested:\n\n- [`andreasmartin/apertus-v1.5-8b-text-Q8_0-GGUF`](https://huggingface.co/andreasmartin/apertus-v1.5-8b-text-Q8_0-GGUF) (uploaded August 16, 8.57 GB)\n- [`Colby/apertus-v1.5-8b-text-Q4_K_M-GGUF`](https://huggingface.co/Colby/apertus-v1.5-8b-text-Q4_K_M-GGUF) (uploaded September 5, 5.06 GB)\n\nBoth were converted from the same text-only repackaging of the model. The official converter (`Apertus1p5Model`) produces different vocabulary metadata and adds two stop-token fields. We read these differences from the GGUF headers:\n\n|  | Community files | Official conversion ( `b12974` ) | \n|---|---|---|\n| Tokenizer vocabulary | 131,272 | 266,752 | \n| Output vocabulary | 131,272 | 131,072 ( `vocab_size_out` ) | \n| End of turn (EOT) | not set | 68 `<\\|assistant_end\\|>` | \n| End of tool message (EOM) | not set | 72 `<\\|tools_suffix\\|>` | \n| `Q4_K_M` file size | 5.06 GB | 5.38 GB | \n\nThe chat template embedded in both community files is character-for-character identical to the one in the original checkpoint and to the one `llama.cpp` ships for Apertus 1.5 (`16,614` characters). We compared the tensors, checked where generation stopped, and measured whether the larger vocabulary changed VRAM use.\n\nFor comparison, we converted the original checkpoint (it is gated, so you accept the usage policy on Hugging Face first) to bf16 with the `b12974` converter, then quantized it to `Q8_0` and `Q4_K_M` with no importance matrix, the same as the community files. Every server ran with `-ngl 99 -fa on -np 1 --jinja`.\n\n### The block tensors match after an f16 conversion[#](#the-block-tensors-match-after-an-f16-conversion)\n\nPerplexity on `wiki.test.raw` (`-c 2048`, all chunks) was identical for `Q8_0` and differed by 0.0001 for `Q4_K_M`:\n\n|  | Community | Official conversion | \n|---|---|---|\n| `Q8_0` | 6.7126 | 6.7126 | \n| `Q4_K_M` | 7.0707 | 7.0708 | \n\n(The bf16 file scored `6.7145`.)\n\nFor greedy decoding we used `200` fixed prompts (English 120, German 20, French 20, Korean 40), temperature `0`, `128` tokens. The two `Q8_0` files produced identical token sequences on all `200`. The two `Q4_K_M` files matched on `70` of `200`; where they split, they agreed on the first `36` tokens (median) before the first different one.\n\nThe `Q4_K_M` gap points to how the files were made. Comparing tensors byte by byte, the community `Q8_0` matches our `Q8_0` on all `320` transformer-block tensors (its embedding table differs in `964` of the first `131,072` rows). The community `Q4_K_M` matches ours on `278` of `320` block tensors; the other `42` differ in `1` to `85` bytes each, and its embedding table differs in `967` rows. We then converted our bf16 file to f16 first and quantized from that. **The result matched both community files on all `320` block tensors**, and on every one of the first `131,072` embedding rows. This is strong evidence that the community files were quantized from an f16 intermediate. That small rounding step left the `Q8_0` blocks unchanged and showed up only in the embedding rows; in `Q4_K_M` it also reached `42` block tensors. Those differences flipped some later greedy choices while barely changing perplexity.\n\nFor scale, our own `Q8_0` and `Q4_K_M` of the same weights matched on `0` of the `200` prompts, agreeing on only the first `11` tokens (median). The community-versus-official difference at `Q4_K_M` is far smaller than the gap between the two quantization levels.\n\nThe community files also carry `200` extra output rows (`131,072` to `131,271`) that do not exist in the original output layer. Across all `200` greedy answers, neither community file ever produced a token id above `131,068`.\n\n### Chat ends cleanly; raw completion runs past tool calls[#](#chat-ends-cleanly-raw-completion-runs-past-tool-calls)\n\nWe sent `30` chat prompts and `20` tool-call prompts (two tools, `get_weather(city)` and `calculate(expression)`) to `/v1/chat/completions` with thinking disabled. All four files ended all `30` chats with `stop`. On the tool prompts, all four returned `finish_reason: tool_calls` `20` times. Each community file matched its corresponding fresh conversion on function names and arguments for every prompt. The community files used exactly one more token per call.\n\nThen we sent the same templated prompt as raw text to `/completion`, without the server's tool parser. Each community file wrote the same call tokens as its corresponding fresh conversion, ending in token `72` (`<|tools_suffix|>`). The official files stopped there. The community files, which do not mark `72` as a stop token, continued with `<|tool_output_start|>` and wrote the tool's answer themselves:\n\n```\n[{\"get_weather\": {\"city\": \"Zurich\"}}]{\"weather\": \"Sunny\", \"temperature\": \"22°C\"}The current weather in Zurich is sunny with a temperature of 22°C.\n```\n\n| Raw `/completion` , 20 tool prompts | Community `Q8_0` | Community `Q4_K_M` | Official ( `Q8_0` ,`Q4_K_M` ) | Community `Q4_K_M` + 2 keys | \n|---|---|---|---|---|\n| Stopped at `<\\|tools_suffix\\|>` | 0 | 0 | 20 each | 20 | \n| Text after the call | 20 | 20 | 0 | 0 | \n| Another call after the first | 3 | 2 | 0 | 0 | \n| Tokens generated (median) | 54.5 | 55 | 18.5 | 18.5 | \n\nEach community file made up a result for all `10` calculator prompts, and `7` of the `10` were wrong in both files. The community `Q8_0` \"computed\" `48213 * 9177` as `442,667,161` (the correct value is `442,450,701`) and `777 * 777` as `603,289` (correct: `603,729`). All three extra calls from the community `Q8_0` asked for weather in New York, a city no prompt mentioned.\n\nWhy the server endpoint hid this: reading the `b12974` source, the Apertus chat parser (`common/parsers/apertus.cpp`) describes a tool call as the JSON list followed by an optional `<|tools_suffix|>`, and applies that format as a grammar when tools are present. What we observed fits that: through the endpoint, the community files wrote one token more than the official ones and stopped. Anything that reads the model's raw output instead, such as a client that sends `/completion` and parses tool calls itself, sees the made-up results.\n\n### Two keys fix it, weights untouched[#](#two-keys-fix-it-weights-untouched)\n\n`llama.cpp` ships `gguf_new_metadata.py`, which copies a GGUF with changed metadata. We set the two missing tokens on the community `Q4_K_M`:\n\n```\npython gguf-py/gguf/scripts/gguf_new_metadata.py \\\n  apertus-v1.5-8b-text-q4_k_m.gguf apertus-v1.5-8b-text-q4_k_m-eom.gguf \\\n  --special-token eot \"<|assistant_end|>\" \\\n  --special-token eom \"<|tools_suffix|>\" --force\n```\n\nThe copy stopped at `<|tools_suffix|>` on all `20` raw tool prompts, and its token counts matched the official `Q4_K_M` on every prompt. Chat stayed `30` of `30` with `stop`.\n\n### Under a 7,664 MiB VRAM budget[#](#under-a-7664-mib-vram-budget)\n\nWe used the same rule as the rest of this series: start `llama-server` with `-c N` and `-ub 512`, send an `N − 512`-token prompt, and read the process's VRAM from `nvidia-smi`. A point fits when usage stays at or below `7,664 MiB`. We halved the search range until the last fitting and first failing `N` were 1,024 tokens apart. These runs imposed an 8 GB budget on an A100 80GB; they did not run on a physical 8 GB card.\n\n| `Q4_K_M` | KV f16: largest fitting N | VRAM at N | KV q8_0: largest fitting N | VRAM at N | \n|---|---|---|---|---|\n| Official conversion | 19,456 | 7,550 MiB | 35,840 | 7,624 MiB | \n| Community | 19,456 | 7,550 MiB | 35,840 | 7,624 MiB | \n\nThe next 1,024-token step exceeded the budget for both files (`20,480` tokens at `7,680 MiB` with f16, `36,864` at `7,698 MiB` with q8_0). Every one of the `15` points we measured was identical between the two files to the MiB, even though the official file is about 300 MB larger. Most of that size difference comes from the official embedding table's `135,480` additional rows. In these loads, the table was mapped to system RAM: the logs show `586.12 MiB` of CPU-mapped weights for the official file and `288.44 MiB` for the community file, with the GPU model buffer at about `4,528 MiB` for both.\n\nSpeed at those settings, measured with the GPU to ourselves; these are A100 numbers, not what an 8 GB card will do:\n\n| `Q4_K_M` | Prompt tok/s | Decode tok/s | \n|---|---|---|\n| Official, f16 KV, `-c 19456` | 4,246 | 144.5 | \n| Community, f16 KV, `-c 19456` | 4,230 | 148.4 | \n| Official, q8_0 KV, `-c 35840` | 3,563 | 140.2 | \n| Community, q8_0 KV, `-c 35840` | 3,547 | 144.3 | \n\nPrompt speed is the median of three `N − 512`-token prompts; decode is the median of three `256`-token generations after a short chat prompt.\n\n### Which file to use[#](#which-file-to-use)\n\nIn our tests, both community files ended chats and returned tool calls through `llama-server`'s chat endpoint as the fresh conversions did. For raw completions, adding both metadata keys with the command above repaired the community `Q4_K_M`. The patched `Q4_K_M` stopped where the official file stops. The community `Q8_0` is missing the same two keys. A fresh conversion with the official `b12898` or later converter includes the keys.\n\nSetup: `llama.cpp b12974` (`72a780e`), A100 80GB PCIe, `-ngl 99 -fa on -np 1 --jinja`, thinking disabled, temperature `0`, seed `1`.", "url": "https://wpnews.pro/news/apertus-1-5-8b-two-missing-stop-keys-in-older-ggufs", "canonical_source": "https://sotaaz.com/post/apertus-8gb-gpu-fit-en", "published_at": "2026-12-06 07:29:25+00:00", "updated_at": "2026-12-06 08:14:57.688410+00:00", "lang": "en", "topics": ["large-language-models", "ai-tools", "ai-research"], "entities": ["Apertus 1.5 8B", "llama.cpp", "swiss-ai", "andreasmartin/apertus-v1.5-8b-text-Q8_0-GGUF", "Colby/apertus-v1.5-8b-text-Q4_K_M-GGUF", "Apertus1p5Model", "A100", "Hugging Face"], "also_reported_by": [], "takeaway": "Community Apertus 1.5 8B GGUFs converted before llama.cpp b12898 lack the EOT (68) and EOM (72) stop-token keys, so raw /completion runs past tool calls 20/20 times; adding the two stop keys to the Q4_K_M file fixed it with weights unchanged.", "recommendation": {"advice": "When running pre-b12898 community Apertus 1.5 8B GGUFs, add the missing EOT (68) and EOM (72) stop-token metadata keys before using raw /completion, since the files otherwise wrote tool results themselves 20/20 times.", "playbook": "inference-serving", "playbook_url": "https://wpnews.pro/playbooks/inference-serving"}, "alternates": {"html": "https://wpnews.pro/news/apertus-1-5-8b-two-missing-stop-keys-in-older-ggufs", "markdown": "https://wpnews.pro/news/apertus-1-5-8b-two-missing-stop-keys-in-older-ggufs.md", "text": "https://wpnews.pro/news/apertus-1-5-8b-two-missing-stop-keys-in-older-ggufs.txt", "jsonld": "https://wpnews.pro/news/apertus-1-5-8b-two-missing-stop-keys-in-older-ggufs.jsonld"}}