Open-Source LLM Local Deployment Guide: Choosing Licenses, Model Sizes, and VRAM
Learn how to evaluate open-source LLM licenses, estimate memory requirements, choose between MoE and dense architectures, understand quantization trade-offs, deploy models with Ollama, and prepare a local inference setup for production workloads.
1. Check the License Before the Benchmark
When choosing an open-source model, review its license before comparing benchmark scores. “Open source” does not automatically mean “available for commercial use.” Some models are restricted to research, while others impose limits based on user scale or industry. Certain licenses may also require attribution or prohibit specific use cases.
Focus on three questions:
- Is commercial use allowed?
- Can the model be modified and fine-tuned?
- Can derivative models be redistributed?
Add these items to your selection checklist and evaluate them alongside model performance. Always refer to the full license on the model publisher’s official page rather than relying only on third-party summaries.
2. Choose Model Size Based on Memory
A rough estimate for model weight memory is:
Weight memory ≈ parameter count × bits per parameter ÷ 8
For example, a 31B-parameter model at 4-bit quantization requires approximately 15.5 GB for its weights. Actual runtime usage is higher because you must also account for the KV cache, which grows with context length, inference framework overhead, and additional components such as multimodal encoders.
This estimate provides several broad sizing ranges:
- Small models, from a few billion parameters: Their weights generally fit within a few gigabytes. They are suitable for laptops, mobile devices, and embedded systems, as well as lightweight tasks such as simple question answering, classification, and summarization.
- Medium models, from the low teens to the twenties of billions of parameters: Many desktop workstations with substantial memory can run them. Typical use cases include everyday writing and coding assistance.
- Large models, around 30B parameters: These require significantly more memory. At least 32 GB of system memory or VRAM is recommended. They are suitable when response quality for individual requests is the priority.
This guide does not provide benchmark results for specific models. Before selecting one, check the file size listed on its model page and load it on the target machine to measure memory usage and response speed. For mixture-of-experts models, total parameter count still determines the required memory, as explained below.
3. Understand the Trade-Off Between MoE and Dense Architectures
A mixture-of-experts (MoE) model contains multiple expert subnetworks but activates only a subset of them for each inference step. As a result, the computation required for each token can be closer to that of a smaller model, helping reduce latency and increase throughput.
The trade-off is that the weights of all experts still need to be loaded into system memory or VRAM. Memory requirements are therefore determined by the total parameter count, while the number of active parameters mainly affects computational workload.
A dense model uses all of its parameters for every inference step. At the same overall scale, it requires more computation, but its structure is simpler. The relationship between memory usage and compute demand is also easier to predict when VRAM or memory bandwidth is limited.
Use the following guidelines:
- For latency-sensitive services with higher concurrency, consider MoE models first, but confirm that memory can hold the weights of all experts.
- For limited VRAM and single-user workloads, a smaller dense model is usually easier to run.
- If the priority is the highest possible quality for individual responses and sufficient compute is available, consider a large dense model.
Some inference frameworks can offload expert weights or selected layers to system memory. This reduces VRAM pressure but increases latency, so the effect should be measured under the expected workload.
4. Quantization: Balancing Quality and Model Size
Quantization compresses a model by reducing the numerical precision of its weights. Compared with FP16 or BF16, 4-bit quantization reduces weight storage to approximately one-quarter. Compared with FP32, it reduces storage to approximately one-eighth. 8-bit quantization requires roughly half the storage of FP16.
4-bit quantization is a common choice for local deployment, but it can reduce output quality. The impact depends on both the model and the task. Code generation, mathematical reasoning, and structured output can be particularly sensitive to precision loss.
To determine whether a quantized version is suitable, compare it with the higher-precision version on your own task set. Do not rely only on general impressions.
For inference acceleration, some local tools can use machine-learning backends provided by the operating system to place most computation on a GPU or an accelerator that uses unified memory. In Ollama, for example, the command below displays the processor allocation:
ollama ps
If the processor column shows 14%/86% CPU/GPU, most computation is being handled by the GPU. A low GPU percentage commonly has one of three causes:
- Insufficient VRAM, causing some layers to be offloaded to the CPU
- An incompatible driver or backend version
- A model that exceeds the capacity of the acceleration device
5. Deployment Workflow: From Installation to API Integration
The following workflow uses Ollama as an example. Other local inference tools generally follow similar steps.
1. Install the runtime
Download the installer for your operating system from the official source. After installation, verify the version:
ollama --version
2. Select a model tag and pull the model
Model tags often identify the parameter size and quantization method. Check the tag and file size in the model repository before running:
ollama pull model-name:tag
Model files can be large, so allow sufficient download time and confirm that adequate disk space is available.
3. Run an interactive test
Start the model with:
ollama run model-name:tag
Send several prompts to confirm that responses are generated correctly. Then open another terminal and run:
ollama ps
Check memory usage and the CPU/GPU allocation.
4. Connect through the HTTP API
Ollama listens on 127.0.0.1:11434 by default, allowing access only from the local machine. You can test the API by sending a JSON request containing the model name and prompt to /api/generate.
If access from a local network is required, change the listening address and configure the firewall and reverse proxy. Add authentication, and do not expose the port directly to the public internet.
Common Troubleshooting
- Out-of-memory errors or terminated processes: Use a smaller model or a lower-precision quantized version, and close other memory-intensive applications.
- Significantly slower responses: Use
ollama psto check GPU utilization, verify the driver, and reduce the input context length. - Interrupted downloads: Run the pull command again. Most tools can reuse the portion that has already been downloaded.
6. Production Recommendations
Getting a model running locally is only the beginning. A real application also needs to address the following areas.
- Concurrency and throughput: A single instance may not support multiple users at the same time. Consider an inference service with batching and continuous batching, then use load testing to determine the concurrency a single GPU can handle.
- Context management: Long-context support can be valuable, but longer inputs increase memory usage and time to the first token. Retrieval-augmented generation and summarization can help control the actual input length.
- Security and access control: Protect the API with authentication, avoid recording sensitive inputs in logs, and filter model outputs where necessary. If personal information is processed, review the applicable data-compliance requirements.
- Monitoring and evaluation: Track latency, error rates, and output quality. Maintain a fixed regression test set and run it whenever the model version or quantization method changes.
- Cloud-edge collaboration: Route simple requests to a small local model and send more complex tasks to a larger cloud model. This can balance cost, privacy, and quality. For cloud-hosted inference, container platforms and object storage can help build elastic services, but the specific design should match the team’s existing cloud environment.
7. Conclusion
The barrier to running open-source LLMs locally has fallen significantly. Many small and medium-sized models now run on ordinary desktop hardware. A practical selection process is to verify the license first, estimate the required model size with a memory formula, test quantized quality and speed on your own tasks, and then address concurrency, security, and monitoring before deployment.
Following this order can prevent most avoidable rework.
