DEV Community

Cover image for Sizing a private LLM: memory math and a test set before any hardware
Dev Station
Dev Station

Posted on Edited on

Sizing a private LLM: memory math and a test set before any hardware

Local and private LLM: the model runs inside your boundary and prompts never leave

Teams that move an LLM in-house often start by buying a GPU. That order is backwards. The data rules and a test set decide which model you need, and the model decides the hardware.

We wrote a longer guide on when data cannot leave the building and how to run a local or private LLM. This post keeps to the sizing work an engineer does first.

Estimate memory from parameters

PromptQuorum gives a rule of thumb: about 0.6 GB of VRAM per billion parameters at 4-bit quantization, plus 1 to 2 GB of headroom for context.

def vram_gb(params_b, headroom_gb=2.0, gb_per_b=0.6):
    return params_b * gb_per_b + headroom_gb

for size in (7, 13, 70):
    print(size, "B ->", round(vram_gb(size), 1), "GB")
Enter fullscreen mode Exit fullscreen mode

The estimate holds up. The same source reports the Llama 3.3 70B file at 4-bit as 42.52 GB. Without quantization the number jumps: Spheron puts a 70B model near 140 GB at FP16. CPU-only setups need roughly double the memory and answer far more slowly.

Pick the smallest model that passes

Collect 50 to 100 real questions with answers your team accepts. Run every candidate model against the same set. Move up a size only when the smaller one fails, since each step adds memory and cost.

Serve it like an API

Runtimes such as Ollama, llama.cpp and vLLM put the model behind an HTTP interface. Your application code stays close to what a hosted API needs, so you can route sensitive prompts to the private model and general questions to a vendor API.

Checklist before the pilot

  • [ ] Every document and field the model will see is classified
  • [ ] The test set comes from real work, with accepted answers
  • [ ] Hardware is sized by memory and by concurrent users
  • [ ] Access control and logging sit in front of the model
  • [ ] There is an update path, including for air-gapped sites

The last two items are the ones teams skip. A self-hosted model removes the vendor from the path, but the security work then lands on you: patching, who can query the model, and what goes in and out.

Dev Station designs and builds the systems around a private LLM and integrates the model into the software a client already runs. The full guide, with a decision table and GDPR notes, is at dev-station.tech/local-private-llm.

Top comments (0)