---
id: 18946
lang: en
title: "Running a 35B model on an 8 GB VRAM laptop: prompt processing at 365 tokens/s"
published_at: "2026-12-02 10:27:05"
source_name: "Habr AI"
source_url: "https://habr.com/ru/articles/1114918/?utm_campaign=1114918&utm_source=habrahabr&utm_medium=rss"
canonical_url: "https://news.hamidun.com/en/news/18946"
categories: ["research", "autonomous"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# Running a 35B model on an 8 GB VRAM laptop: prompt processing at 365 tokens/s

> **Краткая суть (BLUF):** The author ran a 35-billion-parameter model on a laptop with an 8 GB GPU. Only about 3 billion parameters are active per token, while the remaining experts sit in regular system RAM. The model reads the agent's prompt at 365 tokens per second (prefill). But at the default temperature, the agent called a tool in 80% of cases, and with --temp 0 it did so in 10 out of 10. For agents, set the temperature to zero: a five-step chain that succeeds 80% of the time per step completes only about a third of the time.  - -np auto drops prompt processing from 365 to 70 tokens/s without any error - The Q3_K file weighs 17.2 GB: MoE gives a speed advantage in prompt processing, not a smaller size - You can trust the structure of the answers, but not the function names or links

Many people want to run a large model at home, but they hit a wall with video memory: a laptop has 8 GB of it, and a 35-billion-parameter model weighs 17.2 GB even in compressed form. Still, the author of the Habr write-up built a local agent that can use tools on this hardware, without paying for the cloud. The key number is 365 tokens per second in prefill. Prefill is the stage where the model "reads" the input text before it answers. The agent's prompt, including the tool schemas, is about 22,800 tokens, so at this speed it is processed in roughly a minute. At 70 tokens/s, the same prompt takes more than five minutes.

## Why the author moved away from the cloud

The task was practical: a local agent with working tool calling, without refusals and without monthly payments. The criterion was not whether the model agreed to answer, but whether the answer was usable: it has structure, verifiable sources, and reproducible examples.

The first request through the Hugging Face Router returned HTTP 402. A free account has no credits, and topping up requires a card issued outside Russia. A PRO subscription gives $2 in credits per month, enough for a dozen tests but not for real work. Renting an A100 costs $2.50 per hour, which is too expensive for an experiment. Mirrors such as ModelScope did not help either: they offer a closed catalog of several dozen models, and you cannot upload your own.

The hardware is an RTX 3070 Ti Laptop (8 GB, about 7 GB free), 32 GB of RAM, and a CPU with 14 physical cores. The author did not run vLLM and states this plainly: the conclusion comes from the documentation, which has no weight offloading to RAM, and its CPU backend requires Linux. Ollama turned out to be a wrapper over a fork of llama.cpp with no access to the -ncmoe, -np, and --reasoning-budget knobs, and on 8 GB those are exactly what separate 112 tokens/s from 365. On top of that, Ollama unloads the model after idle time, so the agent has to reload 17 GB each time.

## How a 35B model fits into 8 GB

The author chose Qwen3.6-35B-A3B in the Q3_K quantization. It is a Mixture of Experts model: it contains many "experts," and only some of them run for each token, about 3 billion out of 35. The file still takes 17.2 GB, because the router may call any expert. The gain is in speed, not size: the model has to read about ten times fewer parameters. A dense 27B model would manage only 2–4 tokens/s on this hardware, while a 9B model is fast but lacks the knowledge needed for code review and documentation analysis.

llama.cpp splits the model by tensors. Attention and the router of all layers stay in video memory, while the experts of the first 32 layers live in RAM. The value of -ncmoe works as a dial: the higher it is, the more experts move into system memory. The Q4_K variant has tensors about 15% larger, so fewer layers fit into the same 7 GB (-ncmoe 40 instead of 32), and it runs slower.

Each launch flag addresses a specific problem:

- -c 32768: at a context of 8192, the server returns a 400 error, because the agent's prompt alone is 22,832 tokens or more.
- -np 1: by default there are four slots, the cache does not fit, and prefill drops from 365 to 70 tokens/s without a single error in the log.
- --jinja: without it, tools are ignored and tool_calls never appear.
- --reasoning-budget 0: the default template enables long reasoning, and for an 18-token prompt the model produced 1,087 tokens of reasoning and a 39-second wait.

Check the model's template in advance: if the chat template contains no tool_call, no flag will enable tools. It is better to find this out before downloading 17 GB.

## Temperature 0: from 80% to 100%

The most practical observation concerns temperature. The author sent ten identical requests with a single tool and counted the share of responses containing tool_calls. At the default temperature of 0.8, the result was 16 out of 20 at both a 32,768 and a 49,152 context, roughly 80%. With --temp 0, it was 10 out of 10. So the cause is not the context length or the memory layout: roughly one case in five, the model chooses to answer in text.

For an agent, that is a lot. The probability of completing an entire chain is the per-step rate raised to the number of steps: with five consecutive calls, 0.8 to the fifth power is about 33%. In two out of three tasks, the agent would skip the tool somewhere along the way. The rule is simple: when tools are involved, set temperature to zero; when you are writing text, keep the default. If you need both, pass temperature in the body of a specific request, which overrides the server flag.

Connecting the model to the DSH agent also takes a small detail: the OpenAI-compatible transport expects a non-empty key, even though llama.cpp does not check it, otherwise you get "No API key for provider." The author uses the placeholder sk-local.

## What to expect from this model

The model is reliable where structure, planning, and classification are needed. But it confidently invents function names, signatures, and links. Therefore, everything concrete has to be verified with grep or by following the address. The measurements were made on one machine with one model, so the numbers are a reference point, not a universal benchmark.

---
- **Первоисточник:** [Habr AI](https://habr.com/ru/articles/1114918/?utm_campaign=1114918&utm_source=habrahabr&utm_medium=rss)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18946
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
