L Loach Docs
Ctrl K

Performance & VRAM

When the GPU runs out of room, the UI feels heavy, or generation is slower than the hardware should manage, there are a handful of dials that almost always fix it.

Ollama crashes with “out of memory” or the model fails to load

A pull works, but the model fails to load or the reply fails with “ran out of memory loading or running the model. Lower the context length or pick a smaller model.”

  1. Turn on Low VRAM in the parameters panel (or globally with Settings → Features → Low VRAM mode). This forces smaller batches and a leaner KV cache.
  2. Lower Context Length in the same panel - a smaller context window uses dramatically less VRAM.
  3. Set GPU Layers (Advanced view; blank uses the model’s default - or Ollama’s auto-detect when it has none - and 0 means CPU only) below the model’s layer count to push more of it onto CPU/RAM at the cost of speed.
  4. Pick a smaller quantization (for example q4_K_M instead of q8_0) or a smaller parameter size.

Onboarding sized my machine wrong

The model recommendation calls a model too big (or too small) for what your hardware actually manages, or names a constraint you don’t recognise.

The card names the number it used - “Based on 8.0 GB VRAM · NVIDIA GeForce RTX 4060 · 120 GB free on disk”, or a RAM figure when there’s no usable GPU reading. Which one you get:

Any probe that fails falls back to RAM. Nothing here restricts you - every catalog entry stays pullable, and the custom-tag field takes any tag at all. The badges are advice, except Not enough disk space, which does disable that row’s Pull button. If a model marked Runs slowly feels fine in practice, that’s the expected direction of error for a rough estimate - Ollama publishes no runtime memory figures to size against.

The UI feels sluggish

Scrolling, typing, or window resizing is choppy.

The first reply takes forever, even on a fast model

Sending the first prompt of the day takes 10+ seconds before streaming starts; subsequent replies are instant.

Ollama loads the model into VRAM on first use. To preload at launch, turn on Preload on startup under Settings → General → Default model (available when the default model is an Ollama model). Only that model is warmed, at the cost of pinning VRAM as soon as Loach opens - or as soon as you unlock it, if you use an app lock. It then stays loaded only as long as Settings → Features → Keep model loaded allows (5 minutes by default); raise it to keep the model resident between prompts. See Model preloading.

Making Ollama generate faster

Generation is slower than you’d expect, or you want to squeeze more tokens/sec out of your hardware.

These are environment variables on the Ollama server (not Loach settings) - set them where ollama serve runs, then restart it. As of Ollama 0.5+:

Setting environment variables for Ollama: on Windows, use System Properties → Environment Variables (or setx OLLAMA_FLASH_ATTENTION 1) and restart the Ollama tray app. On Linux with systemd, systemctl edit ollama (add a [Service] block of Environment="OLLAMA_…=…" lines) then systemctl restart ollama. On macOS, launchctl setenv OLLAMA_FLASH_ATTENTION 1 and relaunch the Ollama app.