VRAM, model size and context length for Ollama

Estimate Ollama VRAM from model size, quantization, context window and parallel requests, and keep models fully on the GPU so responses stay fast.

On this page

How to size VRAM for Ollama models before you buy or deploy

Size the GPU memory before you choose hardware. VRAM has to hold the model weights, the context cache and the extra memory each parallel request adds, and if any part spills into system RAM and runs on the CPU, responses slow down noticeably. A team planning a private model server needs this estimate before buying cards, because a wrong guess is expensive to fix after the hardware is racked. Ollama is an open source runtime for running large language models locally. It is licensed under MIT, uses a llama.cpp backend, and exposes a REST API on port 11434 that applications and user tools call. Running models on your own hardware carries no Ollama usage fee, so the main cost of the server is the hardware and the staff who run it.

Sizing work becomes necessary when a team moves from a single workstation to a shared server, when it picks a model larger than the one it has tested, or when it wants longer context windows for document work. Each of these changes the memory budget. Start by listing the models you plan to serve, the quantization each will use, the context length your users need, and the number of requests you expect to run at once. Ollama's default of one parallel request per model is a useful baseline, but a shared server usually needs more, and each added slot reserves additional memory. Confirm these settings against the Ollama FAQ and the release notes for the version you plan to install, since defaults and memory behavior can change between releases.

Test the estimate on hardware you already have before you commit to a purchase. Load the largest planned model, send a realistic prompt at the context length you expect, and check with ollama ps whether the model is fully on the GPU or partly on the CPU. A partial load is the signal that VRAM is short, and the fix is more memory, a smaller model, a lower quantization or fewer parallel slots, not a higher context limit that the card cannot hold. Ask your hardware vendor and your Ollama support contact to confirm that the GPU class you are considering is supported, and record the measured memory use so your purchase and capacity plan rest on evidence rather than a rule of thumb.

What consumes memory in an Ollama deployment

Memory use on an Ollama server comes from four places that add together: the model weights, the KV cache that grows with context, the extra cache each parallel slot needs, and runtime overhead. Sizing one without the others is the most common reason a model that loaded fine in testing spills to system memory in production.

Model weights set the baseline

The weights are the largest fixed cost and scale with parameter count and quantization. A higher-parameter model at a lower-bit quantization can use less memory than a smaller model at higher precision, so compare the exact quantized files you plan to pull rather than the parameter count alone. Check the size reported for each tag in the Ollama library and the loaded size shown by ollama ps after a test run, because both depend on the Ollama version in your environment.

Ollama FAQ

KV cache grows with context

The key-value cache stores attention state for every token in the context window, so memory rises as the context length rises. It is allocated per loaded model and per slot, which means a model that fits at a short context can fail to fit at a longer one on the same GPU. Confirm the context length you configure and the cache type in use, since both change the figure. Do not assume a single number from a model card applies to your server.

Parallel slots add per-request memory

Each parallel request that Ollama serves for a loaded model needs its own share of context memory. Raising the parallel setting therefore increases VRAM use even when the weights stay the same, and the increase can push a model off the GPU. Review the value of OLLAMA_NUM_PARALLEL together with the context length, because the two multiply. Test with the concurrency your users will generate, then measure the result.

Runtime overhead needs headroom

The runtime, GPU driver and compute buffers take memory beyond the weights and cache. This overhead varies by platform, backend and Ollama release, so it cannot be fixed from a table. Leave headroom on the card rather than sizing to the exact weight file size, and recheck after each Ollama upgrade. Also watch for other processes on the same GPU, such as desktop sessions or other inference services, which reduce the memory Ollama can use.

Verify every figure in your environment

Published model sizes, context defaults and overhead values are starting points. Confirm exact figures against the specific model tag, quantization and Ollama version running on your hardware, and record the loaded size and offload status after representative load. Repeat the check when the model, context setting, concurrency setting or Ollama version changes, because any one of them can shift the total.

Ollama releases

Settings that change memory use and when each fits

This table compares the settings that change how much VRAM an Ollama server needs, including model size, quantization, context length and the concurrency variables. Read each row for when the setting fits and what it costs in memory or throughput. The main takeaway is that concurrency and loaded-model settings multiply memory use, so they should be sized after the model and context are chosen.

LeverWhen it fitsMemory or throughput cost
Model size and quantizationChoose the smallest parameter count and quantization that still meets your quality bar for the taskWeights load into VRAM first; larger parameter counts and higher-precision quantizations raise the floor before any context is added
Context window settingRaise it only when prompts or documents need the longer window and you have confirmed the model supports itThe KV cache grows with context length, so a longer window can push a model that fits at short context into CPU offload
OLLAMA_NUM_PARALLEL (default 1 per model)Keep at 1 for single-user or batch workloads; raise it when several users share one loaded modelEach parallel slot reserves its own context memory, so VRAM use grows with the slot count and the context size
OLLAMA_MAX_LOADED_MODELS (default 3 per GPU, or 3 on CPU)Lower it when several large models compete for one GPU; raise it only when you need several models resident at onceEach resident model holds its own weights in memory, so extra loaded models force evictions or offload that slow responses
OLLAMA_MAX_QUEUE (default 512)Tune it to the wait time your users will tolerate, and lower it when queued requests would only time outQueue depth uses system memory for pending requests rather than VRAM, but long queues delay responses without adding capacity
Partial CPU offloadAcceptable only for occasional requests on models that do not fit; confirm with ollama ps that the split is what you expectLayers held in system RAM run far slower than VRAM-resident layers, so response times rise sharply under sustained load

Why CPU offload slows responses and how to spot it

When a model or its context does not fit in VRAM, part of the work moves to system RAM and the CPU, and token generation slows noticeably. The GPU handles the layers it can hold, while the remaining layers run on the processor, which is slower at the matrix operations that dominate each generated token. The same thing happens to the KV cache as context grows. The result is a server that still answers, so the problem often goes unnoticed until users complain about speed. Before you accept any throughput figure from a benchmark or a test run, confirm that the model ran fully on the GPU in the environment you plan to use.

Check placement with ollama ps while a model is loaded. The processor column shows how the model is split between CPU and GPU, and a figure that includes CPU means part of it is offloaded. Then read the Ollama server logs, which record how many layers were assigned to the GPU at load time and whether GPU detection succeeded. Repeat the check after changing OLLAMA_NUM_PARALLEL or sending long prompts, because both raise memory use after the first load. The exact log wording varies by release, so confirm the current messages against the Ollama FAQ and your installed version before you write alerting rules around them.

The fix is usually one of four changes, and each has a cost. A smaller model or a lower quantization reduces weight memory, but it can reduce answer quality, so test your own tasks before switching. A shorter context window frees cache space, but it limits how much document or conversation history a request can carry. Adding VRAM, by a larger GPU or another card, removes the offload but adds hardware cost and power. Reducing parallel slots also lowers memory growth, at the expense of concurrent throughput. Decide which trade-off your users can accept, then re-run ollama ps to confirm the model now sits entirely on the GPU.

How weights, context and parallel slots fill GPU memory

The diagram starts with the model choice, since parameter count and quantization set the weight footprint. The next hand-off sets the context window and the parallel request count, which together size the KV cache that grows with each active request. The decision then asks whether the total fits in GPU memory. If it does not, the path branches to shrink the footprint or add GPU capacity, and the server should keep the model fully on GPU rather than offloading layers to system memory.

Decision path from model choice to a fully GPU-resident deployment.

Sizing steps to run before a deployment

This sequence turns a list of intended models and users into measured memory figures on a test server, so the production hardware decision rests on observed placement and headroom rather than estimates alone. Each step closes with a check the team can record.

  1. List target models and their use

    Write down every model the deployment must serve, the workload each one handles (chat, coding help, summarization, embeddings or classification), the longest prompt and answer you expect, and which teams will call it. The product owner and the platform engineer should agree on this list together, because each model multiplies the memory you must hold. The step is done when every model has a named use, a named owner and a rough maximum context need written in the sizing worksheet.

  2. Confirm model size and quantization in the library

    For each model, open its entry in the Ollama library and record the parameter count, the quantization tag you intend to pull and the download size shown for that tag. Compare the tag you plan to use with the tag you would fall back to if memory is tight, and note the license terms that apply to each model. Do not assume the default tag is the one you want. The check is a table row per model with the exact tag name, its listed size and its license reference, reviewed by someone who will sign off on model use.

  3. Set context and parallel targets

    Decide the context window each use case needs and the number of parallel requests each model should handle at peak. Record these as explicit values for the Ollama settings you will test, including OLLAMA_NUM_PARALLEL, and note that the default is one parallel request per model. Parallel slots and context both consume memory, so a larger context setting applied to more slots increases the memory required. The check is a signed-off settings sheet that lists the context value and parallel value for each model, with the owner who approved it.

  4. Load the models on a test server

    Install Ollama on a test machine that matches the GPU class you are considering, using a version you will also pin in production. Pull each model at its chosen tag, set the context and parallel values from the previous step, and send a short request to each so it loads. Keep the test server on a private network with the API bound to localhost unless you have a reason to change that. The check is that every model responds and the server log shows each one loading without errors.

  5. Measure placement with ollama ps

    With the models loaded, run ollama ps and record, for each model, its memory size and the percentage split between GPU and CPU. Any split that places part of the model on the CPU means the model will run slower than a fully GPU-resident load. Repeat the check after loading a second model to see how placement changes when models compete for VRAM. The check is a recorded output where every model in use shows a full GPU placement, or a documented decision to accept the CPU share for a low-volume use case.

  6. Load test at expected concurrency

    Run a load test that sends the number of simultaneous requests and the prompt and answer lengths you expect at peak, using an HTTP load tool or a script against the native API. During the test, watch GPU memory use with your vendor monitoring tool and rerun ollama ps to confirm the placement did not shift to the CPU. Include a run at the upper end of your estimate. The check is a test report with request count, latency observations, any queued or rejected requests and the peak memory figure.

  7. Record VRAM headroom and decide hardware

    Compare the peak memory from the load test with the total VRAM on the target GPU and calculate the headroom left after the operating system, drivers and other workloads are counted. Ask the hardware vendor or your procurement team to confirm the VRAM figures for the exact card and configuration, because listed capacity and usable capacity can differ. If headroom is thin or a model splits to the CPU, change the quantization, lower the context or parallel values, or plan additional GPUs. The check is a signed sizing record with peak usage, headroom, the chosen hardware and the approved settings.

Operational and security factors that affect memory headroom

Memory sizing is a starting point, not a fixed answer. Model updates, concurrent models, open network exposure and heavy shared use all change how much VRAM is free at any moment, so each factor needs an owner and a check. The cards below cover what moves the budget over time and what to monitor.

Model updates change the footprint

A new tag or a re-pulled model can carry different weights, quantization or default context settings than the one you sized for. A model that fit comfortably last month may spill into system memory after an update. Before rolling out a change, pull the new version on a test host, load it, and record its memory use at your planned context length. Keep the previous model tag available so you can roll back if headroom shrinks.

Ollama releases

Multiple models loaded at once

Ollama can keep several models resident in memory at the same time, and each one reserves its own weights plus a KV cache sized for its context. Loading a second model is not free even when the first is idle, so a server that looks lightly used can be short on VRAM when a new request arrives. Check OLLAMA_MAX_LOADED_MODELS against the models you actually plan to serve, and confirm that the combined footprint fits before adding another.

Default loaded models per GPU
3

Parallel requests multiply context memory

Each parallel slot needs its own KV cache at the configured context length, so OLLAMA_NUM_PARALLEL raises memory use even when the model weights stay the same. Requests queue behind active slots, which hides the cost until traffic grows. Set the parallel count from your measured memory per slot, not from throughput hopes, and leave room for the queue to fill without pushing the model off the GPU.

Default parallel requests
1

Unauthenticated API on shared servers

The local Ollama API has no authentication by default and binds to 127.0.0.1 on port 11434. Once you expose it through OLLAMA_HOST or a reverse proxy, any client that reaches it can load models, send long prompts and keep caches full, which drives memory use beyond what you planned. Put authentication and rate limits in front of the server, confirm the bind address on every host, and block direct access from untrusted networks.

Ollama FAQ

Monitoring GPU memory over time

Sizing reflects one moment, while operations depend on the peak. Track VRAM use per GPU, which models are resident, and how often the server swaps models or falls back to CPU. Use ollama ps to see what is loaded and how it is split between GPU and CPU, and alert when a model starts running partly on CPU. Review these numbers after every model update, change to parallel settings or new user group.

Cloud features and model sources

Cloud features and model pulls can change which models appear on a server without a formal change request. Set OLLAMA_NO_CLOUD=1 where cloud use is not approved, and restrict who can pull models onto production hosts. Every new model entering the server is a new memory profile, so route pulls through the same review you use for any other workload change. Confirm the policy with your security team before you rely on it.

Questions buyers ask about sizing Ollama VRAM

How much does a VRAM sizing study for Ollama cost?

No fixed price applies, because the fee follows from the written scope. The main cost drivers are the number of models you plan to run, how many of them you need to size for concurrent use, how many GPU types sit in your inventory, and whether you want measured results or estimates only. Measured testing on your hardware takes more effort than a desk review of parameter counts and quantization. DeployOpen does not publish a price list. Ask for a quote that lists the models in scope, the hardware covered, the deliverables (a sizing table, context targets, a test plan) and whether a retest is included.

How long does Ollama VRAM sizing take?

Duration depends on how many models and hardware configurations are in scope and whether measurements run on your own GPUs. A desk study based on model size, quantization and context targets is shorter than a study that loads each model, runs representative prompts at your planned concurrency and records memory use. Access to test machines and change approval windows also affect the calendar. Ask the provider to state the phases, what your team must supply in each phase, and the point at which the schedule is agreed in writing.

What does our team need to provide for a sizing study?

Three inputs drive most of the work: a list of the models you want to run, with the exact model names and any fine-tuned or approved weights; traffic estimates, including expected concurrent users, peak requests per model and typical prompt and response lengths; and a hardware inventory, covering GPU models, VRAM per card, system RAM, operating system and driver versions. Access to a test host or a staging server also helps. If you cannot provide traffic figures yet, say so in the scope, because the study will then need stated assumptions that you must confirm later.

Can our own engineers size Ollama VRAM without outside help?

Yes, many teams do this in-house, especially when the model list is short and the hardware is uniform. The work involves reading model parameter counts and quantization levels, estimating the memory for weights and the key-value cache at your target context length, adding headroom for parallel requests, and then checking the result on real hardware with ollama ps and server logs. Outside help is usually worth considering when several GPU classes are mixed, when models must share GPUs, or when auditors expect written evidence of the sizing method.

Does running Ollama models on our own hardware require a license fee?

Ollama's pricing page states that running models on your own hardware is always unlimited, so the runtime itself carries no per-seat or per-token charge for local use. The MIT license governs the Ollama software. Each model, however, comes with its own license terms, and some restrict commercial use, redistribution or the size of the user base. Check the license of every model on your list before you size for it, because a model you cannot lawfully use is not a sizing target. Hardware, staff time and any outside work remain your costs.

How do Ollama cloud plans differ from running models locally?

Cloud plans pay for hosted inference, not for your hardware. The pricing page lists Pro at $20 per month ($200 per year), Max at $100 per month, Team at $500 per month and Enterprise at custom pricing. Direct cloud inference at ollama.com requires an API key sent as a Bearer token, while the local API on port 11434 does not require authentication. Enterprise adds model access controls, cost budgets per user or API key, a dedicated support channel and custom security options. A VRAM study covers only the local server, so confirm whether any cloud models are part of your workload and whether data may leave your environment.

What should we ask for in a written sizing scope?

Ask for the model list and quantization levels in scope, the context lengths and concurrency targets used for each, the GPU types covered, and the method for measuring memory, such as ollama ps output and server logs under representative load. Request a named deliverable, such as a sizing table with recommended GPU counts and a list of configuration settings to change, plus a statement of assumptions and what must be retested after a model or driver update. Confirm who performs the work, what access they need, and how changes to scope are priced.

How DeployOpen scopes and delivers Ollama sizing work

DeployOpen treats VRAM, model size and context length as a written scope question before any hardware is ordered. The work covers the models you plan to serve, the context you need, the concurrency you expect and the infrastructure you control.

How we scope

  • Inventory the models, quantization levels and context lengths your users need, written into the agreed scope.
  • Record expected concurrent requests and the OLLAMA_NUM_PARALLEL and OLLAMA_MAX_LOADED_MODELS values the design assumes.
  • Confirm which GPUs, drivers and operating systems are in your environment before any sizing figures are agreed.

How we build

  • Measure memory use of each candidate model on your target GPUs with representative prompts and context sizes.
  • Check with ollama ps that models load fully on GPU and do not spill to CPU under the planned load.
  • Test parallel request growth against VRAM headroom and record the settings that keep responses within your targets.

How we hand over

  • Deliver a sizing document with the VRAM estimate per model, context and concurrency combination, and the assumptions behind it.
  • Provide the final environment variable settings, model storage paths and a runbook for changing models or context length.
  • Walk your platform and infrastructure teams through the results, including the limits where a larger model needs more hardware.

How we support

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and re-sizing when models or user counts change are available as a retainer.
  • Retesting after Ollama version upgrades, since memory behavior can change between releases, is included where it is in scope.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.