Can you run AI coding locally for free? Check this setting first

Ship ItChecked against the official source

The short answer

It's possible: with Ollama, models run on your own machine. But check the context length. Ollama's default is 4K tokens if your graphics card has less than 24 GiB of memory (32K at 24 to 48 GiB, 256K at 48 GiB or more), and Ollama says coding tools should be set to at least 64,000 tokens. More context needs more graphics memory.

What to do

  1. Find out how much graphics memory (VRAM) your computer has.
  2. For coding tools, set Ollama's context length to at least 64,000 tokens.
  3. More context needs more graphics memory, so check it fits before you count on it.

Source

Checked on 3 Oct 2026. Prices, limits and settings change, so check the source before you rely on them.

Related