← Back to portfolio

03 / Case study

Local AI Infrastructure

What it actually takes to run a useful assistant on one desktop: a 16 GB GPU, 24 GB of system RAM after a stick failed, and a habit of measuring the whole agent instead of the token rate.

Daily setup
Hosted Hermes; local SearXNG, Crawl4AI, Mnemosyne
Local inference
PolyStrata HIP with Ornith 1.5 35B (paused)
Retired
Standalone Ollama (Nov 24, 2026, ~171 GiB freed)
Hardware
i5-13600KF, RX 9070 16 GB, 24 GB DDR4

Where things stand

This project has changed shape more than once, and the current state is a mix of local and hosted pieces rather than a single local model serving everything. That is the honest version, so it is the one on the page.

ComponentStatusWhat it does
Hermes agent Daily Runs on hosted inference through opencode-go, with an OpenRouter fallback. Tool selection, sessions, and scheduled jobs stay the same as they were with a local model.
SearXNG, Crawl4AI, Mnemosyne Local Search, page fetching, and the memory provider backed by a local Qdrant store. These never left the host.
PolyStrata HIP with Ornith 1.5 35B Paused The local inference path is configured and tested, but it is not serving daily traffic. The runtime and model are still on disk.
Standalone Ollama Retired Uninstalled on 2026-11-24 after the move to PolyStrata. Removing the service, models, and stores reclaimed about 171 GiB.
Strata, llama.cpp Vulkan Experimental Benchmark-only runtimes. Both produced useful numbers and neither earned a permanent place in the daily path.

The split matters for privacy, so it is worth being precise: with a hosted model selected, prompts and tool results leave the machine. Search results, fetched pages, and memory retrieval still run locally, but inference does not. When the local PolyStrata path is running, the model call stays on the desktop and only the tools that reach outside services send data out.

Hosted inference, daily Local retrieval and memory Local 35B paused Ollama removed

Hardware set the limits

The desktop is an i5-13600KF with an AMD Radeon RX 9070 and 16 GB of VRAM. Through October 2026 it had 32 GB of DDR4. One stick failed in November, which left 24 GB, and that single change invalidated a lot of earlier assumptions about how much of a model could live in system RAM.

The second constraint is that this is a daily workstation, not a dedicated inference box. The browser, desktop, and games keep part of the GPU busy, so 3 GiB of VRAM is reserved for everything that is not the model. A model cannot assume it owns the whole card, and a benchmark that ignores this is measuring a machine I do not actually use.

24GBSystem RAM after one stick failed
16GBGPU VRAM, shared with the desktop
6GiBService soft memory limit
64KProduction context that fit

Fitting a 35B model into 24 GB

The production candidate was Qwen3.6 35B-A3B at UD-Q4_K_M: a 34.7B mixture-of-experts model with roughly 3B active parameters. The weights are about 22.1 GB, so no context setting makes it fully GPU-resident on a 16 GB card. Part of it has to sit in system RAM, which is exactly the resource that got smaller.

The first useful change was the KV cache. Moving both K and V from f16 to q8_0 saved 1,200 MiB of VRAM at 128K, moved about 1.2 GB of weights back onto the GPU, raised warm decode about 7 percent, and cut a fresh 26,942-token prefill from 95.7 s to 77.3 s. Dropping the context from 128K to 120K saved only 160 MiB, which is not worth losing 8K of window.

Then the production limits did what limits do. A 128K load under a 6 GiB MemoryHigh soft cap hit 88,185 throttle events in 98 seconds and pushed about 2.4 GB of host memory into swap before I stopped it by hand. There was no OOM kill, just a service that was never going to finish loading usefully. At 64K it loaded and answered: 39.5 s wall time, 31.3 s of which was model load. Production context became 64K, not because 64K is ideal, but because it is what the machine can serve while the desktop is also in use.

The lesson I keep relearning: an advertised context window is not a context the machine can serve. Fit has to be measured under the same cgroup limits, the same GPU reservation, and the same background load as production. The unrestricted benchmark instance ran 128K fine. Production did not.

Speed is not the metric

My earlier process compared decode speed and picked the largest model that still felt responsive. On 32 GB that mostly worked. On 24 GB with a busier GPU it stopped predicting anything useful, because a fast model that takes twelve extra steps is slower in practice than a slow one that stops.

So the November work moved into the real Hermes loop. The suite has six scenarios with a clear finish line: authenticate through the maintained helper, recover a revoked token, repair a broken service, diagnose a missing key, answer a question that needs live data, and audit ten recurring calendar events across two pages with one injected HTTP 503. A case passes only if the answer is correct, nothing unnecessary was called, and the agent stops after the final tool result.

ModelDecodeSuiteIterationsExtra actionsResult
Ornith 1.5 9B Q4_K_M86.9 tok/s3/63713Rejected. Fast and consistently over-eager.
Gemma4 12B Q4_K_M94.4 tok/s4/6202Rejected. Fast, but filled in missing calendar fields.
Qwen3.6 35B-A3B UD-Q4_K_M37.5 tok/s6/6180Deployed at 64K.

Decode figures are short-prompt throughput from the same screening round. The suite column is the full six-case Hermes run, not the synthetic loop.

The gap is not subtle. Ornith decoded more than twice as fast as Qwen and still failed half the suite. During revoked-token recovery it ran two unrelated diagnostics, then two more commands after the helper said user consent was required and it should stop. In the calendar audit it reported all ten rows correctly and then invented pagination flags for a response that had no next page. Qwen took about twice as long per token but finished in 18 iterations with no unnecessary actions.

Gemma is the more interesting failure because it looks good on paper. It was the fastest model in the screening round, passed four of six, and got all ten calendar rows right with thinking on. It still ran an unrelated recursive listing during token recovery and made an extra status call after a helper told it to stop. A model that invents a missing timezone is worse than one that asks, and a model that keeps working after success wastes the user's time even when the final answer is right.

Method, so the numbers mean something

Agent runs used an isolated Hermes home, the real terminal tool schema, and an allowlisted command dispatcher. The calendar case made real read-only requests with identifiers replaced by aliases before the model saw them. Settings were seed 42, temperature 0, a 4,096-token output cap, and a 16-iteration limit. Benchmarks ran on a separate model store so production stayed up and unchanged until the deployment round.

Throughput runs used three repetitions per mode with 256 output tokens. The agent cases ran once per model and setting. That difference matters: the speed numbers have a small variance check, and the reliability numbers are directional evidence rather than a distribution.

One measurement correction is worth recording. Ollama's residency counters under-report memory for partially offloaded models. At 128K, ollama ps reported 98 percent GPU while the loader log showed about 11 GB of weights mapped on the CPU. For Gemma it reported 1.3 GB resident for a model that had filled the card. I use the loader log for footprint numbers now.

The late-November benchmark set

Between 2026-11-22 and 2026-11-24 I retired standalone Ollama and ran three model families across three runtimes: Ornith 1.5 35B and Qwen3.6 35B on PolyStrata HIP, Inkling 2 Mini on llama.cpp Vulkan, and Qwen3.8 Flash Next on Strata. All of it ran on the same desktop under the 6 GiB soft and 7 GiB hard cgroup limits.

14-turn synthetic agent suite, 32K context

Model and runtimeFactualEvidenceFull passesUnavailable callsMedian turn
Ornith 1.5 35B (PolyStrata HIP)12/1414/144/14337.85 s
Qwen3.6 35B (PolyStrata HIP)9/1412/145/141416.29 s
Inkling 2 Mini (llama.cpp Vulkan, upstream)12/1412/141/144125.00 s
Inkling 2 Mini (llama.cpp Vulkan, Unsloth build)11/1410/141/143921.72 s

Workflow passes were not recorded for the Inkling runs. The two Inkling builds both completed 14 of 14 turns with no truncations; median decode was 25.1 and 25.8 tok/s. Unavailable calls counts attempts to use tools the read-only fixture did not expose.

16-turn everyday conversation suite

Each model ran 16 synthetic conversation turns and was scored from 0 to 100 by Gemini 4 Neon across naturalness, warmth, substance, pacing, and continuity.

Model and runtimeScoreMedian decodeMedian turnTruncations
Ornith 1.5 35B (PolyStrata HIP)87.8102.1 tok/s6.76 s0
Qwen3.8 Flash Next Q2 (Strata)84.021.7 tok/s33.43 s1
Inkling 2 Mini (llama.cpp Vulkan)76.232.2 tok/s10.96 s0
Qwen3.6 35B (PolyStrata HIP)69.448.0 tok/s18.31 s4

Long context held up better than the turn-level scores suggest. Ornith 1.5 35B recalled 5 of 5 synthetic anchors at 96,244 prompt tokens on PolyStrata, with 84.4 s to first token and 88.6 s total. That is a retrieval check, not proof of reasoning across the window, but it does show the window is wired up.

Qwen3.6 decodes faster here than in the Ollama screening table above because this run used PolyStrata HIP, a different engine. Same model family, different runtime.

Runtimes and experiments

Strata on HIP

In October I ran Strata with a Qwen3.8 Flash Next Coder IQ1_M build at 64K context, int8 KV, and 16 GiB of page-locked expert weights. Speculative decoding at depth 4 reached 44 to 58 tok/s and then crashed with GPU wait timeouts during long-prompt prefill. The stable depth-2 configuration ran at 47.2 tok/s chat, 47.1 tok/s coding, 42.6 tok/s on long-prompt decode, and 752.6 tok/s prefill on an 18.8K-token prompt. In a blind comparison on 12 matched prompts, Strata and Qwen3.8 27B each won four and tied four, with average scores of 7.42 and 7.84. I kept the model I already had.

llama.cpp Vulkan and speculative decoding

A locally rebuilt Qwen3.8 27B with multi-token prediction went from 41.85 to 61.34 tok/s, about 47 percent faster. llama.cpp Vulkan testing also showed memory growth that looked like a leak, so MTP never reached production. A speedup that brings instability is not an improvement, especially on a workstation that has to stay up.

Retiring Ollama

Once the 35B model moved to PolyStrata and daily traffic moved to hosted inference, standalone Ollama had no production role left. Removing it on 2026-11-24 reclaimed about 171 GiB and left one fewer runtime to patch and keep consistent. The local setup that replaced it is paused rather than deleted, because the point of keeping it is to be able to start it again without rebuilding the stack.

What this evidence does and does not show

The late-November tables compare models that ran on different engines, at different quantization levels, sometimes with different KV cache types. Ornith and Qwen3.6 ran on PolyStrata HIP, Inkling ran on llama.cpp Vulkan, and Qwen3.8 Flash Next ran on Strata. A gap between two rows therefore mixes the model, the runtime, and the quantization. These are not controlled runtime comparisons, and I would not use them to rank the engines themselves.

Other limits worth stating:

  • One desktop, one GPU, one OS. Nothing here establishes how these models behave on other hardware.
  • Most agent cases ran once per model. The throughput runs used three repetitions. There is no meaningful variance estimate for the pass counts.
  • The round 2 calendar case used a real read-only calendar; round 4 used a synthetic fixture. Calendar results are not a head-to-head across rounds.
  • Conversation scores come from a model judge, not a human panel, and the rubric is only as good as the judge.
  • I evaluated third-party models and engines here. I did not develop Ornith, Qwen, Inkling, PolyStrata, llama.cpp, or Strata; the engineering work is the harness, the measurements, the fit analysis, and the operating setup around them.

What changed in how I test

  • Test inside the real agent. A hand-written loop that mimics the tool schema can miss the failure that shows up in daily use.
  • Count iterations and unnecessary actions, not just pass or fail. They map directly to how long a task takes and how much it costs.
  • Treat fit as a pass or fail gate before comparing quality. A model that cannot load is not a candidate.
  • Record background GPU and RAM use, quantization, KV type, and warm or cold state with every run, because those details decide the result.
  • Prefer the stable configuration over the faster one when the faster one crashes under load.

Open items are the ones that would make this evidence stronger: run the full suite with the deployed reasoning setting, repeat each case at least three times, reproduce the original long calendar task end to end against a test calendar, and requalify the vision and audio paths that the November tests did not cover.