{"slug": "the-anti-consensus-why-your-local-llm-should-never-be-the-brain-of-your-system", "title": "The Anti-Consensus: Why Your Local LLM Should Never Be the \"Brain\" of Your System", "summary": "A developer argues that on-device small language models should never sit in the control loop of desktop apps, citing memory-bandwidth limits that cap a 4-bit 7B model at roughly 8–14 tok/s on a thin laptop and 30–60 tok/s on mid-tier unified memory, well below the sub-100ms budget for direct-manipulation UI. The proposed architecture routes every spec-bearing task through deterministic, testable code and confines the model to leaf operators with schema-checked parsing, a rules-based fallback, and per-call time and token budgets.", "body_md": "Originally published on Medium: [https://medium.com/@dqj1998/desktop-apps-keep-wiring-a-7b-model-into-every-control-path-115063626c2f](https://medium.com/@dqj1998/desktop-apps-keep-wiring-a-7b-model-into-every-control-path-115063626c2f)\n\n*Desktop apps keep wiring a 7B model into every control path. Here is the physics — and the 10% AI / 90% deterministic code architecture that survives production.*\n\nEvery new desktop app pitch this year ships the same diagram: a small language model in the center, arrows fanning out to every feature — parsing, planning, formatting, error recovery — all routed through the same few billion parameters. It demos beautifully. It ships badly.\n\nThis is the first article in a six-part series on **10% AI, 90% deterministic code**: how to use on-device models hard, but held small. No product tour, no trend forecast — just the engineering constraints that force the architecture, and the architecture that survives contact with real users.\n\nThe first thing to internalize: token throughput on the edge is a memory-bandwidth problem, not a model-quality problem.\n\nEvery decoded token streams the active weights (plus the KV cache) from memory once. The back-of-envelope:\n\n```\ntheoretical tok/s ≈ memory bandwidth (GB/s) ÷ active weights (GB)\n```\n\nA 7B model at 4-bit quantization is roughly 4 GB of active weights. Back-of-envelope numbers, measured against hardware classes rather than lab queens:\n\n| Hardware class | Bandwidth | Theoretical | Realistic sustained | \n|---|---|---|---|\n| Thin laptop, shared LPDDR | 68–100 GB/s | 17–25 tok/s | 8–14 tok/s while the UI composites | \n| Mid-tier unified memory | 200–400 GB/s | 50–100 tok/s | 30–60 tok/s | \n| 12 GB discrete GPU | 270–500 GB/s | 65–125 tok/s | 45–90 tok/s | \n\nThree multipliers turn those numbers into a wall:\n\nMeanwhile, direct manipulation UI has a hard budget: under ~100 ms feels instant, under ~1 s keeps flow, beyond that users reach for the window close button. **A model call lives at 500 ms to 5 s.** That is not a gap you close with prompt engineering. It is a gap you design around: the model cannot sit inside the interaction loop, and it certainly cannot sit inside the control loop.\n\nThe fix is not \"use the model less.\" It is to decide, before writing code, which tasks carry a **specification** — and give every spec-bearing task to deterministic code.\n\nTasks that must be owned by code, because a spec exists and a machine can check compliance:\n\nTasks where the model earns its 10%, because no spec exists and variance is acceptable:\n\nThe boundary as code:\n\n```\n// Spec-bearing stages stay deterministic: pure, testable.\ninterface DeterministicStage<I, O> {\n  name: string;\n  run(input: I): Result<O, SpecError>;\n}\n// The model appears only as a leaf, with four mandatory fields.\ninterface AiOperator<I, O> {\n  name: string;\n  buildPrompt(input: I): string;   // built by code\n  parse(raw: string): Result<O, ParseError>; // schema-checked\n  fallback(input: I): O;           // rules, not retries\n  budget: { timeoutMs: number; maxTokens: number };\n}\n// A pipeline is a graph; AI operators are leaves, never hubs.\ntype Stage = DeterministicStage<any, any> | AiOperator<any, any>;\n```\n\nNote the two non-negotiables: `parse` (the model's output is untrusted input, validated like any other external payload) and `fallback` (failure resolves to a deterministic result, never to a retry loop).\n\nThe alternative to a deterministic pipeline with AI leaves is the end-to-end agent: one model, one context window, all control flow. Both ship. Only one is maintainable:\n\n| Property | End-to-end agent | Deterministic pipeline + AI leaves | \n|---|---|---|\n| Testability | Prompt-dependent; tests flake with temperature | 90% of the graph has golden tests | \n| Fault isolation | Any token can break any feature | Failure confined to one leaf with a fallback | \n| Latency variance | Seconds, effectively unbounded | Bounded by per-leaf budgets | \n| Reproducibility | Same input, different output | Byte-identical except at AI leaves | \n| Debugging | Re-read the transcript, guess | Binary-search the graph | \n\nData flow through the pipeline looks like this — note that the model sits *beside* the main path, not on it:\n\n```\n                 ┌──────────────────────────────────────────────┐\n  .pptx file ──▶ │ parse container (deterministic)              │\n                 │ build slide tree (deterministic)             │\n                 │ extract text/tables/notes (deterministic)    │\n                 └───────────────┬──────────────────────────────┘\n                                 │ structured summary (typed)\n                 ┌───────────────▼──────────────────────────────┐\n                 │ local AI operator                            │\n                 │  prompt built by code ──▶ model ──▶ schema   │\n                 │  on timeout/error ──▶ deterministic fallback │\n                 └───────────────┬──────────────────────────────┘\n                                 │ polished notes (untrusted,\n                                 │                schema-checked)\n                 ┌───────────────▼──────────────────────────────┐\n                 │ align timeline (arithmetic)                  │\n                 │ render / encode (deterministic)              │\n                 │ package output (deterministic)               │\n                 └───────────────┬──────────────────────────────┘\n                                 ▼\n                          output artifact\n```\n\nIf any box on the main path fails, you get a reproducible bug report. If the AI leaf fails, you get the fallback output and a log line. Nothing upstream stops, nothing downstream corrupts state.\n\nBoundaries enforced only by convention decay. Make the pipeline data, and the boundary becomes reviewable in a diff:\n\n```\n{\n  \"pipeline\": \"document-pipeline\",\n  \"stages\": [\n    { \"type\": \"deterministic\", \"id\": \"parse-container\" },\n    { \"type\": \"deterministic\", \"id\": \"build-structure\" },\n    {\n      \"type\": \"ai\",\n      \"id\": \"polish-speaker-notes\",\n      \"input\": \"structured-slide-summary\",\n      \"constraints\": {\n        \"timeoutMs\": 3000,\n        \"maxTokens\": 420,\n        \"temperature\": 0.2\n      },\n      \"onFailure\": \"use-extracted-text\"\n    },\n    { \"type\": \"deterministic\", \"id\": \"align-timeline\" },\n    { \"type\": \"deterministic\", \"id\": \"render-and-mux\" }\n  ]\n}\n```\n\nThree numbers do most of the work. `timeoutMs: 3000` converts a hung model into a fallback. `maxTokens: 420` caps worst-case decode time at that bandwidth math from the first section. `temperature: 0.2` keeps retries from wandering. The deterministic stages carry no budgets at all — they either return or they throw a reproducible error.\n\nTeams that wire the model into every path meet the same five failures, in roughly this order:\n\nNone of these are model-quality problems. Bigger models make them rarer, not absent. They are boundary problems.\n\nBefore any task gets routed to the model, ask four questions:\n\nThe rule of thumb: **the model gets ~10% of the code paths and 100% of the ambiguity.** It shines exactly where a spec is missing — and nowhere else.\n\nThat was the philosophy. The next five articles get progressively more concrete: how to constrain a small model's output so the `parse` step never fails (grammar-constrained decoding and context minimalism); how to package an inference runtime so it degrades gracefully on a five-year-old laptop; then three articles on a concrete target — reading real documents, synthesizing speech, and assembling the whole pipeline into a video — before the final piece shows the system it all adds up to.\n\nIf you have shipped local-LLM features that regressed exactly this way, you already know why the boundary comes first.\n\n*The author is a systems engineer building local-first desktop software. This series is Part 1 of 6.*", "url": "https://wpnews.pro/news/the-anti-consensus-why-your-local-llm-should-never-be-the-brain-of-your-system", "canonical_source": "https://dev.to/dqj1998/the-anti-consensus-why-your-local-llm-should-never-be-the-brain-of-your-system-k5p", "published_at": "2026-11-28 02:41:06+00:00", "updated_at": "2026-11-28 02:43:33.431685+00:00", "lang": "en", "topics": ["large-language-models", "ai-agents", "ai-infrastructure", "developer-tools"], "entities": ["Medium"], "also_reported_by": [], "takeaway": "Keep the model out of the control loop: put spec-bearing stages in deterministic code and expose the LLM only as a leaf operator with schema-checked parse, a rules-based fallback, and a timeout/token budget, since a 4-bit 7B model sustains only 8–14 tok/s on a thin laptop against a sub-100ms UI budg", "recommendation": {"advice": "Treat model output as untrusted input: validate it against a schema and resolve failures to a deterministic fallback rather than a retry loop, keeping AI operators as leaves in a code-owned pipeline.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/the-anti-consensus-why-your-local-llm-should-never-be-the-brain-of-your-system", "markdown": "https://wpnews.pro/news/the-anti-consensus-why-your-local-llm-should-never-be-the-brain-of-your-system.md", "text": "https://wpnews.pro/news/the-anti-consensus-why-your-local-llm-should-never-be-the-brain-of-your-system.txt", "jsonld": "https://wpnews.pro/news/the-anti-consensus-why-your-local-llm-should-never-be-the-brain-of-your-system.jsonld"}}