Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**English** · [简体中文](README.zh-CN.md) · [日本語](README.ja.md) · [Deutsch](README.de.md) · [Français](README.fr.md) · [Español](README.es.md) · [Português](README.pt-BR.md) · [Türkçe](README.tr.md)

<p align="center"><b>Run large AI models on your own PC</b><br>
Qwen3.8-Flash-Next, Hy4-Flash, GLM 5.3 Flash, DeepSeek V4 Flash, LFM2.5, Flint, Qwen3.6, Clover, Ornith 1.5, Gemma 4, Tiel Coder, MiniCPM-V and Kolibri 1 · free and open source</p>
Qwen3.8-Flash-Next, Hy4-Flash, GLM 5.3 Flash, DeepSeek V4 Flash, LFM2.5, Flint, Qwen3.6, Clover, Ornith 1.5, Gemma 4, Tiel Coder, MiniCPM-V, Kolibri 1 and Ling 3.0 Flash · free and open source</p>

<p align="center"><a href="https://github.com/simplexai-labs/linger"><img height="28" alt="Used by Linger" src="docs/media/used-by-linger.svg"></a></p>

Expand Down Expand Up @@ -52,6 +52,8 @@ with an 8 GB card as well, and Groot on a PC with an 8 GB RTX 5060.
own, made to read pictures: a file of 16 to 29 GB.
- **[Kolibri 1](docs/models/kolibri.md)** by Aleph Alpha, which writes German as well as English: a file of 29 to 48 GB,
most of which stays in RAM beside a small card.
- **[Ling 3.0 Flash](docs/models/ling3.md)** by inclusionAI (124B, 5.1B active): a file of 43 to 78 GB, most of which
stays in RAM. Every sixth layer keeps a compressed attention cache, so a 128K context takes 0.9 GB more VRAM than 32K.
- **[Hy4-Flash](https://github.com/Niko1221/Strata/releases/tag/v0.2.18)** by Tencent, 220B-A12B, on the Strata project's own engine (`strata-hy4`): a file of 130 to
181 GB, from 64 GB of RAM with an 8 GB card. It also reads pictures.

Expand Down Expand Up @@ -170,6 +172,7 @@ How it works and how it was measured: [docs/BACKENDS.md](docs/BACKENDS.md#less-o
| [Tiel Coder 35B-A3B](docs/models/tiel.md) | same as above; AMD as a beta | about 21 GB beside an 8 GB card | 14 to 23 GB | Windows, Linux |
| [MiniCPM-V 4.7 35B-A3B](docs/models/minicpmv.md) | same as above; AMD as a beta | about 25 GB beside an 8 GB card | 16 to 29 GB | Windows, Linux |
| [Kolibri 1](docs/models/kolibri.md) | NVIDIA RTX 20 series or newer, 8 GB or more | about 33 GB beside an 8 GB card | 29 to 48 GB | Windows, Linux |
| [Ling 3.0 Flash](docs/models/ling3.md) | NVIDIA RTX 20 series or newer; run on a 16 GB card | about 72 GB beside a 16 GB card | 43 to 78 GB, on an SSD | Linux |
| [Groot 19B-A3B 261023](docs/models/groot.md) (experimental) | shared CUDA/HIP backends; Q4_K_M text run on an 8 GB RTX 5060 (measured peak 7.05 GiB VRAM, 21.8 GiB RAM) | about 17 GB beside an 8 GB card for Q4_K_M, setup's fit estimate | 12.5 to 20.2 GB; images add 0.9 GB | Windows, Linux; images, Q6_K and Q8_0 untested |
| [Inkling 2 Mini](docs/models/inkling.md) (experimental) | NVIDIA, 8 GB or more; it has run on an RTX 5090 and on an RTX 4070 Laptop (8 GB, UD-Q3_K_XL) | about 21 GB beside an 8 GB card for UD-Q4_K_XL, setup's estimate | 9 to 18 GB | Windows, Linux, Mac (beta) |
| [Hy4-Flash](https://github.com/Niko1221/Strata/releases/tag/v0.2.18) (the Strata project's engine) | NVIDIA V100 to RTX 50, 8 GB or more; AMD RX 6000 to 9000 and Strix Halo; Intel Arc | 64 GB or more for SQ-64, 96 GB for SQ-96, 128 GB for SQ-128 | 130 to 181 GB, on an SSD | Windows, Linux, Mac |
Expand Down
21 changes: 20 additions & 1 deletion docs/BACKENDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ a second machine, a Windows laptop whose card has 8 GB.
| Flint 40B-A2.5B | `flint` | `strata-poly` | Unsloth UD-Q4_K_XL, UD-Q3_K_XL, UD-Q6_K_XL and Q8_0, 18.5 to 42.3 GB | repeats only: there is no draft model |
| Kolibri 1 | `kolibri1` | `strata-poly` | Hob-forge Q4_K_M, Q2_K and Q3_K_M, 28.6 to 47.5 GB | repeats only: there is no draft model |
| Clover-35B-A3B-Preview | `clover_moe` | `strata-poly` | maternion Q3_K_M and Q4_K_M, IsValorum APEX-I-NanoPlus, 12.6 to 21.2 GB | repeats only: its own block guesses are off ([below](#clover-35b-a3b-preview)) |
| Ling 3.0 Flash and Tiny | `bailingmoe3` | `strata-poly` | bloomer010 Q4_K_M (Flash, 78.3 GB), inclusionAI Q4_K_M (Tiny, 4.8 GB) | Flash: draft block in the file, off in setup's configs ([models/ling3.md](models/ling3.md)); Tiny: repeats only |
| Inkling 2 Mini (experimental) | `inkling2_loop` | `strata-poly` | Unsloth UD-Q4_K_XL, UD-Q3_K_XL and UD-Q2_K_XL, 9.1 to 17.6 GB | none: it answers one token at a time ([below](#inkling-2-mini-one-card)) |

`strata` is the first engine and runs Qwen3.8 only; nothing in it changed. `strata-poly` is the engine that reads a
GGUF in place, and it now has nine architectures. It was called `strata-glm`, after its first model; an install
GGUF in place, and it now has ten architectures. It was called `strata-glm`, after its first model; an install
from then keeps its engine and moves to the new name the next time setup updates it.

The CUDA [GDN prefill adapter](DETAILS.md#strata-poly-chunked-gdn-prefill) reads eligible Qwen35 prompts on the
Expand Down Expand Up @@ -1117,6 +1118,11 @@ token ids compared and the probabilities of the reference's five likeliest token
| Ornith 1.5 APEX-I-Quality | 61 of 61, 7, 21, 22, 34 | 0.16 |
| Gemma 4 26B-A4B UD-Q2_K_XL | 64, 53, 22, 50, 33 | 0.09 |
| Gemma 4 26B-A4B UD-Q4_K_M | 64, 26, 52, 25, 64 | 0.15 |
| Ling 3.0 Flash Q4_K_M | 9, 18, 0, 33, 3 | 0.28 |
| Ling 3.0 Flash Q4_K_M, draft block on | 17, 51, 0, 33, 64 | 0.26 |
| Ling 3.0 Flash Q4_K_M, every expert on the CPU | 17, 64, 14, 33, 64 | 0.21 |
| Ling 3.0 Tiny Q4_K_M | 14, 64, 64, 55, 14 | 0.19 |
| Ling 3.0 Tiny Q4_K_M, every expert on the CPU | 14, 10, 64, 10, 64 | 0.11 |

The first three rows are the sizes setup takes first, UD-Q3_K_M and APEX-I-Compact. With the build of
2026-10-10 they were 64, 64, 40, 29 and 64 within 0.12, 60 of 60, 7, 56, 2 and 64 within 0.29, and five times
Expand All @@ -1127,6 +1133,19 @@ states after a read and after the same calls one by one are equal byte for byte,
tokens and with the whole model on the card after 30,000. Their answers to pictures are in the table further
down.

The five Ling rows were compared on one Linux PC (RTX 4080 SUPER and RTX 3080, Flash on a layer split, Tiny on the
4080 SUPER alone), against llama.cpp built from PR #32517 at 0a054d0, with five chat prompts of 35 to 8,036
tokens. llama.cpp gives a token that ends inside a character no probabilities of its own: they come with the next
token's, so the comparison matches its steps to the tokens by id. Eight of Flash's 12 departures and all six of
Tiny's are at a near tie as above. The other four are Flash's: its fourth prompt (4,034 tokens) at the 34th token in
all three rows (llama.cpp 0.57 and 0.43 for its two likeliest, this engine 0.60 to 0.69 for the second), and its
fifth (8,036 tokens) at the 4th without the draft block (llama.cpp 0.42 and 0.27, this engine 0.54 for a third
token). As a control, llama.cpp against itself with 512-token batches instead of 4,096 left its own tokens at the 3rd
to 18th token of four prompts, the fifth at that same 4th token, by up to 0.09, and wrote the fourth prompt's 64 the
same. A prompt read in one call and in two (4,096 tokens reused from the conversation cache, then 10,563 read) gave
the same 64 tokens with every expert on the CPU; with experts in VRAM the two runs held different experts there, and
their answers parted after a dozen words.

Two correct implementations do not write the same tokens for long. Activations are quantized to 8 bits at every
quantized matrix, in a layout that depends on the kernel, so the two differ in the last bits and a near tie
between two tokens goes either way. Ornith's file has 3-bit experts and 4-bit attention and is the most sensitive:
Expand Down
76 changes: 76 additions & 0 deletions docs/models/ling3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Ling 3.0 Flash

Back to [README.md](../../README.md)

**Ling 3.0 Flash** by inclusionAI: 124B parameters, 5.1B of them active a token, llama.cpp's architecture
`bailingmoe3`, read from bloomer010's GGUF files. A file of 43 to 78 GB, most of which stays in RAM. Seven of its 42
layers keep an attention cache, and that cache is compressed (a 512-value latent and 64 rotary values a token), so
a 128K context takes 0.9 GB more VRAM than 32K. The others are KDA layers, GLM 5.3 Flash's gated delta rule, with a
state of fixed size. Its license is MIT.

It is new here and experimental. It has run on one Linux PC only: an RTX 4080 SUPER (16 GB) and an RTX 3080 (10 GB),
a Ryzen 7 5800X3D and 62 GB of DDR4. Not on Windows, AMD or a Mac.

## The sizes

| Size | From | Download | Experts | RAM beside a 16 GB card (setup's estimate) |
| --- | --- | ---: | ---: | ---: |
| **Q4_K_M** | [bloomer010](https://huggingface.co/bloomer010/Ling-3.0-flash-GGUF): 4-bit experts, 6- and 8-bit where they write | 78.3 GB | 75.8 GB | about 72 GB |
| **Q3_K_M** | bloomer010: 3- and 4-bit experts | 62.6 GB | 60.5 GB | about 57 GB |
| **UD-Q2_K_XL** | bloomer010: 2- and 3-bit i-quant experts | 43.4 GB | 40.5 GB | about 37 GB |

Only Q4_K_M has been run; the other two are the same model at less RAM. UD-Q2_K_XL's experts are i-quants, whose
CPU kernels are slower per weight than the K-quants' (a token's experts the card does not hold are computed on the
CPU). Setup takes the first size whose estimate the PC meets: on the PC above (62 GB) that is Q3_K_M, and Q4_K_M,
named with `--model Q4_K_M`, ran there with part of its file read from the SSD. Every file is pinned to the
repository's commit of 2026-11-17 and checked against its SHA-256.

The file carries a draft block (`blk.42.nextn`). Setup's configs leave it out (`--no-draft`): on this PC it made
answers no faster and writing deep in a long context slower, 14.9 against 20.0 tokens/s after an 88K prompt.

## How fast is it?

### One card: the RTX 4080 SUPER (16 GB)

PolyStrata's own benchmark, `polystrata.py benchmark --prompt-tokens 24000` (a short chat, then a prompt built from
this repository's documents, 256 tokens written after each), Q4_K_M, a 32K context, `--no-draft`, three runs; each
starts the server, so the short chat is the first answer it writes.

| Run | Writes a short chat | Reads the prompt (32,318 to 32,368 tokens) | Writes after it | Experts in VRAM |
| --- | ---: | ---: | ---: | ---: |
| 1 (`--vram-reserve-mib 1100`) | 11.9 tokens/s | 948 tokens/s | 6.6 tokens/s | 2,691 of 20,480 |
| 2 (`--vram-reserve-mib 1900`) | 11.6 tokens/s | 835 tokens/s | 11.8 tokens/s | 2,517 |
| 3 (`--vram-reserve-mib 1900`) | 8.6 tokens/s | 1,048 tokens/s | 13.0 tokens/s | 2,517 |

The card drives the display. During the long prompt the staging buffer took VRAM past `--vram-reserve-mib`: the card
had 0.2 GB free with a reserve of 1,100 MiB and 0.8 GB with 1,900.

### Two cards: RTX 4080 SUPER + RTX 3080, a layer split

A 128K context, `--prompt-batch 512 --no-draft`, every other setting the engine's default; 4,030 of 20,480 experts in
VRAM. Each answer is 500 tokens with thinking off; "new prompts" are two the server had not seen, asked after it had
answered two others twice (a prompt asked again is written faster, from experts the cache has just taken for it).
The long prompt is 88,621 tokens of this repository's documents with one planted sentence, 200 tokens written after
it. llama.cpp (PR #32517 at 0a054d0, `--fit`, 4,096-token batches) on the same PC and file for comparison:

| | Writes new prompts | Reads the long prompt | Writes after it | Found the sentence |
| --- | ---: | ---: | ---: | --- |
| PolyStrata | 30.9 (code), 35.5 (prose) tokens/s | 733 tokens/s | 20.0 tokens/s | yes |
| llama.cpp, no draft | 22.7 tokens/s (three prompts) | 463 tokens/s | 22.4 tokens/s | yes |
| llama.cpp, its draft block 2 ahead | 24.8 tokens/s | | | |

`--prompt-batch 512` leaves room for experts on a layer split; with `--prompt-batch 2048` (and the draft block on)
the long prompt was read at 812 tokens/s, but 3,134 experts were in VRAM and writing after it fell to 11.0. Changing `--stage-mib` from its
default turns off the staging buffer's growth for a long read (`--stage-read-mib`), and the long prompt was then read
at 110 tokens/s.

## Ling 3.0 Tiny

The same engine runs Ling 3.0 Tiny (24 layers, 128 experts, a low-rank query; [inclusionAI's Q4_K_M](https://huggingface.co/inclusionAI/Ling-3.0-tiny-GGUF),
4.8 GB), with `strata-poly --model Ling-3.0-tiny-Q4_K_M.gguf` or a run config written by hand. Setup does not offer it: its
experts (3.9 GiB) fit in most cards' VRAM, where llama.cpp does as well. On the 4080 SUPER it wrote 246 tokens/s.

## How it was checked

Against llama.cpp on the same files, five chat prompts of 35 to 8,036 tokens, 64 tokens each: see
[BACKENDS.md](../BACKENDS.md#how-each-backend-was-checked).
10 changes: 5 additions & 5 deletions engine/cmake/strata_poly.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ if(STRATA_BUILD_POLY AND STRATA_NATIVE_EXPERTS AND (STRATA_ENABLE_CUDA OR STRATA
add_test(NAME poly_gdn_mma_test COMMAND poly_gdn_mma_test)
set_tests_properties(poly_gdn_mma_test PROPERTIES SKIP_RETURN_CODE 77)
# Optional model/state check; run by hand with an MTP GGUF and frozen prompt IDs.
add_executable(poly_gdn_mma_state_test src/poly/gdn_mma_state_test.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp
add_executable(poly_gdn_mma_state_test src/poly/gdn_mma_state_test.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp src/poly/ling3.cpp
src/poly/qwen35.cpp src/poly/gemma4.cpp src/poly/deepseek4.cpp src/poly/lfm2moe.cpp
src/poly/flint.cpp src/poly/kolibri1.cpp src/poly/laguna.cpp src/poly/inkling2.cpp src/poly/inkling2_pictures.cpp src/poly/inkling2.cu src/poly/cpu_experts.cpp src/poly/kernels.cu
src/poly/kernels_dsv4.cu src/core/conversation_memory.cpp)
Expand All @@ -202,7 +202,7 @@ if(STRATA_BUILD_POLY AND STRATA_NATIVE_EXPERTS AND (STRATA_ENABLE_CUDA OR STRATA
${_strata_gpu_blas_target} ${_strata_gpu_runtime_target} CUDA::cuda_driver Threads::Threads)
endif()

add_executable(strata-poly src/poly/main.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp src/poly/qwen35.cpp
add_executable(strata-poly src/poly/main.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp src/poly/ling3.cpp src/poly/qwen35.cpp
src/poly/gemma4.cpp src/poly/deepseek4.cpp src/poly/lfm2moe.cpp src/poly/flint.cpp
src/poly/kolibri1.cpp src/poly/laguna.cpp src/poly/inkling2.cpp src/poly/inkling2_pictures.cpp src/poly/inkling2.cu src/poly/cpu_experts.cpp src/poly/kernels.cu src/poly/kernels_dsv4.cu
src/poly/spill.cpp src/core/conversation_memory.cpp src/core/conversation_file.cpp)
Expand All @@ -227,7 +227,7 @@ if(STRATA_BUILD_POLY AND STRATA_NATIVE_EXPERTS AND (STRATA_ENABLE_CUDA OR STRATA
Threads::Threads)
# a read with the draft block repeats bit for bit; needs the model file, so it is run by hand:
# poly_draft_race_test MODEL.gguf [RUNS] [LAYER_SPLIT]
add_executable(poly_draft_race_test src/poly/draft_race_test.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp
add_executable(poly_draft_race_test src/poly/draft_race_test.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp src/poly/ling3.cpp
src/poly/qwen35.cpp src/poly/gemma4.cpp src/poly/deepseek4.cpp
src/poly/lfm2moe.cpp src/poly/flint.cpp src/poly/kolibri1.cpp src/poly/laguna.cpp src/poly/inkling2.cpp src/poly/inkling2_pictures.cpp src/poly/inkling2.cu
src/poly/cpu_experts.cpp src/poly/kernels.cu src/poly/kernels_dsv4.cu
Expand All @@ -239,7 +239,7 @@ if(STRATA_BUILD_POLY AND STRATA_NATIVE_EXPERTS AND (STRATA_ENABLE_CUDA OR STRATA
${_strata_poly_driver} Threads::Threads)
# a layer split's greedy tokens, picked on the card and from the logits, against one card's; needs the model file,
# so it is run by hand: poly_layer_split_picks_test MODEL.gguf [LAYER_SPLIT] [TOKENS]
add_executable(poly_layer_split_picks_test src/poly/layer_split_picks_test.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp
add_executable(poly_layer_split_picks_test src/poly/layer_split_picks_test.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp src/poly/ling3.cpp
src/poly/qwen35.cpp src/poly/gemma4.cpp src/poly/deepseek4.cpp
src/poly/lfm2moe.cpp src/poly/flint.cpp src/poly/kolibri1.cpp src/poly/laguna.cpp src/poly/inkling2.cpp src/poly/inkling2_pictures.cpp src/poly/inkling2.cu
src/poly/cpu_experts.cpp src/poly/kernels.cu src/poly/kernels_dsv4.cu
Expand All @@ -251,7 +251,7 @@ if(STRATA_BUILD_POLY AND STRATA_NATIVE_EXPERTS AND (STRATA_ENABLE_CUDA OR STRATA
${_strata_poly_driver} Threads::Threads)
# the engine's logits for a list of tokens as raw floats, to compare two builds or settings; needs the model file,
# so it is run by hand: poly_logits_dump MODEL.gguf --tokens ID,ID,... (its usage says the rest)
add_executable(poly_logits_dump src/poly/logits_dump.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp
add_executable(poly_logits_dump src/poly/logits_dump.cpp src/poly/engine.cpp src/poly/expert_card.cpp src/poly/glm5next.cpp src/poly/ling3.cpp
src/poly/qwen35.cpp src/poly/gemma4.cpp src/poly/deepseek4.cpp
src/poly/lfm2moe.cpp src/poly/flint.cpp src/poly/kolibri1.cpp src/poly/laguna.cpp src/poly/inkling2.cpp src/poly/inkling2_pictures.cpp src/poly/inkling2.cu
src/poly/cpu_experts.cpp src/poly/kernels.cu src/poly/kernels_dsv4.cu
Expand Down
2 changes: 1 addition & 1 deletion engine/metal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ if(STRATA_METAL_POLY)
STRATA_POLY_INKLING_FLASH_SOURCE="${CMAKE_CURRENT_SOURCE_DIR}/src/poly/inkling_flash.metal")
target_link_libraries(strata_poly_metal_kernels PUBLIC strata_quant)
add_executable(strata-poly ${S}/poly/main.cpp ${S}/poly/engine.cpp ${S}/poly/qwen35.cpp
${S}/poly/gemma4.cpp ${S}/poly/lfm2moe.cpp ${S}/poly/glm5next.cpp ${S}/poly/deepseek4.cpp ${S}/poly/flint.cpp
${S}/poly/gemma4.cpp ${S}/poly/lfm2moe.cpp ${S}/poly/glm5next.cpp ${S}/poly/ling3.cpp ${S}/poly/deepseek4.cpp ${S}/poly/flint.cpp
${S}/poly/kolibri1.cpp ${S}/poly/inkling2.cpp ${S}/poly/inkling2_pictures.cpp ${S}/poly/cpu_experts.cpp ${S}/poly/spill.cpp ${S}/platform/memory.cpp
${S}/core/conversation_memory.cpp ${S}/core/conversation_file.cpp ${S}/spec/draft_policy.cpp
${S}/spec/suffix_drafter.cpp)
Expand Down
2 changes: 2 additions & 0 deletions engine/src/poly/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "deepseek4.hpp"
#include "gemma4.hpp"
#include "glm5next.hpp"
#include "ling3.hpp"
#include "kolibri1.hpp"
#include "lfm2moe.hpp"
#include "flint.hpp"
Expand Down Expand Up @@ -2045,6 +2046,7 @@ std::unique_ptr<Engine> Engine::open(const Options& o) {
throw std::runtime_error("--attn-requant takes q4_0, q5_0 or iq4_nl");
const auto make = [&]() -> std::unique_ptr<Engine> {
if (name == "glm5-next" || name == "glm5next") return std::make_unique<Glm5Next>(); // Unsloth: no hyphen
if (name == "bailingmoe3") return std::make_unique<Ling3>();
if (qwen35) return std::make_unique<Qwen35>();
if (name == "gemma4") return std::make_unique<Gemma4>();
if (name == "deepseek4") return std::make_unique<DeepSeek4>();
Expand Down
Loading
Loading