# The Anti-Consensus: Why Your Local LLM Should Never Be the "Brain" of Your System

> Source: <https://dev.to/dqj1998/the-anti-consensus-why-your-local-llm-should-never-be-the-brain-of-your-system-k5p>
> Published: 2026-11-28 02:41:06+00:00

**Recommendation:** 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.
More in the playbook "Designing agent systems": <https://wpnews.pro/playbooks/agent-architecture>

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)

*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.*

Every 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.

This 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.

The first thing to internalize: token throughput on the edge is a memory-bandwidth problem, not a model-quality problem.

Every decoded token streams the active weights (plus the KV cache) from memory once. The back-of-envelope:

```
theoretical tok/s ≈ memory bandwidth (GB/s) ÷ active weights (GB)
```

A 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:

| Hardware class | Bandwidth | Theoretical | Realistic sustained | 
|---|---|---|---|
| Thin laptop, shared LPDDR | 68–100 GB/s | 17–25 tok/s | 8–14 tok/s while the UI composites | 
| Mid-tier unified memory | 200–400 GB/s | 50–100 tok/s | 30–60 tok/s | 
| 12 GB discrete GPU | 270–500 GB/s | 65–125 tok/s | 45–90 tok/s | 

Three multipliers turn those numbers into a wall:

Meanwhile, 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.

The 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.

Tasks that must be owned by code, because a spec exists and a machine can check compliance:

Tasks where the model earns its 10%, because no spec exists and variance is acceptable:

The boundary as code:

```
// Spec-bearing stages stay deterministic: pure, testable.
interface DeterministicStage<I, O> {
  name: string;
  run(input: I): Result<O, SpecError>;
}
// The model appears only as a leaf, with four mandatory fields.
interface AiOperator<I, O> {
  name: string;
  buildPrompt(input: I): string;   // built by code
  parse(raw: string): Result<O, ParseError>; // schema-checked
  fallback(input: I): O;           // rules, not retries
  budget: { timeoutMs: number; maxTokens: number };
}
// A pipeline is a graph; AI operators are leaves, never hubs.
type Stage = DeterministicStage<any, any> | AiOperator<any, any>;
```

Note 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).

The 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:

| Property | End-to-end agent | Deterministic pipeline + AI leaves | 
|---|---|---|
| Testability | Prompt-dependent; tests flake with temperature | 90% of the graph has golden tests | 
| Fault isolation | Any token can break any feature | Failure confined to one leaf with a fallback | 
| Latency variance | Seconds, effectively unbounded | Bounded by per-leaf budgets | 
| Reproducibility | Same input, different output | Byte-identical except at AI leaves | 
| Debugging | Re-read the transcript, guess | Binary-search the graph | 

Data flow through the pipeline looks like this — note that the model sits *beside* the main path, not on it:

```
                 ┌──────────────────────────────────────────────┐
  .pptx file ──▶ │ parse container (deterministic)              │
                 │ build slide tree (deterministic)             │
                 │ extract text/tables/notes (deterministic)    │
                 └───────────────┬──────────────────────────────┘
                                 │ structured summary (typed)
                 ┌───────────────▼──────────────────────────────┐
                 │ local AI operator                            │
                 │  prompt built by code ──▶ model ──▶ schema   │
                 │  on timeout/error ──▶ deterministic fallback │
                 └───────────────┬──────────────────────────────┘
                                 │ polished notes (untrusted,
                                 │                schema-checked)
                 ┌───────────────▼──────────────────────────────┐
                 │ align timeline (arithmetic)                  │
                 │ render / encode (deterministic)              │
                 │ package output (deterministic)               │
                 └───────────────┬──────────────────────────────┘
                                 ▼
                          output artifact
```

If 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.

Boundaries enforced only by convention decay. Make the pipeline data, and the boundary becomes reviewable in a diff:

```
{
  "pipeline": "document-pipeline",
  "stages": [
    { "type": "deterministic", "id": "parse-container" },
    { "type": "deterministic", "id": "build-structure" },
    {
      "type": "ai",
      "id": "polish-speaker-notes",
      "input": "structured-slide-summary",
      "constraints": {
        "timeoutMs": 3000,
        "maxTokens": 420,
        "temperature": 0.2
      },
      "onFailure": "use-extracted-text"
    },
    { "type": "deterministic", "id": "align-timeline" },
    { "type": "deterministic", "id": "render-and-mux" }
  ]
}
```

Three 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.

Teams that wire the model into every path meet the same five failures, in roughly this order:

None of these are model-quality problems. Bigger models make them rarer, not absent. They are boundary problems.

Before any task gets routed to the model, ask four questions:

The 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.

That 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.

If you have shipped local-LLM features that regressed exactly this way, you already know why the boundary comes first.

*The author is a systems engineer building local-first desktop software. This series is Part 1 of 6.*
