Local AI – hosting LLMs on 2 x RTX 3090s

Summary of self-hosting LLMs

Header plate: Local AI - hosting LLMs on 2 x RTX 3090s; a request enters one endpoint on port 8010 and is served or swapped across two GPU slots, both running qwen3.8-flash-next via Strata; the facts column lists 2 x RTX 3090 24G, 128 GB DDR4, 11 installed models, Qwen3.8-Flash-Next 125B flagship, 262,144 and 200,000 context, benchmark gen range 70.9-192.9 tok/s.

Both graphics cards are currently serving the same model. This sentence is decoded on one of them at roughly 133 tokens a second. There is no cloud account in the path, no per-token invoice, and no rate limit. Instead we have two second-hand RTX 3090s, 128 GB of RAM, a Ryzen 9 5900X, a headless Ubuntu box, and a bespoke orchestrator that routes requests to llama.cpp and Strata. This serves eleven models to OpenCode or other API consumers, swappable on demand. Over time, new models can be added or existing ones changed via the JSON registry.

The Local AI page lists all eleven models with the figures measured on this machine. Each model has its own article, including a guide to reproducing the setup on comparable hardware.

The machine

  • CPU: AMD Ryzen 9 5900X, 12 cores / 24 threads, Zen 3
  • Motherboard: ASUS ROG STRIX X570-E GAMING WIFI II (AM4, ATX)
  • GPU: 2× NVIDIA GeForce RTX 3090, 24 GB VRAM each, second-hand (each model needs one card)
  • Total VRAM: 48 GB (2 × 24 GB)
  • System RAM: 128 GB DDR4 (~121.5 GiB usable), that number is the reason the flagship model works at all
  • Storage: 2 TB KIOXIA EXCERIA NVMe SSD. Models live on a separate /mnt/data volume
  • OS: Ubuntu 26.04.1 LTS, headless
  • CUDA: toolkit at /usr/local/cuda-13.1
  • PCIe topology: both GPUs on the CPU root complex. X8/x8 split when both slots populated (normal for this board); Gen1 at idle → PCIe 4.0 x8 under load. Nvidia-smi topo -m shows PHB between GPUs. No NVLink
  • Cooling/chassis: open mining rig (GPU spacing + rig fans, no case). GPU 0 peaks ~73–74 °C under dual load. Routine sw_thermal/sw_power_cap throttle to ~76 °C is normal, and it affects every measurement equally
  • Kernel mitigations in place: pcie_aspm=off, LimitMEMLOCK=infinity, orchestrator MemoryMax=110G

The memory ceiling that governs everything below: 48 GB of VRAM plus 128 GB of system RAM, about 176 GB, and every installed model has to fit inside that.

The orchestrator

Nothing on this machine talks to a model directly. One FastAPI service, the orchestrator, listens on port 8010 and exposes one OpenAI-compatible endpoint. Behind it sit two slots, one per GPU, each holding a child inference process on localhost ports 8011 and 8012: llama-server for the ten llama.cpp models, Strata for the flagship. And a registry.json holding every model’s weights path, context size, KV quantization, batching, sampling and reasoning flags. The full design, including the registry schema and a copy-pasteable entry, is in that post. The rules in one list:

  • Model already loaded? Served from that slot, the least busy one if there are two.
  • Slot only momentarily busy? It continues-batches the request instead of swapping.
  • Congested and another slot idles on something else? That slot swaps: kill the child, wait for VRAM to drain under ~1 GiB, boot the new model, wait for /health.
  • No slot free? Queue up to 300 s, then a clean HTTP 503 that explains how to retry, never a hang.
curl -s http://127.0.0.1:8010/health      # slot state, loaded model, queue depth
curl -s http://127.0.0.1:8010/v1/models   # every installed model

Swaps are the expensive part (~40–60 s cold), so the routing rules exist to make them rare rather than free. Memory is the other dangerous part: the service cgroup carries MemoryMax=110G and LimitMEMLOCK=infinity, because a RAM-hungry MoE stack once livelocked this host without killing a single process, which is written up in the orchestrator article.

The model

The daily driver is Qwen3.8-Flash-Next: 125 billion parameters, ~6 billion active, a mixture-of-experts model, IQ3_S weights (~84.5 GB on disk), 262,144 tokens of context. When it first landed on this box in September it managed ~26 tok/s with a llama.cpp CPU/GPU split, which is not a working speed. Strata fixed it: experts stream from system RAM, the MoE layers stay in VRAM, and today two instances run side by side, one per GPU, each decoding at ~133 tok/s at the default thinking level. The flag that made two instances possible is --shared-expert-arena, without it each instance pins its own ~47 GiB copy of the experts and the host livelocks.

Cost of that arrangement: ~23.6 GB of VRAM per card and ~93 GiB of host RAM for both instances, which leaves ~27 GiB of headroom on a 128 GB box. In exchange: a frontier-class model that answers 0.3–0.9 s after a request when it is already resident, and two of them answering at once.

What the endpoint has been used for since it went live: reading and editing code across projects and running the tests, planning and reviewing work while a faster 30B model does the mechanical edits in parallel, writing and re-writing this site and the tooling around it, benchmarking every model installed here and recording the results, drafting long-form text and summarising documents, generating the site’s header plates, and running the monitoring and diagnostic scripts that keep the box itself healthy, and summarising all the work done in the last 48 hours so that the next session starts from a written record instead of from memory.

The rest of the lineup

Eleven models are installed, all of them sized to fit a single 24 GB card at 200,000 tokens of context (KV-cache quantization is what makes that fit). Each one has its own guide with setup, config, memory footprint and a build-it-yourself section:

ModelGen tok/sWhat it is for here
Qwen3.8-Flash-Next132.5Daily driver, two instances, one per GPU
Qwen3.6-35B-A3B with MTP192.9Fastest gen on the box; chat-heavy work
Qwen3.6-35B-A3B MTP + Vision188.9Images, with the vision encoder kept on CPU
Qwen3-Coder-30B-A3B181.8The coding sub-agent (prefills at 13,150 tok/s)
Ornith 35B171.4Mature 1.0 line; dependable fallback
Ornith 1.5 35B-A3B168.5Agentic default on the 1.5 line
GLM-4.7-Flash146.8Best coding score on the box (59.2% SWE-Bench Verified)
Gemma 4 26B-A4B138.8Light general model, ~18 GB used
Ornith 1.5 9B118.0Errands: summaries, classifications, cleanup
Nemotron 3.5 Bolt 74B86.0Long-context + vision specialist, ~600 MB of card spare
Qwen3.8-27B70.9Dense reasoning + vision, tuned preset

What it’s for

Personal projects, and this site is one of them: the theme, the plugin, the migration tooling and the writing here were all built on the machine that serves them. Learning how these models work is the other reason, not a side effect. Adobe Commerce / Magento 2 is what I do for a living and it is what the setup is being aimed at – agent work around that stack is the plan, not something that has happened on this box yet. Everything measured here so far has been self-hosting work: models, benchmarks, monitoring, and the site itself.

Self-hosting here is for learning first. Setting the whole thing up first-hand – weights, quantization, context windows, KV caches, speculative decoding, a serving stack, an orchestrator – is the direct route to understanding how the technology works, because every one of those decisions moves a number I then have to explain. The other reasons held up in use: there is no meter running, so prompts stop being rationed and whole codebases get read. Subagents get spawned without checking a bill. Nothing gets rate-limited or changes its terms mid-task. And if a project ever involves a shop’s checkout or its customer records, that data never has to leave the room.

The trade is that I own every failure. A bad config freezes the box. Thermals cap throughput. A 200,000-token prefill is still minutes of GPU, so “free” is not the same as unlimited.

How the benchmarks have been run

Every tok/s figure on this site is measured, not quoted, unless it is labelled otherwise. One method for the orchestrator set: identical short prompt, max_tokens=512, temperature=0.7, two runs per model, median reported, model warmed first so load and swap time are excluded, and re-verified with server-reported timings, all models within a few percent. Thermal throttling at 72–76 °C affects all models similarly. Short-prompt prefill numbers are overhead-dominated and comparative only. A llama.cpp upgrade (b11480 → v0.7.0) moved generation throughput anywhere from −5% to +21% per model, which is why no number here travels without its build, context length and date.

Agents reading this: every page and post has a markdown sibling at <url>.md and an index at /llms.txt, generated from the same copy the page shows.

Where to start

Leave a Reply

Your email address will not be published. Required fields are marked *