Skip to content

armgit / janas

Public Imported from GitHub
0

37 tok/s from Qwen3-Next-80B (48 GB) on a 32 GB laptop, 24 without drafts vs 2.8 for llama.cpp; reading 62 vs 16 tok/s. Faster than llama.cpp on all 13 models compared in Q4_K_M. LLMs bigger than your RAM, pure C, CPU or GPU.

Release 2026-10-27 (4): the long contexts against llama.cpp at the same eight-bit KV cache (q8_0): at 8,192 tokens 18.2 against 4.9 tok/s writing, 74 against 20 reading

camaurif085859222b2
diff --git a/README.md b/README.md
index b409077..93b1c21 100644
--- a/README.md
+++ b/README.md
@@ -40,17 +40,17 @@ Janas-LLM's figures are the best of the configurations `janas-bench` measures, a
**New: Intel's NPU reads the prompts.** On the same laptop's NPU Janas-LLM reads 1,024 tokens of Qwen3.5-2B at 729 tok/s, of Gemma-4-E2B at 508 and of Qwen3-4B at 333, 1.5 to 2.6 times as fast as without it, with answers as close to llama.cpp's as the CPU's. It takes the NPU by itself where it measures faster, and three options choose by hand: [Intel's NPU](#intels-npu), [Choosing what runs where](#choosing-what-runs-where).
-**Long contexts: at 16,384 tokens Janas-LLM writes a reply at 15.0 tok/s, where llama.cpp manages 2.2, and reads the prompt at 56 tok/s, against 31.** Qwen3-4B Q4_K_M on the same laptop, the CPU alone on both sides (12 threads), the same file, 26 October 2026; a prompt read from the start, then 64 tokens written after it:
+**Long contexts: at 8,192 tokens Janas-LLM writes a reply at 18.2 tok/s, where llama.cpp manages 4.9, and reads the prompt at 74 tok/s, against 20 - both keeping keys and values at eight bits.** Qwen3-4B Q4_K_M on the same laptop, the CPU alone on both sides (12 threads), the same file, 26-27 October 2026; a prompt read from the start, then 64 tokens written after it:
| Context | reading the prompt: Janas-LLM | llama.cpp | writing after it: Janas-LLM | llama.cpp |
|---|---|---|---|---|
-| 1,024 tokens | 118 tok/s | 67 | 27.6 tok/s | 12.5 |
-| 4,096 | 96 | 55 | 22.0 | 7.7 |
-| 8,192 | 74 | 44 | 18.2 | 4.6 |
-| 16,384 | 56 | 31 | 15.0 | 2.2 |
+| 1,024 tokens | 118 tok/s | 54 | 27.6 tok/s | 12.1 |
+| 4,096 | 96 | 32 | 22.0 | 7.5 |
+| 8,192 | 74 | 20 | 18.2 | 4.9 |
+| 16,384 | 56 | under 9.1 | 15.0 | - |
| 32,000 | 35 | - | 10.7 | - |
-The longer the context, the wider the gap: 2.2 times as fast writing at 1,024 tokens, 6.9 times at 16,384. Both slow down as the context grows, and on both the attention is what grows: at 32,000 tokens it takes 59 of the 93 ms Janas-LLM spends on a token written, and the 32,000 tokens of prompt take 15 minutes to read. Janas-LLM's peak memory went from 2.6 GiB at 1,024 tokens to 4.9 at 32,000. The conditions are the same wherever possible; where not: Janas-LLM keeps the keys and values at eight bits, llama.cpp at sixteen (its default); llama.cpp was not run at 32,000 tokens (almost another hour). How it was measured: [below](#how-the-figures-were-measured).
+The longer the context, the wider the gap: 2.3 times as fast writing at 1,024 tokens, 3.7 times at 8,192. Both slow down as the context grows, and on both the attention is what grows: at 32,000 tokens it takes 59 of the 93 ms Janas-LLM spends on a token written, and the 32,000 tokens of prompt take 15 minutes to read. Janas-LLM's peak memory went from 2.6 GiB at 1,024 tokens to 4.9 at 32,000. The same conditions on both sides: keys and values at eight bits (llama.cpp's q8_0 cache, with its flash attention, which q8_0 values need). llama.cpp had not finished reading 16,384 tokens after 30 minutes, so its writing there was not measured, nor anything at 32,000. With its default sixteen-bit cache llama.cpp read faster (67, 55, 44 and 31 tok/s at 1,024 to 16,384 tokens) and wrote about as fast (12.5, 7.7, 4.6 and 2.2). How it was measured: [below](#how-the-figures-were-measured).
**New: Gemma 4 whole on the GPU, Llama 3, and `janas-nsm`.** Gemma 4's four models - 12B, the 26B mixture, E2B and E4B - now run every layer of a token on the GPU, with the GPU's norms and quantizations giving the CPU's bits: Gemma-4-12B agrees with llama.cpp at 367 of 400 most likely tokens on the GPU, at 362 on the CPU. Llama 3 models run too, a LoRA adapter merged into one by `tools/hf2gguf`: DeepNSM-1B (Llama-3.2-1B with the adapter of [arXiv 2505.11764](https://arxiv.org/abs/2505.11764)) writes its answers at 57.8 tok/s on the laptop's CPU, where llama.cpp writes 37.9 to 39.8 on the same file. `janas-nsm` asks it for a word's explication in the Natural Semantic Metalanguage - Goddard and Wierzbicka's sixty-odd semantic primes, the words every language has - and counts it as the paper does; it can also restrict the model's output to those words alone. A research tool, and a sign of how far this project means to go: [docs/tools.md](docs/tools.md#janas-nsm).
@@ -161,7 +161,7 @@ What Janas-LLM runs today, model by model and feature by feature: [docs/features
The table at the top, on 21 October 2026: `janas-bench --prompt 1024 --gen 16 --rounds 2 --no-mtp --settle 300`, which measures each configuration the engine may choose (6, 12 and 20 threads, with the GPU in the shorter passes or not, with the NPU or not), the best of each column taken, against llama.cpp (build `2b18470` of 18 September 2026) with its Vulkan backend on the same integrated GPU, everything on it (`llama-bench -p 1024 -n 16 -r 2 -t 12 -ngl 99`), on the same files the same day. The writing columns are without drafts on both sides. The two tools do not measure in quite the same way (`llama-bench` writes without a prompt before it, `janas-bench` after the 1,024 tokens), and it is one machine. The conditions are the same wherever the two engines allow it, and where they are not, it is said.
-The long contexts, on 26 October 2026: Janas-LLM through `tests/bench_long` (`JANAS_GPU=0`, 12 threads on CPUs 0-11, a 4 GiB expert cache), a prompt of n tokens read in blocks from position 0, then 64 written greedily one at a time; llama.cpp (build `2b18470`, CPU backend, `-t 12 -ngl 0`) with `llama-bench -p n -n 0` for reading and `-p 0 -n 64 -d n` for writing after n tokens; the same Qwen3-4B Q4_K_M file (Qwen's own GGUF), the same tokens (English Wikipedia articles, C sources and Italian prose, mixed), one run each, ten seconds apart, the machine otherwise idle.
+The long contexts, on 26 October 2026: Janas-LLM through `tests/bench_long` (`JANAS_GPU=0`, 12 threads on CPUs 0-11, a 4 GiB expert cache), a prompt of n tokens read in blocks from position 0, then 64 written greedily one at a time; llama.cpp (build `2b18470`, CPU backend, `-t 12 -ngl 0 -fa 1 -ctk q8_0 -ctv q8_0`; its defaults for the sixteen-bit figures) with `llama-bench -p n -n 0` for reading and `-p 0 -n 64 -d n` for writing after n tokens, each run stopped after 30 minutes; the same Qwen3-4B Q4_K_M file (Qwen's own GGUF), the same tokens (English Wikipedia articles, C sources and Italian prose, mixed), one run each, ten seconds apart, the machine otherwise idle.
Qwen3-Next-80B-A3B and Qwen3-Coder-Next are larger than the laptop's memory. llama.cpp with its usual build ran out of memory as soon as the GPU took part, even with the experts left on the CPU (`-ngl 99 -ncmoe 48`): its CPU backend copies the weights into memory of its own to repack them, and the Vulkan backend copies those it leaves to the CPU into buffers the system cannot reclaim. It ran with a build without repacking (`GGML_CPU_REPACK=OFF`) and `--no-host 1 -lm mmap`, which leave the experts in the file, read through the page cache: 17.7 tok/s reading with the GPU, 3.0 writing on the CPU alone (1.8 with the GPU; its CPU backend read at 12.6). Janas-LLM ran them with no option of its own, the experts it uses most in a cache of 21 GiB and the rest read from the disk.
diff --git a/dist/README-windows.md b/dist/README-windows.md
index 534c6ab..347bbf0 100644
--- a/dist/README-windows.md
+++ b/dist/README-windows.md
@@ -24,17 +24,17 @@
Janas-LLM's figures are the best of the configurations `janas-bench` measures without the NPU, the GPU reading a prompt's blocks; llama.cpp ran with its Vulkan backend on the same GPU, the API Janas-LLM uses (on the two models larger than the memory it wrote with its CPU backend, faster there); the conditions are the same wherever the two engines allow it, and the main README says where they are not. † llama.cpp's figures of 11 October. On another machine the figures will be other ones: `janas-bench` measures yours (below). How they were taken, and everything else: <https://github.com/prabanta-dev/janas>.
-**Long contexts: at 16,384 tokens Janas-LLM writes a reply at 15.0 tok/s, where llama.cpp manages 2.2, and reads the prompt at 56 tok/s, against 31.** Qwen3-4B Q4_K_M on the same laptop (measured on Linux), the CPU alone on both sides (12 threads), the same file, 26 October 2026; a prompt read from the start, then 64 tokens written after it:
+**Long contexts: at 8,192 tokens Janas-LLM writes a reply at 18.2 tok/s, where llama.cpp manages 4.9, and reads the prompt at 74 tok/s, against 20 - both keeping keys and values at eight bits.** Qwen3-4B Q4_K_M on the same laptop (measured on Linux), the CPU alone on both sides (12 threads), the same file, 26-27 October 2026; a prompt read from the start, then 64 tokens written after it:
| Context | reading the prompt: Janas-LLM | llama.cpp | writing after it: Janas-LLM | llama.cpp |
|---|---|---|---|---|
-| 1,024 tokens | 118 tok/s | 67 | 27.6 tok/s | 12.5 |
-| 4,096 | 96 | 55 | 22.0 | 7.7 |
-| 8,192 | 74 | 44 | 18.2 | 4.6 |
-| 16,384 | 56 | 31 | 15.0 | 2.2 |
+| 1,024 tokens | 118 tok/s | 54 | 27.6 tok/s | 12.1 |
+| 4,096 | 96 | 32 | 22.0 | 7.5 |
+| 8,192 | 74 | 20 | 18.2 | 4.9 |
+| 16,384 | 56 | under 9.1 | 15.0 | - |
| 32,000 | 35 | - | 10.7 | - |
-The longer the context, the wider the gap: 2.2 times as fast writing at 1,024 tokens, 6.9 times at 16,384. Both slow down as the context grows, and on both the attention is what grows: at 32,000 tokens it takes 59 of the 93 ms Janas-LLM spends on a token written, and the 32,000 tokens of prompt take 15 minutes to read. Janas-LLM's peak memory went from 2.6 GiB at 1,024 tokens to 4.9 at 32,000. The conditions are the same wherever possible; where not: Janas-LLM keeps the keys and values at eight bits, llama.cpp at sixteen (its default); llama.cpp was not run at 32,000 tokens (almost another hour). How it was measured: [the README on GitHub](https://github.com/prabanta-dev/janas#how-the-figures-were-measured).
+The longer the context, the wider the gap: 2.3 times as fast writing at 1,024 tokens, 3.7 times at 8,192. Both slow down as the context grows, and on both the attention is what grows: at 32,000 tokens it takes 59 of the 93 ms Janas-LLM spends on a token written, and the 32,000 tokens of prompt take 15 minutes to read. Janas-LLM's peak memory went from 2.6 GiB at 1,024 tokens to 4.9 at 32,000. The same conditions on both sides: keys and values at eight bits (llama.cpp's q8_0 cache, with its flash attention, which q8_0 values need). llama.cpp had not finished reading 16,384 tokens after 30 minutes, so its writing there was not measured, nor anything at 32,000. With its default sixteen-bit cache llama.cpp read faster (67, 55, 44 and 31 tok/s at 1,024 to 16,384 tokens) and wrote about as fast (12.5, 7.7, 4.6 and 2.2). How it was measured: [the README on GitHub](https://github.com/prabanta-dev/janas#how-the-figures-were-measured).
**New: Gemma 4 whole on the GPU, Llama 3, and `janas-nsm`.** Gemma 4's four models - 12B, the 26B mixture, E2B and E4B - now run every layer of a token on the GPU, with the GPU's norms and quantizations giving the CPU's bits: Gemma-4-12B agrees with llama.cpp at 367 of 400 most likely tokens on the GPU, at 362 on the CPU. Llama 3 models run too, a LoRA adapter merged into one by `tools/hf2gguf`: DeepNSM-1B (Llama-3.2-1B with the adapter of [arXiv 2505.11764](https://arxiv.org/abs/2505.11764)) writes its answers at 57.8 tok/s on the laptop's CPU, where llama.cpp writes 37.9 to 39.8 on the same file. `janas-nsm` asks it for a word's explication in the Natural Semantic Metalanguage - Goddard and Wierzbicka's sixty-odd semantic primes, the words every language has - and counts it as the paper does; it can also restrict the model's output to those words alone. A research tool, and a sign of how far this project means to go: [docs/tools.md](https://github.com/prabanta-dev/janas/blob/main/docs/tools.md#janas-nsm).
diff --git a/dist/README.md b/dist/README.md
index 24cf463..6358bdb 100644
--- a/dist/README.md
+++ b/dist/README.md
@@ -24,17 +24,17 @@
Janas-LLM's figures are the best of the configurations `janas-bench` measures: the GPU reading a prompt's blocks, or on the smaller dense models (Qwen3-4B and smaller, Gemma-4-E2B and E4B) the NPU; llama.cpp ran with its Vulkan backend on the same GPU, the API Janas-LLM uses (on the two models larger than the memory it wrote with its CPU backend, faster there); the conditions are the same wherever the two engines allow it, and the main README says where they are not. † llama.cpp's figures of 11 October. On another machine the figures will be other ones: `janas-bench` measures yours (below). How they were taken, and everything else: <https://github.com/prabanta-dev/janas>.
-**Long contexts: at 16,384 tokens Janas-LLM writes a reply at 15.0 tok/s, where llama.cpp manages 2.2, and reads the prompt at 56 tok/s, against 31.** Qwen3-4B Q4_K_M on the same laptop, the CPU alone on both sides (12 threads), the same file, 26 October 2026; a prompt read from the start, then 64 tokens written after it:
+**Long contexts: at 8,192 tokens Janas-LLM writes a reply at 18.2 tok/s, where llama.cpp manages 4.9, and reads the prompt at 74 tok/s, against 20 - both keeping keys and values at eight bits.** Qwen3-4B Q4_K_M on the same laptop, the CPU alone on both sides (12 threads), the same file, 26-27 October 2026; a prompt read from the start, then 64 tokens written after it:
| Context | reading the prompt: Janas-LLM | llama.cpp | writing after it: Janas-LLM | llama.cpp |
|---|---|---|---|---|
-| 1,024 tokens | 118 tok/s | 67 | 27.6 tok/s | 12.5 |
-| 4,096 | 96 | 55 | 22.0 | 7.7 |
-| 8,192 | 74 | 44 | 18.2 | 4.6 |
-| 16,384 | 56 | 31 | 15.0 | 2.2 |
+| 1,024 tokens | 118 tok/s | 54 | 27.6 tok/s | 12.1 |
+| 4,096 | 96 | 32 | 22.0 | 7.5 |
+| 8,192 | 74 | 20 | 18.2 | 4.9 |
+| 16,384 | 56 | under 9.1 | 15.0 | - |
| 32,000 | 35 | - | 10.7 | - |
-The longer the context, the wider the gap: 2.2 times as fast writing at 1,024 tokens, 6.9 times at 16,384. Both slow down as the context grows, and on both the attention is what grows: at 32,000 tokens it takes 59 of the 93 ms Janas-LLM spends on a token written, and the 32,000 tokens of prompt take 15 minutes to read. Janas-LLM's peak memory went from 2.6 GiB at 1,024 tokens to 4.9 at 32,000. The conditions are the same wherever possible; where not: Janas-LLM keeps the keys and values at eight bits, llama.cpp at sixteen (its default); llama.cpp was not run at 32,000 tokens (almost another hour). How it was measured: [the README on GitHub](https://github.com/prabanta-dev/janas#how-the-figures-were-measured).
+The longer the context, the wider the gap: 2.3 times as fast writing at 1,024 tokens, 3.7 times at 8,192. Both slow down as the context grows, and on both the attention is what grows: at 32,000 tokens it takes 59 of the 93 ms Janas-LLM spends on a token written, and the 32,000 tokens of prompt take 15 minutes to read. Janas-LLM's peak memory went from 2.6 GiB at 1,024 tokens to 4.9 at 32,000. The same conditions on both sides: keys and values at eight bits (llama.cpp's q8_0 cache, with its flash attention, which q8_0 values need). llama.cpp had not finished reading 16,384 tokens after 30 minutes, so its writing there was not measured, nor anything at 32,000. With its default sixteen-bit cache llama.cpp read faster (67, 55, 44 and 31 tok/s at 1,024 to 16,384 tokens) and wrote about as fast (12.5, 7.7, 4.6 and 2.2). How it was measured: [the README on GitHub](https://github.com/prabanta-dev/janas#how-the-figures-were-measured).
**New: Gemma 4 whole on the GPU, Llama 3, and `janas-nsm`.** Gemma 4's four models - 12B, the 26B mixture, E2B and E4B - now run every layer of a token on the GPU, with the GPU's norms and quantizations giving the CPU's bits: Gemma-4-12B agrees with llama.cpp at 367 of 400 most likely tokens on the GPU, at 362 on the CPU. Llama 3 models run too, a LoRA adapter merged into one by `tools/hf2gguf`: DeepNSM-1B (Llama-3.2-1B with the adapter of [arXiv 2505.11764](https://arxiv.org/abs/2505.11764)) writes its answers at 57.8 tok/s on the laptop's CPU, where llama.cpp writes 37.9 to 39.8 on the same file. `janas-nsm` asks it for a word's explication in the Natural Semantic Metalanguage - Goddard and Wierzbicka's sixty-odd semantic primes, the words every language has - and counts it as the paper does; it can also restrict the model's output to those words alone. A research tool, and a sign of how far this project means to go: [docs/tools.md](https://github.com/prabanta-dev/janas/blob/main/docs/tools.md#janas-nsm).