Skip to content

v1.7.0

Latest

Choose a tag to compare

@eladser eladser released this 01 Dec 22:23
d85d4f1

See how much context still fits on your GPU, and which context brings a spilled model back.

demo

Ollama picks the context from total VRAM: 4k on cards under 23 GB, 32k up to 47 GB. So on a 12 or 16 GB card you're often running 4k with room for a lot more, and when a model spills to CPU the fix is usually a smaller num_ctx, but nothing tells you which.

Added

  • For each loaded Ollama model, the largest context it could load with and stay all on the GPU. The selected model gets a line under the models table: ctx 4k · up to 22k fits on GPU, ctx 4k · full 40k fits on GPU, or no room to grow on GPU.
  • The CPU verdict says what to set: 38% of model on CPU · fits at ctx 16k, or GPU too full when even a small context wouldn't fit next to what else is loaded.

It's worked out from what a token of context costs in KV cache (layer and head counts from /api/show; sliding-window, MLA and hybrid models counted the way llama.cpp allocates them), the VRAM free right now, and the 1 GB margin llama.cpp keeps free when it places layers. Checked on a 5090 with Ollama 0.32: a model forced 24% onto CPU got fits at ctx 29k, and reloaded at 29k it sat entirely on the GPU. It errs low, never high.

Ollama doesn't report its KV cache type or parallel slots, so mtop reads OLLAMA_KV_CACHE_TYPE and OLLAMA_NUM_PARALLEL from its own environment. An Ollama on another machine, and llama.cpp, LM Studio and vLLM rows, don't get a fit yet.

Changed

  • mtop --demo runs on a simulated 16 GB card, with qwen3:8b at its full 40k context spilling 38% to CPU.

Install: brew install eladser/tap/mtop, scoop install mtop, winget install eladser.mtop, or a zip below. Full list in the changelog.