1. Define the problem before choosing a model
A local model runs inference on hardware you control instead of sending each request to a remote service. This can reduce exposure of data to third parties and allow offline operation after the model and its dependencies have been downloaded. It does not guarantee privacy by itself: an interface, plugin, activity log, or connected tool could still transmit information.
Start by describing the task, permitted data, minimum quality, and expected workload. A small model may be enough to classify messages or extract fields; an assistant that uses tools, interprets complex documents, or handles long conversations needs more demanding tests. Parameter count alone does not predict performance for your use case.
Initial requirements worksheet
Complete this worksheet before comparing models. Set measurable thresholds and record who approved them.
- 01Task: specify the input, the output, and what counts as a consequential error.
- 02Data: classify its sensitivity and decide whether it may leave the local network.
- 03Quality: define acceptance criteria using representative examples and edge cases.
- 04Workload: estimate requests per minute, concurrent users, and typical context length.
- 05Operations: set maximum latency, availability, hardware budget, and update requirements.
2. Select a model, license, and format
Compare candidate models that can run in your environment and whose licenses permit the intended use. Check the model’s official documentation for its architecture, size, context limits, languages, multimodal capabilities, and redistribution terms. Also confirm that your chosen runtime supports that architecture and the specific weights variant. A high parameter count or active community does not prove that a model is suitable for production.
GGUF is a common format in llama.cpp-based workflows and compatible tools, but it is not a universal requirement for local inference. Other stacks use different formats and engines. For each candidate, record the exact identifier, weights revision, format, quantization, runtime, and configuration. This makes tests reproducible and helps you spot changes after updates.
Task-based model selection matrix
Use this matrix to prioritize testing, not as a guarantee of capability. The final choice depends on measured results with your data and constraints.
| Need | What to verify | Initial test |
|---|---|---|
| Classification or extraction | Output format, consistency, and error rate by field | Evaluate labeled examples and count critical errors |
| Multilingual assistant | Quality in the languages actually used and response to instructions | Test real requests written by users |
| Tool use | Runtime support for structured calls and failure handling | Test a valid call, an unknown name, and a malformed response |
| Long documents | Effective context, memory use, and retrieval of relevant information | Compare questions about the beginning, middle, and end of documents |
| Edge or CPU deployment | Total memory, speed, and resource use | Measure on the target device, not a different machine |
3. Establish a baseline before quantizing
Quantization reduces the numerical precision of model weights or other values to save memory and, depending on the hardware and runtime, may change inference speed. The savings can make it possible to load models that would not fit in a higher-precision representation, but quality may decline. The effect depends on the model, method, task, and backend: do not promise a fixed loss or assume that a four- or five-bit label alone predicts the result.
Q4_0, Q5_1, and Q4_K_M are not interchangeable names. These variants belong to different formats and schemes; check the quantization description and actual file size before downloading. LoRA, meanwhile, is an adaptation technique that uses additional parameters, not a quantization level. It can be combined with some quantization workflows, but it is not equivalent to Q4 or Q5.
4. Size memory and hardware with headroom
A preliminary estimate of weight storage is the number of parameters multiplied by the number of bytes used to represent them. For example, a seven-billion-parameter model in FP16 requires about fourteen billion bytes for its weights, before accounting for other demands. With four-bit quantization, the idealized weight calculation is lower, but neither file size nor actual memory use exactly matches that minimum: metadata, scales, tensors retained at another precision, and runtime requirements all matter.
VRAM matters when layers are offloaded to a GPU; system RAM can support CPU inference or hold parts that do not fit in the GPU. Conversation context, the KV cache, activations, and concurrent requests also use memory. That is why a file that appears to fit in VRAM can fail at startup or run out of memory with long contexts. File size is useful for filtering options, not for final hardware sizing.
Memory to budget for
Measure peak usage during model loading and under the intended workload. Leave headroom for the operating system and concurrent processes.
| Component | What it uses | How to check |
|---|---|---|
| Weights | Parameters and the selected representation | Artifact size and memory after loading |
| Context and KV cache | Input and generated tokens per session | Compare memory use with short and long contexts |
| Runtime and system | Buffers, libraries, interface, and operating system | Observe peak usage for the process and whole machine |
| Concurrency | Simultaneous sessions and batches | Test with the expected number of users |
| CPU offloading | Layers that do not fit in VRAM | Measure latency and system RAM when offloading is enabled |
5. Configure privacy and offline operation
Local inference can keep data on the device, but “local” does not automatically mean “isolated.” Model downloads, updates, telemetry, web interfaces, proxies, extensions, and logs can generate network traffic. Identify every component and specify which network destinations it needs. If the system must work without internet access, download and verify the weights, dependencies, and licenses in advance; then test outbound blocking in the actual deployment environment.
Use network segmentation and least-privilege firewall rules. Limit access to the inference endpoint, avoid exposing it directly to public networks, and protect logs. Treat prompts, responses, and documents as sensitive if they contain internal information. An offline test should confirm that the application works without external calls, not merely that the model has already been downloaded.
Isolation test before deployment
Run this check in a production-like environment and retain the results as part of the release record.
- 01Inventory the runtime, interface, plugins, proxies, repositories, and telemetry services.
- 02Define the destinations strictly required for installation and operation.
- 03Block unauthorized outbound connections with a firewall or equivalent network controls.
- 04Capture and review connection attempts during startup, inference, and an update.
- 05Disconnect the internet and repeat critical workflows; confirm that no data is transmitted and no hidden dependency breaks.
- 06Restrict the endpoint to authorized clients and define log retention and access.
6. Validate quality, latency, and throughput
Evaluate each configuration with a stable, representative test set that is separate from examples used to tune prompts. For quality, choose metrics that fit the task: accuracy or F1 for classification, correct-field rate for extraction, and human review using consistent criteria for open-ended responses. BLEU and ROUGE can be useful for some text-comparison problems, but they do not replace checks for factuality, instruction following, or risk; high lexical overlap does not prove that an answer is correct.
Measure load time, time to first token, total response time, and tokens per second. Distinguish a cold run from one with the model already loaded. Record hardware, driver, runtime, model version, quantization, context, batch size, and concurrency. Local inference removes some network latency, but does not guarantee lower end-to-end latency: the result depends on the device, model, and workload.
Minimum evaluation record
Keep one row per configuration and repeat the test to detect variability. Do not compare figures measured under different workloads.
| Dimension | Metric or evidence | Conditions to record |
|---|---|---|
| Quality | Errors by category, success rate, and edge-case review | Dataset, rubric, and prompt version |
| Latency | Time to first token and total response time | Cold or warm load, input length, and output length |
| Throughput | Tokens per second or requests completed per interval | Batch size and number of concurrent sessions |
| Resources | Peak VRAM, RAM, and CPU/GPU use | Machine, runtime, and maximum context |
| Security | Network connections and endpoint access | Applied rules, traces, and offline-test result |
7. Version and maintain the service
Pin the versions of the weights, quantization, runtime, libraries, and configuration. Keep checksums for artifacts when available, and store models in controlled locations. Before updating, rerun quality, performance, compatibility, and isolation tests. An update can change responses, memory use, or tool behavior even if the model’s commercial name looks similar.
Monitor errors, memory saturation, latency, and availability. Define a rollback procedure to a tested version and a policy for removing vulnerable artifacts or those with unsuitable licenses. If the system uses tools, apply least-privilege permissions and validate calls before executing them; a local model can still produce incorrect instructions or manipulated content.
8. Checklist and practical decision criteria
The right choice is the smallest, simplest configuration that meets measured requirements—not necessarily the largest model or the most aggressive quantization. If an option misses the quality threshold, change the model or configuration and evaluate again. If it exceeds memory or latency limits, first review context, concurrency, and how work is split between CPU and GPU.
The available sources support general principles of quantization and document options for a particular platform, but they do not establish a universal quality loss for moving from FP16 to a specific quantization, nor universal VRAM requirements for 7B or 13B models. Those values must be verified for the specific artifact, runtime, task, and hardware.
Deployment approval checklist
Mark each item complete only when supporting evidence is attached, not merely when there is an intention to address it.
- 01Model, license, weights revision, and format are identified.
- 02Quantization has been compared with a reference on representative tests.
- 03VRAM, RAM, and context memory have been measured at expected concurrency.
- 04Quality and latency meet agreed thresholds and results are recorded.
- 05Endpoint access is restricted and outbound connections are verified.
- 06Offline operation has been tested if it is a requirement.
- 07Versions, checksums, monitoring, and rollback are documented.
Open questions
- No primary evaluation provided here quantifies the quality difference between FP16 and Q5_1 for a specific model and task; there is no supported universal percentage.
- Exact VRAM and RAM requirements depend on the model, quantization, context, runtime, hardware, and concurrency; measure them before deployment.
- Running inference locally does not by itself prove that the whole system is offline or that no component transmits data.
- BLEU and ROUGE may not adequately represent factuality or usefulness in open-ended tasks; select metrics that match the objective.
Keep exploring
Sources consulted
Corrections and transparency
If you spot incorrect or outdated information, send us a correction with the page and source we should review.
Submit a correction