Skip to content

How-ToGPU

How to Fit a Local LLM in Your GPU's VRAM with mistralrs tune

How to use mistralrs tune to see which quantisation of a local LLM fits your graphics card's VRAM before you download it, plan for long context, and split a model between GPU and CPU if it doesn't fit.

By , Systems & Technical Editor

5 min read

How to Fit a Local LLM in Your GPU's VRAM with mistralrs tune

The commands and behaviour described come from the mistral.rs documentation, read on 2 December 2026.

The most common local AI question is "will this model fit on my graphics card?" Download a model that's too big and it either fails to load or spills into system RAM and slows to a crawl. mistral.rs, the open-source Rust LLM engine, has a command that answers the question before you download the weights: mistralrs tune. It reads only the model's small config files, works out how big each quantisation would be, compares that with your hardware, and prints a ready-to-run command for the one it recommends.

If you haven't installed mistral.rs yet, start with our guide to running local LLMs with mistral.rs. GPU acceleration needs an NVIDIA RTX 30-series card or newer, or a Mac.

Why quantisation decides what fits

Quantisation stores each weight in fewer bits. mistral.rs's quantisation guide gives the rule of thumb: a 14B model in 16-bit BF16 needs about 28 GB for its weights, about half that at 8 bits and about a quarter, roughly 7 GB, at 4 bits. That's the difference between needing a 32 GB card such as the NVIDIA GeForce RTX 5090 Founders Edition and fitting on a 12 GB card such as the ASUS RTX 3060 12GB Dual Gaming OC V2.

Weights aren't the whole story. The docs say the KV cache, which holds the conversation so far, is a separate memory budget that depends on context length rather than on quantisation. A model that only just fits may leave little room for long chats. Our context length and VRAM explainer covers why.

Step 1: Run tune on the model you want

Give tune a Hugging Face model ID:

mistralrs tune -m Qwen/Qwen3-4B

The docs say tune prints one row per quantisation format, with:

  • the estimated size,

  • its share of your GPU memory,

  • how much context fits beside it,

  • a quality label (near-lossless for 8-bit, good for 5 and 6-bit, acceptable for 4-bit, degraded for 3 and 2-bit),

  • a status: Recommended, Fits, Hybrid (split across GPU and CPU) or Too Large.

Below the table it prints a ready-to-run command for the recommended row. Because tune only reads config files, nothing large is downloaded at this stage.

Step 2: Choose a profile

By default tune uses the balanced profile, which starts at 6-bit and works down. You can change what it favours with --profile:

Profile

Bit widths it tries, in order (NVIDIA and CPU)

Use it when

quality

8, 6, 5, 4, 3, 2

You want the most precise version that fits

balanced (default)

6, 5, 4, 3

You want a good trade between quality and memory

fast

4, 3, 2

You want the smallest, fastest version

For example:

mistralrs tune -m Qwen/Qwen3-4B --profile quality

The balanced profile is also what --quant auto uses when you load a model, so tune shows you in advance what auto would pick. If you already know the format you want, --isq q4k asks tune to recommend that one if it fits.

Step 3: Plan for the context you actually need

If you need long prompts, such as pasting in big documents or using a coding agent, tell tune with --max-model-len, which sets the most tokens one request may use. The context length guide suggests 8k to 32k tokens for chat, while coding agents want as much as the model and memory allow.

If the context you want won't fit, the docs list a few options:

  • --pa-cache-type f8e4m3 stores the KV cache in 8-bit floating point, which holds about twice as many tokens in the same memory.

  • A smaller quantisation, such as 4-bit instead of 8-bit, leaves more memory for the cache.

  • --gpu-memory-utilization sets the share of GPU memory (for example 0.9) mistral.rs uses for weights, activations and the cache.

These flags work with tune and with serve, so you can check a combination with tune first, then use it for real.

Step 4: Save the recommendation and run it

To keep tune's answer, write it to a config file and run from that:

mistralrs tune -m Qwen/Qwen3-4B --emit-config qwen.toml
mistralrs from-config -f qwen.toml

If you'd rather script it, --json gives machine-readable output instead of the table.

When the model is too big: split it between GPU and CPU

A Hybrid result means the model only fits if some of it runs from system RAM on the CPU. That works, but layers on the CPU generally run slower than layers in VRAM. mistral.rs gives you two ways to control the split.

The simple one is -n (--device-layers), which sets how many layers go on each device, such as 0:10;1:20 for 10 layers on GPU 0 and 20 on GPU 1. Leave it out and mistral.rs maps layers automatically.

For more control, a topology file sets the device and quantisation for each range of layers. The docs' example splits a 40-layer model across two GPUs and the CPU:

0-16:
  device: cuda[0]
  isq: q4k
16-32:
  device: cuda[1]
  isq: q4k
32-40:
  device: cpu
  isq: q8_0

Load it with mistralrs serve -m <model> --isq q4k --topology topology.yaml. Ranges include the first number and exclude the last, so 0-16 means layers 0 to 15. Two caveats from the docs: putting any numbered layer on the CPU turns off paged attention for that model, and for most people the automatic layout without a topology file is the right setup.

For mixture-of-experts models, --isq-organization moqe quantises only the expert layers and leaves the rest at full precision. See our guide to running MoE models on low VRAM for why MoE models behave differently.

Check the real numbers

Tune's figures are estimates. The quantisation guide recommends checking actual memory use with nvidia-smi once a model is loaded; on Windows you can also use Task Manager, as our guide to checking VRAM usage on Windows shows. When mistral.rs starts, it also prints the context limit per request and how many full-length requests fit in the KV cache.

The bottom line

Run mistralrs tune -m <model> before you download a local LLM: it reads only the config files and tells you which quantisation fits your GPU, how much context is left, and whether the model needs to spill onto the CPU. Stick with the default balanced profile unless you want maximum quality or the smallest file, use --max-model-len and --pa-cache-type f8e4m3 to plan for long chats, and save the result with --emit-config. Treat the numbers as estimates and check real VRAM use once the model loads. Forge PC hasn't tested mistral.rs.

In this article

Sources

  1. 01mistral.rs docs, mistralrs tune
  2. 02mistral.rs docs, Quantize a model
  3. 03mistral.rs docs, Context length
  4. 04mistral.rs docs, Configure model topology
  5. 05mistral.rs docs, mistralrs serve
  6. 06mistral.rs docs, Hardware support
  7. 07Eric Buehler, mistral.rs GitHub README

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

How to Fix ATTEMPTED_WRITE_TO_READONLY_MEMORY on Windows 11

How-To

How to Fix ATTEMPTED_WRITE_TO_READONLY_MEMORY on Windows 11

ATTEMPTED_WRITE_TO_READONLY_MEMORY (0xBE) means a driver tried to write to protected memory. Here's how to find the driver from the blue screen or minidump, update, roll back or remove it, use safe mode and Driver Verifier, and rule out RAM, system files and malware.

Marcus Thorne5 min

How to Fix UNMOUNTABLE_BOOT_VOLUME on Windows 11

How-To

How to Fix UNMOUNTABLE_BOOT_VOLUME on Windows 11

UNMOUNTABLE_BOOT_VOLUME (0xED) means Windows couldn't mount the drive it boots from. Here's how to check the drive and its connection, get into the recovery environment, and run Microsoft's fixes: Startup Repair, chkdsk /r and bootrec, plus what to do if the drive itself has failed.

Marcus Thorne5 min

Best Free CD Ripping Software for Windows (2026)

Best Picks

Best Free CD Ripping Software for Windows (2026)

The best free CD ripping software for Windows, ranked: Exact Audio Copy, fre:ac, CUERipper, foobar2000 and MusicBee. We explain which ones verify rips with AccurateRip, which are easiest, and who each one suits.

Hannah Vance5 min