Running a 35B model on an 8 GB VRAM laptop: prompt processing at 365 tokens/s
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.
AI-processed from Habr AI; edited by Hamidun News
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.
- Dec 2, 2026The ncnn Author Ran MiniMax-H3 Without CUDA: a Step on an RTX 3060 Is 3.7x Faster
- Dec 2, 2026Amazon Releases Ergo Weights: 74.2% on Coding Tasks, $1 per Million Tokens
- Dec 2, 2026DeepMind releases CellGemma: a single-GPU model beats the baseline in 32 of 32 tests
- Dec 2, 2026T-Bank Open-Sources Models That Pick an Answer Instead of Writing One: Up to 112 Requests per Second on an H100
Key Questions Answered
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.
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.
What are the key details on 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.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
Daily 60-sec AI Voice Brief + Weekly Production AI Agent Playbook
Listen to a 60-second AI news brief every morning and get a weekly hands-on playbook for shipping AI agents to production — tools, MCP servers and patterns that work. Curated by Jemal Hamidun, Head of AI at Alpina Digital.
