# How to Deploy Open-Source LLMs Locally: Model Selection, Quantization, and Hardware Sizing
This guide walks through running a new generation of openly licensed, multimodal open-source LLMs on your own hardware. It explains how model architecture, total versus active parameters, context length, and quantization determine memory requirements; helps you match model tiers from E2B to 31B to 4 GB–32 GB memory configurations and launch them with an all-in-one runtime; and shows how to connect a local model to applications through a local API, native function calling, and performance tuning, security, and cost practices. It also covers how to split workloads between local and cloud models. You will walk away with practical rules for choosing models, estimating memory, and running local AI without token costs.
1. Why the New Generation of Open Models Is Worth Running Locally
Open models now iterate quickly, and each generation changes what they can do, how they are licensed, and how efficiently they run. One standout feature of the new open model family is that, for the first time, it is released under a permissive open-source license. That sharply lowers the barriers to commercial use, modification, and redistribution. With native function calling and native multimodal input on board, the point of these models has shifted from “more parameters” to “easier to embed in real applications.”
For developers and enterprise users, local deployment offers four benefits:
- Predictable cost. Local inference has no per-token fees, so the marginal cost of frequent, batch workloads drops sharply. Hardware and operations are fixed investments, which makes the total bill easier to calculate over the long run.
- Data stays under your control. Text, images, and other data never leave your machine. That makes local models a good fit for sensitive content such as contract drafts, internal documents, and code repositories.
- Offline availability and low latency. Models keep working without a network connection, and latency to the first token depends only on local compute.
- Customization and reproducibility. The permissive license lets you modify model weights, quantization precision, and inference settings, making it easier to tailor a model to a specific business.
Keep expectations realistic, though. A local model’s overall capability generally falls short of a comparably sized flagship model in the cloud. Complex reasoning, long task chains, and high-concurrency serving are still better handled in the cloud.
The sensible strategy is to let local models handle frequent, simple, sensitive tasks and route complex ones to the cloud. Together, they form a layered edge-cloud architecture.
2. Reading the Specs: Architecture Determines Memory, License Determines Boundaries
1. Parameter counts and model structure
Parameter count is the starting point for understanding every local deployment question. When estimating requirements, distinguish between total and active parameters:
- Dense models. Every inference run uses all the parameters. Both compute and memory use therefore grow linearly with parameter count.
- Mixture-of-Experts (MoE) models. These consist of multiple expert subnetworks, and each token is routed to only a few experts. Take a model with about 25B total and 4B active parameters. Its compute load is roughly that of a 4B dense model, so it runs nearly as fast as a small model. However, all the weights must stay resident in memory or VRAM, so memory requirements have to be estimated from the total parameter count.
The rule of thumb: size memory by total parameters, and size compute by active parameters.
2. Context length and multimodal input
The longer the context, the more memory the KV cache takes up. The KV cache holds the attention intermediate results for earlier tokens. Context length, the number of attention heads, and the number of model layers all affect its size, so leave memory headroom based on the context length you will actually use.
Multimodal inputs such as images and audio first pass through vision or audio encoders, then enter the model as tokens. This adds compute during the prefill stage, but it does not change the memory baseline set by the weights.
3. Quantization: trading precision for space
Quantization represents weights with fewer bits. It is the most direct lever for reducing memory use. At 4-bit precision, for example, each parameter takes about 0.5 bytes, roughly a quarter of a 16-bit half-precision weight. That gives you the following way to estimate the memory baseline:
4-bit weight footprint (GB) ≈ total parameters (B) × 0.5Actual memory requirement (GB) ≈ weight footprint + KV cache + runtime overhead (process context, temporary operator buffers, and so on)
In practice, allow 15%–25% headroom on top of your estimate. Quantization is not lossless. The lower the bit width, the more likely a model’s performance is to degrade on math reasoning, code generation, and coherence across long text.
For quality-sensitive scenarios, run the quantization candidates through your business evaluation set and compare their outputs before making a choice.
4. License: permissive does not mean unconditional
A model under a permissive license usually allows commercial use, modification, and redistribution, provided you meet the license’s conditions:
- Keep the original copyright and license notices.
- Note the modifications you made in any redistributed version.
- Comply with the use policy shipped with the model, that is, the acceptable use policy.
For commercial deployments, have your legal or compliance team review the specific license terms. This license overview is not legal advice.
3. Running an Open Model Locally: Three Steps to Get Started
Step 0: Take stock of your hardware
The first principle of model selection is to check your memory first, then choose a model. The new open model family comes in several sizes. The table below lists typical specs, estimated at 4-bit quantization:
| Tier | Size & architecture | Approximate memory after quantization | Input modalities & context | Typical use cases |
|---|---|---|---|---|
| Entry (E2B) | ~2.3B parameters, dense | ~2–3 GB | text/image/audio, ~128K tokens | Edge devices such as phones and low-power development boards |
| Lightweight (E4B) | ~4.5B parameters, dense | ~4–6 GB | text/image/audio, ~128K tokens | Everyday conversation, light text processing |
| Balanced (26B) | ~25B total, ~4B active (MoE) | ~14–18 GB | text/image, ~256K tokens | PCs with 24 GB-class unified memory or a 24 GB discrete GPU |
| Flagship (31B) | ~31B parameters, dense | ~17–20 GB | text, ~256K tokens | Complex reasoning and coding tasks; 32 GB or more recommended |
A quick rule of thumb covers all tiers:
Run E2B on 4 GB of memory, E4B on 8 GB, 26B on 18 GB, and 31B on 32 GB.
Before you deploy, check what kind of memory you have:
- Unified memory platforms: Memory doubles as VRAM, but the operating system and foreground apps use some of it. Estimate against the available capacity, not the nominal spec.
- Discrete GPU platforms: Look at VRAM, not system RAM. 24 GB of VRAM is a comfortable fit for the balanced tier.
- CPU-only platforms: Sufficient RAM is enough, but expect noticeably slower performance.
Large model files can run to a dozen gigabytes or more, so also set aside enough disk space.
Step 1: Install and launch an all-in-one runtime
An all-in-one local model runtime bundles model downloads, the inference engine, and a local API service into a single application. It is the option with the lowest barrier to entry. You can install it from the official installer or through your system’s package manager. Using a macOS-style package manager as an example:
# macOS-style command-line package manager shown as an example; on Windows/Linux, download the official installer$ brew install --cask ollama-app# Launch the app on macOS; after installing on Windows/Linux, start it from the Start menu or app list$ open -a Ollama
After launch, an icon appears in the menu bar or system tray. The background service takes a few seconds to a dozen or so seconds to finish initializing on first start. Compared with using a low-level inference engine on its own, an all-in-one runtime has several advantages:
- Models are distributed in ready-made quantized formats, so no manual conversion is needed.
- A built-in HTTP interface can connect directly to existing applications.
- Consistent behavior across platforms reduces environment setup effort.
Step 2: Pull a model and start a conversation
All-in-one runtimes usually use model tags to identify different sizes and quantization versions. For the balanced tier:
# The first run downloads the model automatically; check the runtime's model list for the exact tag$ ollama run gemma4:26b
Once the download finishes, you land in the chat interface. Ask any question; if you get a coherent answer, the deployment succeeded. At this tier the quantized model is about 18 GB, so download time depends on your bandwidth. Start the download when your connection is stable.
Step 3: Check runtime status and verify inference placement
$ ollama psNAME ID SIZE PROCESSOR UNTILgemma4:26b 2fd0271459ab 17.6 GB 14% CPU/86% GPU 4 minutes from now
In the output above, about 86% of the inference workload runs on the GPU and the CPU handles the rest. This is a typical result of hybrid CPU/GPU inference:
- Unified memory platforms: The CPU and GPU share the same physical memory. Most computation can go to the GPU, and data does not need to be copied between devices.
- Discrete GPU platforms with insufficient VRAM: Some layers are offloaded to the CPU for computation. Speed drops as the offloaded share grows.
If the model stays resident in memory, as shown by the “4 minutes from now” countdown above, later requests do not need to reload it. If you would rather free up resources promptly, adjust the runtime’s keep-alive setting.
4. Connecting to Applications: Turning a Local Model into a Programmable Capability
1. Native function calling takes models from chatting to acting
Native function calling means a model is specifically trained to output structured tool-call requests during a conversation, such as a function name and JSON arguments. The host program parses the request, runs the function, and sends the result back to the model, which then generates the final answer.
Compared with the old approach of having the model write its own code to run, native function calling produces more stable output that is simpler to parse. It is also a key capability for connecting local models to AI coding tools and task orchestration frameworks.
2. A unified API style lowers migration costs
Most all-in-one runtimes expose a local HTTP interface by default. Its common API style resembles an interface widely used in the industry. Applications built on that style can often move to a local model by changing only the endpoint URL and key configuration:
# Illustrative example: connecting to a local inference service with an OpenAI SDK-compatible clientfrom openai import OpenAI# Replace base_url and api_key with the actual address exposed by your runtime and a placeholder keyclient = OpenAI(base_url="http://localhost:11434/v1", api_key="local")stream = client.chat.completions.create(model="gemma4:26b", # replace with the model tag you actually pulledmessages=[{"role": "user", "content": "Explain mixture-of-experts models in one sentence"}],stream=True,)for chunk in stream:if chunk.choices and chunk.choices[0].delta.content:print(chunk.choices[0].delta.content, end="", flush=True)
Keep these points in mind when moving to a local model:
- The local service’s interface may not cover the same fields as the cloud service, such as JSON mode constraints and tool choice policies. Verify each feature individually before going live.
- Local models are typically less reliable at tool calling than large cloud models. For workflows involving multi-step tool orchestration, add argument validation, timeouts, and retries.
5. Performance Tuning: Getting More from Limited Hardware
- Prefer MoE when memory allows. A balanced-tier MoE model can decode at speeds close to a small model without sacrificing much quality. It is the best value on consumer hardware.
- Control context length. Longer is not always better, because the KV cache grows with the context. Set an upper limit based on actual needs to improve both memory use and stability when generating long text.
- Understand the bottleneck. Model generation decodes one token at a time. Speed is limited mainly by memory bandwidth, not peak compute. Upgrading memory channels or choosing a higher-bandwidth platform often helps more than raising clock speeds.
- Manage temperature and power. Sustained inference heats up devices and can trigger thermal throttling. Laptop users should keep good airflow and set up temperature monitoring for long runs.
- Use streaming output. Streaming significantly reduces perceived latency, letting users start reading as soon as the first token arrives.
6. Security and Cost: Local Does Not Mean Zero Cost
- Cost structure: Local inference eliminates token fees, but hardware depreciation, electricity, deployment maintenance, and model updates still cost money. Frequent, lightweight tasks usually work out cheaper once costs are spread across usage. For infrequent, complex tasks, compare carefully with traditional services.
- Interface security: All-in-one runtimes usually listen only on the local loopback address by default. Do not expose them to the public internet or a shared network without authentication. If you really need to share on a LAN, enable authentication, restrict sources, and configure a reverse proxy.
- Trusted sources: Obtain both the runtime and models from official channels, and be wary of “optimized” weights from unknown origins. On infrastructure you control, also guard against risks such as prompt injection across layers. These include runtime images, data volumes, and model caches.
- Privacy boundaries: Running a model locally does not mean you can keep data however you like. Scenarios involving personal information need management practices such as data minimization, log redaction, and retention limits.
7. Conclusion: The Core Formula for Local Deployment
Back to the original question: how should you think about the new generation of open models? Three points are worth remembering:
- Capability is rapidly reaching consumer hardware. An ordinary laptop can already run decent small and mid-sized models.
- Looser licensing lowers the barrier to commercialization, but compliance obligations still need to be met item by item.
- The model is not the only thing that shapes the experience. Hardware sizing, quantization strategy, and how you connect the model matter just as much.
Condensed into a formula:
Useful local AI ≈ a right-sized model + matching hardware + an all-in-one runtime + a sound quantization strategy
Start by checking your memory, pick a model with the rule of thumb above, and connect it to your applications through a unified API. An ordinary computer can then become a local AI workstation with zero token costs.
