Selecting and Deploying Local Large Language Models
A practical guide to evaluating and running LLMs on your own hardware: data residency, latency, cost, model discovery, VRAM and KV-cache limits, and turning one-off trials into repeatable, rollback-ready services.
Running a large language model locally means trading off parameters, compute, VRAM, latency, and data boundaries under one set of constraints. Leaderboards change quickly, so treating a snapshot ranking as a long-term plan is risky. A more durable approach is to fix three workflows: how you continuously find usable models, how you use local or datacenter resources to decide whether a model will load and whether it is good enough, and how you turn a one-off trial into a repeatable service.
Clarify what local deployment must solve
Local deployment usually serves three needs. First, data stays in your environment: prompts, retrieval corpora, and business logs do not leave your network. Second, latency and availability stay under your control, without public-internet jitter. Third, cost becomes more predictable: high concurrency or long context can be amortized over hardware and operations instead of per-call billing.
Write acceptance criteria before you install anything. “It can chat” is not enough. At minimum, specify first-token and end-to-end latency limits, acceptable concurrency and queue length, context window and output length, whether function calling or structured output is required, whether retrieval-augmented generation is needed, and whether you can fall back to a smaller model. If criteria are vague, “it just fits in VRAM” is easily mistaken for “it is production-ready.”
Keep finding usable new models
You do not need to bind tracking to a single website. Split sources into four layers and set an update cadence.
Model repositories and mirrors. Filter public model hubs by task, parameter scale, license, and recency, then sync into an internal artifact store. Check that weight files are complete, shards are verifiable, and tokenizer and config match the weight version. Prefer a compliant internal mirror rather than pulling onto production machines ad hoc.
Technical reports and release notes. Models with the same parameter count can differ in training data, alignment, and context implementation. Note whether pretraining and instruction tuning are separate, whether quantized weights are provided, whether the license allows commercial use and redistribution, and whether known weaknesses hit your tasks (long documents, code, multi-turn, tool use).
Build a small evaluation set. Public benchmarks are only a first filter. Use tens to hundreds of desensitized business samples as a fixed regression: factual QA, format following, refusal boundaries, and whether retrieval citations are fabricated. Run the same prompts and sampling settings three times and watch variance. “Does not regress on your distribution” matters more than “newest.”
Keep the candidate pool thin. Hold a primary model, a smaller fallback, and one experimental slot. New models enter the experimental slot and replace the primary only after regression, so you do not switch everything every week.
Use hardware to decide “will it load” and “will it serve”
VRAM comes first, then RAM, disk, and CPU. Weight size is roughly parameter count times bytes per parameter: about two bytes for half precision, one for 8-bit, half a byte for 4-bit, plus overhead. A 7B–8B model is on the order of tens of gigabytes in half precision and a few gigabytes at 4-bit; use actual file size and runtime allocation, not the nominal parameter count alone.
Weights are not enough. KV cache grows with batch, context length, and layers; long context or higher concurrency can overflow VRAM that was enough to load. Split peak VRAM into weights + runtime cache + framework reserve. Multi-GPU splits add communication buffers. RAM must cover load, tokenization, and request queues; disk must hold multiple weight versions and logs.
Use three tiers, not a binary yes/no:
- Can load: one generation at minimum batch and short context, for functional checks.
- Can serve: target concurrency and context, stable VRAM, no constant paging, latency within acceptance limits.
- Can operate: health checks, rate limits, canary and rollback; a single-GPU failure does not take all traffic down.
Precision should match the task. 4-bit or lower fits tight resources and wording that can tolerate some noise. For code, calculation, and strict structured output, compare at higher precision first and switch only if quantization does not degrade clearly. Longer context is not always better: it inflates cache and prefill time. Chunk documents and use retrieval to keep effective context to what the job needs.
CPU and iGPU can run small or highly compressed models, but throughput is usually far below a contemporary accelerator. That is better for personal trials or low-concurrency internal tools than for production concurrency targets.
Turn a trial into a repeatable deployment
Use a vendor-neutral path.
Pin the environment. Record OS, drivers, inference runtime, quantization format, and launch parameters in one inventory. Archive weights, tokenizer, and config with checksums. Containers (or equivalent) reduce “it works on my machine” drift.
Separate inference from the service layer. The inference process only loads and generates. In front, a shared service handles auth, rate limits, timeouts, request logs, and model routing. Keep a stable API shape (chat completion and streaming) so applications do not rewrite when the model changes. Manage sampling defaults (temperature, stop rules, max generation length) in the service layer so callers do not each invent their own.
Illustrative launch constraints as config, not a locked command set:
model_path: /models/currentprecision: int4max_context: 8192max_batch: 4max_new_tokens: 1024timeout_ms: 30000
Before go-live, run four checks. Function: output structure on fixed prompts stays stable. Resources: VRAM and RAM do not climb in steps under continuous load. Failure: overlong input, empty input, and concurrency spikes fail gracefully instead of crashing the process. Security: system prompts cannot be overwritten by user text, sensitive logs are redacted, weight directories have least privilege.
Ship with a canary. Shift a small share of traffic, compare latency, error rate, and sampled quality, then go full. Keep the previous weights and config; rollback should be a routing change, not a re-download.
Capacity, cost, and cloud burst
Single-machine VRAM is a hard bound. As concurrency rises, typical levers are shorter context, smaller batches, higher compression, a smaller model for simple requests, and retrieval instead of stuffing whole documents into the window. Multi-GPU parallelism can raise what you can load, but communication and sharding change latency; re-measure on real traffic instead of scaling linearly.
If you lack enough accelerators, or need extra capacity only at peaks, store weights in object storage and bring up the same inference inventory on GPU-capable cloud compute, with the data path back to your network over a private or encrypted channel. Cloud resources such as Baidu AI Cloud can act as elastic overflow: general VMs or containers for inference, object storage for weight versions, logs and alerts for latency and errors. The overflow environment must reuse the same checksums, rate limits, and canary process so “it runs in the cloud” does not mean different online behavior. Cloud here is compute and storage only; it does not replace your duties on licenses, data classification, and access control.
A minimal closed loop
Week 1: set a parameter-size ceiling from VRAM, build a desensitized regression set, pin a small model and a primary. Week 2: quantization comparison, VRAM curves versus context and concurrency, service-layer rate limits and timeouts. Week 3: canary, metrics (latency percentiles, reject rate, VRAM watermark), and rollback drills. After that, new models enter only the experimental slot each month and replace the primary only after regression.
Whether a local LLM is worth deploying does not depend on whether it is this month’s newest model. It depends on whether you can state resource limits, a quality floor, and a rollback path. Once discovery, evaluation, deployment, and observation are a fixed process, fast model churn is a slot swap, not a rebuild.
