Can an RTX 4090 run GLM 4.7 Flash?
Yes
Yes. At Q5_K_M it needs 21.82 GB of the 23.2 GB available and generates around 291.3 tokens per second at an 8k context window.
The numbers
GLM 4.7 Flash has 31.22 billion parameters across 47 layers, of which 3.66 billion are read for each token. The GeForce RTX 4090 has 24 GB of VRAM at 1008 GB/s, of which about 23.2 GB is left for a model once the operating system has taken its share.
| Quantisation | Total needed | Fits | Speed |
|---|---|---|---|
| Q8_0 | 32.03 GB | no | — |
| Q6_K | 24.98 GB | no | — |
| Q5_K_M | 21.82 GB | yes | 291.3 t/s |
| Q4_K_M | 18.69 GB | yes | 334.5 t/s |
| IQ4_XS | 16.59 GB | yes | 371.7 t/s |
| Q3_K_M | 15.35 GB | yes | 397.6 t/s |
| IQ3_XXS degraded | 12.26 GB | yes | 481.4 t/s |
| Q2_K degraded | 13.31 GB | yes | 449.1 t/s |
| IQ2_XXS degraded | 8.63 GB | yes | 640.3 t/s |
7 of the 9 levels fit. Levels marked degraded are listed for completeness, not as advice.
How long a conversation it holds
At Q5_K_M, memory rises with the length of the conversation because the attention cache keeps a key and value for every token. The longest window that still fits on this device is 16k tokens.
| Context | Cache | Total | Fits |
|---|---|---|---|
| 4k | 0.21 GB | 21.55 GB | yes |
| 8k | 0.41 GB | 21.82 GB | yes |
| 16k | 0.83 GB | 22.36 GB | yes |
| 32k | 1.65 GB | 23.43 GB | no |
| 64k | 3.3 GB | 25.59 GB | no |
| 128k | 6.61 GB | 29.89 GB | no |
See how fast it feels
GeForce RTX 4090 running GLM 4.7 Flash at Q5_K_M
YouWhy does my model use more memory when the conversation gets longer?
Because of the KV cache. Every token you send leaves behind a key and a value vector in each layer of the model, and those stay in memory for as long as the conversation lasts.
The weights are a fixed cost: load a 4-bit 8B model and that is about 4.8 GB, whether you write one word or ten thousand. The cache is the part that grows, and it grows in a straight line with the number of tokens in the window.
How steeply depends on the model's attention design. With grouped-query attention, several query heads share one key-value pair, which cuts the cache by that ratio. Without it, every head keeps its own, and a long context can cost more memory than the weights themselves.
If you are short on memory, the first thing to try is lowering the context window in your runtime, not the quantisation.
Reading your question
Simulated from our estimate at a 512-token question, not a recording. Assumes nothing else is competing for the GPU.
Keep going
Everything the GeForce RTX 4090 runs, the full breakdown for GLM 4.7 Flash, or check a different pairing in the calculator.