KING BON
← Journal

·2 min read

Running local LLMs: a practical starting point with Ollama

Why run AI models on your own machine, and the few commands it takes to get one answering requests from your code.

AI / Local LLMs / Ollama

Cloud AI APIs are convenient, but they aren’t the only option. Running a language model locally keeps data on your own hardware, works offline, and has no per-request cost. For prototypes, internal tools, and privacy-sensitive work, that trade-off is often worth it.

Ollama is one of the simplest ways to get started.

Install and run a model

After installing Ollama, pulling and chatting with a model is one command each:

ollama pull llama3.2
ollama run llama3.2

The first command downloads the model; the second opens an interactive chat in your terminal. ollama list shows what you have installed.

Call it from your code

Ollama also runs a local HTTP server, by default on port 11434. That means any app can use the model with a plain HTTP request:

const res = await fetch('http://localhost:11434/api/generate', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    model: 'llama3.2',
    prompt: 'Summarize this support ticket in one sentence: ...',
    stream: false,
  }),
});

const data = await res.json();
console.log(data.response);

With stream: false you get a single JSON response; leave streaming on to render tokens as they arrive, which feels much faster in a chat interface.

Choosing a model size

The main constraint is memory. Smaller models (a few billion parameters) run comfortably on a laptop or a modest GPU and are great for summarizing, classifying, and drafting. Larger models are noticeably better at reasoning but need far more RAM or VRAM. Start small, measure whether the output is good enough for your task, and only scale up if it isn’t.

Where this goes next

A local model on its own is a nice demo. It becomes genuinely useful when you connect it to your own data — that’s where retrieval-augmented generation (RAG) and agents come in. Those deserve their own posts.