Run an LLM on Your Own Laptop with Ollama (Private, Free, Offline)

Run an LLM on Your Own Laptop with Ollama (Private, Free, Offline) featured illustration

πŸ“Ž This article includes 1 downloadable practice file ↓

⏱ 3 min readUpdated 28 September 2026

You do not need a cloud account to use a language model. Ollama downloads open models and runs them on your own computer: free, offline, and your data never leaves the machine β€” ideal for confidential spreadsheets and documents.

In this article
  1. Install and run
  2. What hardware do you need?
  3. Call it from Python
  4. Process a spreadsheet
  5. Make your own assistant with a Modelfile
  6. Which model to pick?
  7. Continue learning

Install and run

Download the installer from ollama.com (Windows, macOS or Linux), then in a terminal:

Advertisement
ollama run llama3.2          # downloads ~2 GB the first time, then opens a chat
ollama list                  # models you have
ollama pull qwen2.5:7b       # get another model
ollama rm qwen2.5:7b         # free the disk space

Type a question at the >>> prompt; /bye exits.

What hardware do you need?

Model size Approx. download (4-bit) Runs well on
1–3B parameters 1–2 GB Any laptop with 8 GB RAM
7–8B 4–5 GB 16 GB RAM, faster with a GPU or Apple silicon
13–14B 8–9 GB 32 GB RAM or a GPU with 12 GB+
70B 40 GB+ Workstation-class hardware

Models are “quantized” β€” their numbers stored in about 4 bits instead of 16 β€” which shrinks them roughly four times with a small quality loss.

Call it from Python

Ollama runs a local web API on port 11434:

import requests

def ask(prompt, model="llama3.2"):
    r = requests.post("http://localhost:11434/api/generate",
                      json={"model": model, "prompt": prompt, "stream": False},
                      timeout=300)
    return r.json()["response"]

print(ask("Give an Excel formula to extract the domain from an email in A2."))

Process a spreadsheet

import pandas as pd
df = pd.read_excel("feedback.xlsx")               # column: Comment
df["Sentiment"] = [ask(f"Reply with one word, Positive, Negative or Neutral:\n{c}").strip()
                   for c in df["Comment"]]
df.to_excel("feedback_tagged.xlsx", index=False)

Hundreds of rows, no API bill, no data leaving your PC. Check a sample by hand β€” small models make more mistakes than big cloud ones.

Make your own assistant with a Modelfile

FROM llama3.2
PARAMETER temperature 0.2
SYSTEM You are an Excel expert. Reply with the formula first, then one line explaining it. Assume Excel 365.
ollama create excel-helper -f Modelfile
ollama run excel-helper
πŸ’‘ Low temperature suits formulas and data work; see temperature and top-p explained.

Which model to pick?

  • Small and fast: llama3.2 (3B), qwen2.5 (3B) β€” tagging, short summaries.
  • Better reasoning: 7–8B models such as llama3.1:8b or qwen2.5:7b.
  • Code: coder variants such as qwen2.5-coder.

Next: give the local model your own documents to answer from β€” build a RAG chatbot.

πŸ“Ž Practice files for this article

  • πŸ“„
    All code from this post5 examples in one file, ready to open in your editor.
    ⬇ SH Β· 1 KB

Free to use for learning. Files with macros (.bas) are plain text β€” import them with Alt+F11 β†’ File β†’ Import File, and always test on a copy.

✨ Ask AI about this article

Stuck on a step? Ask a question and the AI answers using this article.

Free Β· AI can be wrong