Local LLM Selection and a Unified Inference Gateway: A Capacity-First Approach
This article explains why local LLM performance is constrained by available memory capacity rather than peak compute, and how to plan hardware, storage tiers, and loading paths around that reality. It then walks through consolidating scattered model processes into a unified managed service plus a single standards-compatible gateway, using a budget ledger and a two-stage admission check to turn unpredictable OOM crashes into predictable rejections. Readers will also find the observability metrics needed for capacity governance and a goal-based selection framework for agent workloads, high-frequency completion, and team-wide sharing.
1. Reframing the Problem: The Bottleneck Is Capacity, Not Peak Compute
When teams plan a local LLM deployment, the first instinct is often to compare compute: whose floating-point throughput is higher, whose chip has more cores. But in real inference workloads, what determines whether a model runs at all, and how long a context you can open, is available memory capacity, not peak compute. There are three reasons.
First, weights must stay resident. Model inference is memory-access intensive: every decoding round rereads the weights. If the weights do not fit in the memory pool, they have to be shuttled back and forth from storage repeatedly, and latency degrades to the point of being unusable.
Second, the KV cache grows linearly with context. The longer the context and the higher the concurrency, the larger the cache footprint. This overhead often fills memory faster than the weights themselves do.
Third, quantization only lowers the bar; it does not remove it. Low-bit quantization can compress weight size substantially, but once model size moves into the mid-to-large parameter range, even quantized models still leave common consumer GPU memory tiers stretched thin.
So the first principle of selection should be: secure capacity and context headroom first, then talk about speed. This is exactly where a unified memory architecture adds value. The CPU and GPU share the same physical memory pool, so the GPU can be allocated far more memory than a conventional discrete card provides, resolving both “will it run” and “how much context can I open” in one move. The tradeoff is that memory bandwidth is typically lower than that of a dedicated discrete GPU, so decoding speed stays limited. That produces a clear chain of tradeoffs:
trade bandwidth for capacity → trade capacity for context → trade context for agent capability
What this chain means is that if your goal is to make the model the brain of an agent, needing long context to carry tool descriptions, interaction history, and intermediate results, then capacity-first is the right route. If your goal is high-frequency code completion that must output hundreds of tokens per second, this route is not appropriate and you should prioritize a low-latency option instead. State the goal clearly, and selection will not drift.
2. Hardware and Storage: A Tiered Design for Capacity, Bandwidth, and I/O Path
On a capacity-first route, hardware planning revolves around three things.
The first is the usable ceiling of the memory pool. Under a unified memory architecture, confirm the upper limit of memory that can be allocated to the GPU, and work backward from that to the model size and context length you can support, rather than buying hardware first and guessing afterward what will run.
The second is tiering storage bandwidth. Trace routing for the multiple storage slots on a motherboard is often inconsistent: some connect directly to high-bandwidth channels, others only to low-speed ones. The sensible approach is to put model weights in the high-bandwidth slots and archives or cold backups in the low-speed slots. The reason is straightforward: weight loading is a large sequential read, so bandwidth differences get amplified across tens of GB of reads, and load time can differ by several times. Low-speed channels are better suited to cold data and should never hold weight files that require frequent random reads.
The third is determinism in how loading happens. Model loading should use memory-mapped sequential reads as much as possible, and weight files that need random access should be kept off low-speed media; otherwise first-token latency becomes unpredictable.
A practical tiering strategy looks like this:
- Hot tier: high-bandwidth storage holding only the weights in current use, keeping load time predictable.
- Warm tier: large-capacity local storage for weights that are not frequently used but are retained.
- Cold tier: low-speed storage or external archives, used only for backup and never for online inference.
3. From Manual Multi-Window Operations to Unified Management Plus a Unified Gateway
The early approach is usually one terminal and one port per model, starting whichever one you need. That works at small scale but quickly exposes four problems:
- Invisible resources: nobody can say who is using how much memory, and starting a new model immediately triggers memory exhaustion.
- Scattered configuration: the same model name appears in multiple config files, and fixing one place leaves three broken.
- Out-of-control lifecycle: forgotten instances keep holding memory, while the model you actually need fails to start.
- Inconsistent calling conventions: authentication, timeout, and retry policies differ per client, making troubleshooting difficult.
The converged architecture comes down to two sentences: all models are managed by one unified management service, and all calls go through one gateway that speaks a standards-compatible interface. The benefits are a single ledger for resources, a single source for configuration, and a single entry point for calls.
The unified management service should expose only four capabilities:
1. Budget ledger: register the estimated footprint and priority of each model2. Admission check: verify against the ledger plus a measured memory check before startup3. Lifecycle: idle reclamation, priority-based eviction, graceful shutdown4. Status reporting: expose metrics to monitoring systems to build a capacity dashboard
The unified gateway handles protocol adaptation, authentication, rate limiting, timeouts, and retries, hiding differences among backend model instances. The business side knows only one address and one interface, so switching models no longer requires code changes.
4. Memory Budget and Two-Stage Admission: Turning OOM into a Predictable Rejection
The most critical mechanism in unified management is admission control. Ledger-based budgeting alone is not enough, because once weights are mapped in they can hide in the page cache, and free-memory readings can be misleading: there appears to be room, but the reclaimable portion is not enough to support a new instance. Hence two gates.
The first gate is the ledger budget. Set a usable ceiling and a reserved floor for the whole memory pool, register an estimated footprint for each model, and check the ledger before startup, rejecting outright if the budget is exceeded.
The second gate is measured admission. Before startup, read currently available memory and require:
measured available memory ≥ reserved floor + ledger footprint + safety margin
Only when both gates pass is the instance allowed to start. The value here is turning “random crashes” into “predictable rejections”: the caller receives a clear error code instead of the whole machine being dragged down.
A sketch of the implementation (pseudocode):
def admit(model):if budget.used + model.estimate > budget.pool - budget.reserve:raise Rejected("over_budget")if mem_available() < budget.reserve + model.estimate + MARGIN:raise Rejected("insufficient_memory")budget.used += model.estimatereturn True
Eviction protection and idle reclamation are also needed: lower-priority instances are gracefully stopped first when the budget is tight, and instances with no requests for a long time enter a reclamation queue, freeing capacity for higher-priority work. Reclamation must be graceful: stop accepting new requests first, then wait for in-flight requests to finish, and only then release resources, avoiding a half-dead state.
5. Observability and Capacity Governance
Only after unified management does capacity governance have a data foundation. Collect at least four categories of metrics: total and allocated memory pool size, estimated and measured footprint per instance, number of admission rejections and their reason distribution, and load time plus first-token latency. These metrics answer three operational questions: whether the current capacity level is safe, which models have the worst cost-performance ratio, and where the context limit should be set.
In a cloud environment, you can put weights in object storage, wire metrics into monitoring and alerting, aggregate logs into a logging service, and run the management service and gateway on a container platform, smoothly extending a local practice into a team-level inference platform. The emphasis here is on general capability categories, not any specific implementation.
6. Selection Conclusion: Layer by Goal, Not by Parameter Ranking
Back to the original question: what model should you install locally? The answer is not a specific model but a decision framework.
- If the goal is an agent brain, long context, and multi-tool orchestration: prioritize a capacity-oriented unified memory approach, accept lower decoding speed, and note that tens of tokens per second measured in practice is enough for interactive tasks.
- If the goal is high-frequency completion or real-time conversation: prioritize a low-latency approach, and deliberately constrain model size and context.
- If the goal is team sharing: unified management and a unified gateway are mandatory, with budget, admission, reclamation, and observability built as platform capabilities.
Ultimately, local LLM selection is resource engineering: capacity preserves availability, budget and admission preserve stability, and a unified entry point preserves maintainability. Get these three solid, and model selection stops being guesswork and becomes an engineering problem you can calculate, verify, and evolve.
