BOT HUB Β· πŸ€– LEARN BY DOING

Local AI: Run & Build Your Own (Free)

Private AI on your own iPhone and Mac, plus a 7-day beginner course. Every tool here costs $0.

← Back to Bot Hub

Local AI means the AI model runs on your own device instead of a company's servers. After a one-time download it works with no internet, no account and no monthly bill, and your chats stay on your device.

Honest expectations: small local models are slower and less clever than the big cloud chatbots, and they sometimes make things up. They're great for learning, private notes, drafting and tinkering.

Facts and links last checked November 14, 2026.

πŸš€ Quick start: try it in 30 minutes

Do these in order. Stop whenever you've had enough fun for one day.

  1. Check what you have. On the Mac: Apple menu β†’ About This Mac. Note the Chip (Apple M1 or newer, or Intel) and the Memory (8 GB, 16 GB, 24 GB…). On the iPhone: Settings β†’ General β†’ About β†’ Model Name.
  2. iPhone: install the free app Locally AI (needs iOS 18.1+) or PocketPal AI (older iPhones too). Download one small model on Wi-Fi.
  3. Prove it's offline: turn on Airplane Mode and ask it a question. If it answers, the AI is running on your phone. πŸŽ‰
  4. Mac: download Ollama, drag it into Applications and open it once. (Needs macOS 14 Sonoma or newer.)
  5. Open Terminal (⌘-Space, type Terminal) and run the command for your memory size below. The first run downloads the model (1–2 GB).
  6. Type a question at the >>> prompt. Type /bye to quit.
  7. Liked it? Start Day 1 of the course below.
8 GB Mac
ollama run llama3.2:1b
16 GB or more
ollama run llama3.2
Prefer clicking to typing? LM Studio is a free point-and-click app for Apple Silicon Macs (not Intel).

πŸ“± On your iPhone

These apps download a model once, then run it fully on the phone. Pick one to start; Locally AI or PocketPal AI are the easiest.

AppCostGood to know
Locally AIFreeMade by the LM Studio team. Simple, fast (uses Apple's MLX). No account. Needs iOS 18.1 or newer.
PocketPal AIFree (optional one-time β€œPlus” for hands-free voice)Open source. Runs any small GGUF model from Hugging Face. Works back to iOS 15.1; GPU speed-up needs iOS 18.
Google AI Edge GalleryFreeGoogle's app for its Gemma models, including image and audio questions. Google still calls it a work in progress. iOS 17+.
Apple's built-in model (Shortcuts β€œUse Model”)FreePick On-Device in the Shortcuts app's Use Model action. Needs iOS 26, Apple Intelligence turned on, and an iPhone 15 Pro or newer.
Private LLM$4.99 one-timePaid, so not needed here. Listed only so you know it isn't free.

Which models fit on a phone?

Skip MLC Chat and LLM Farm for now: MLC Chat's iPhone app hasn't been updated since September 2024, and LLM Farm is currently off the App Store.

πŸ’» On your Mac

Ollama is the easiest free starting point and it's what the course uses. Your Mac's memory decides which models run well.

Install Ollama and run your first model

  1. Go to ollama.com/download and download the Mac app.
  2. Open the download, drag Ollama into Applications, then open it. Allow it to add its command-line tool if asked.
  3. Open Terminal and run ollama run llama3.2:1b. Wait for the one-time download.
  4. Chat at the >>> prompt. /bye quits. Run ollama list to see what you've downloaded.

Pick a model by memory (Apple M1 or newer)

Your Mac's memoryStart withDownload size
8 GBllama3.2:1b, qwen3:1.7b, gemma3:1b0.8–1.4 GB
16 GBllama3.2 (3B), qwen3:4b, phi4-mini, gemma3:4b (can read images), qwen3.5:4b (newer)2.0–4.0 GB
24–32 GBqwen3:8b, gemma4 (newest Gemma), gemma3:12b5.2–9.5 GB
64 GB+gemma3:27b and other bigger models17 GB+
Rule of thumb: keep the model's download smaller than about half your memory, and close big apps while it runs. Bigger isn't always better: try two models on the same questions and keep the one you like.

Handy Ollama commands

Terminal
ollama list            # models you have
ollama pull qwen3:4b   # download without chatting
ollama ps              # what's running right now
ollama rm qwen3:4b     # delete a model to free space
Ollama also offers cloud models (names ending in :cloud). Those run on Ollama's servers, not your Mac, and can cost money. Skip them to stay private and free.

Intel Mac?

Other free Mac tools (optional)

Point-and-click

LM Studio

Free app with a model browser and chat window. Apple Silicon and macOS 14+ only; 16 GB recommended, 8 GB works with small models.

Open β†—
C/C++

llama.cpp

The fast C/C++ engine many apps are built on. Install with brew install llama.cpp or from llama.app, then try llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF (older installs name it llama-cli).

Open β†—
Python

Apple MLX

Apple's own machine-learning library for M-series Macs. pip install mlx-lm, then mlx_lm.chat. It's also what Day 6 uses to fine-tune.

Open β†—

πŸ› οΈ Build and train your own

Yes, you can build one yourself. Here's what's realistic at home, for free.

The honest part: training a ChatGPT-sized model from scratch takes huge data-center budgets. Even Karpathy's small nanochat project, which trains a GPT-2-level chatbot, needs about 2 hours on a rented 8-GPU server (roughly $48). So at home you learn with tiny models and you adjust existing small models.
Python

A. Build a tiny GPT from scratch

Andrej Karpathy's video β€œLet's build GPT: from scratch, in code, spelled out” walks through every line. His nanoGPT repo trains a baby Shakespeare-writing GPT on a MacBook in about 3 minutes. It's officially β€œold”, but still the clearest way to learn.

Open β†—
Free

B. Fine-tune a small model

Teach an existing model a style or skill with a few dozen examples. On an Apple Silicon Mac use MLX LoRA. On any computer, use a free Google Colab notebook from Unsloth, which borrows a free cloud GPU.

Open β†—
Easiest win

C. Chat with your own notes (RAG)

Instead of retraining, let the model look things up in your files first. This is called retrieval-augmented generation (RAG). Day 4 builds one in about 40 lines of Python.

Open β†—

Python or C++?

Words you'll see

πŸŽ“ 7-day course: about an hour a day

Each day builds on the last. Tick the box when you're done; your progress is saved in this browser only.

0 of 7 days done

DAY 1

Run your first model

Goal: Get a model chatting on your Mac (and phone), completely offline.

  1. Install Ollama (see the Mac section) and run ollama run llama3.2:1b.
  2. Ask 5 different questions: a fact, a how-to, a joke, a summary of a paragraph you paste in, and something tricky.
  3. Turn Wi-Fi off and ask again. Then try the same on your iPhone app.
  4. Write down one thing it did well and one thing it got wrong.

πŸ“˜ Free resource: Ollama quickstart

βœ… You're done when: It answers with Wi-Fi off, and you've noted one hit and one miss.

DAY 2

Talk to it well (prompting)

Goal: Get better answers and make your own custom assistant.

  1. Ask the same question three ways: plain, with β€œexplain step by step”, and with an example of the answer you want. Compare.
  2. Give it a role: β€œYou are a patient tutor…”.
  3. Save that role as your own model with a Modelfile (below), then run ollama create tutor -f Modelfile and ollama run tutor.
  4. Try ollama run llama3.2:1b --verbose to see the speed in tokens per second.
Save as a file named Modelfile
FROM llama3.2:1b
PARAMETER temperature 0.3
SYSTEM """You are a patient tutor. Explain things in short, plain steps
and end with one quick question to check my understanding."""

πŸ“˜ Free resource: Prompt Engineering Guide (free)

βœ… You're done when: ollama run tutor answers in your tutor's style.

DAY 3

Python meets your model

Goal: Write a short Python program that chats with your local model.

  1. In Terminal: python3 -m venv ~/ai then source ~/ai/bin/activate (do the activate step each new session).
  2. Install the helper: pip install ollama.
  3. Save the code below as chat.py and run python chat.py (Ollama must be open).
  4. Change MODEL to another model you've pulled and compare.
chat.py
# chat.py: a tiny chat program that talks to your local model
import ollama

MODEL = "llama3.2:1b"   # use any model you have pulled
history = []
print("Say something (press Enter on a blank line to quit).")

while (text := input("\nYou: ").strip()):
    history.append({"role": "user", "content": text})
    reply = ollama.chat(model=MODEL, messages=history).message.content
    history.append({"role": "assistant", "content": reply})
    print("AI:", reply)

πŸ“˜ Free resource: Ollama Python library

βœ… You're done when: Your own program holds a back-and-forth conversation.

DAY 4

Chat with your own notes

Goal: Build a mini RAG: the AI answers from your files, not from memory.

  1. Run ollama pull nomic-embed-text (a small 274 MB search model).
  2. Make a folder called notes next to your script and drop in a few .txt or .md files (recipes, project notes, a manual).
  3. Save the code below as notes_chat.py and run python notes_chat.py.
  4. Ask something only your notes know, then something they don't. It should say β€œnot in my notes”.
notes_chat.py
# notes_chat.py: ask questions about your own notes, 100% on your computer
import glob, math, ollama

CHAT_MODEL  = "llama3.2:1b"        # or llama3.2 / qwen3:4b with 16 GB+
EMBED_MODEL = "nomic-embed-text"   # turns text into numbers for searching

def chunks(text, size=800):
    buf = ""
    for para in text.split("\n\n"):
        if buf and len(buf) + len(para) > size:
            yield buf
            buf = ""
        buf += para + "\n\n"
    if buf.strip():
        yield buf

def similarity(a, b):
    dot = sum(x * y for x, y in zip(a, b))
    return dot / (math.sqrt(sum(x * x for x in a)) * math.sqrt(sum(y * y for y in b)))

pieces = []
for path in glob.glob("notes/*.md") + glob.glob("notes/*.txt"):
    for c in chunks(open(path, encoding="utf-8").read()):
        pieces.append((path, c))
vectors = ollama.embed(model=EMBED_MODEL, input=[c for _, c in pieces]).embeddings
print(f"Read {len(pieces)} pieces of your notes. Ask a question (blank line quits).")

while (question := input("\nYou: ").strip()):
    qv = ollama.embed(model=EMBED_MODEL, input=question).embeddings[0]
    ranked = sorted(zip(vectors, pieces), key=lambda vp: similarity(qv, vp[0]), reverse=True)
    best = "\n---\n".join(f"[{path}]\n{text}" for _, (path, text) in ranked[:3])
    messages = [
        {"role": "system", "content": "Answer only from these notes and name the note you used. "
                                      "If the notes don't say, reply: not in my notes.\n\n" + best},
        {"role": "user", "content": question},
    ]
    print("AI:", ollama.chat(model=CHAT_MODEL, messages=messages).message.content)

πŸ“˜ Free resource: Ollama embedding models

βœ… You're done when: It answers a question from your notes and names the file it used.

DAY 5

Build a tiny GPT from scratch

Goal: See how a GPT actually learns by training a baby one yourself.

  1. Watch the first 45–60 minutes of Karpathy's β€œLet's build GPT” video (finish it another day).
  2. Get nanoGPT: git clone https://github.com/karpathy/nanoGPT then cd nanoGPT.
  3. Install its tools: pip install torch numpy transformers datasets tiktoken wandb tqdm.
  4. Prepare the data: python data/shakespeare_char/prepare.py.
  5. Train the laptop-sized version (about 3 minutes), then sample from it with the commands below.
Train and sample (from the nanoGPT README)
python train.py config/train_shakespeare_char.py --device=cpu --compile=False --eval_iters=20 --log_interval=1 --block_size=64 --batch_size=12 --n_layer=4 --n_head=4 --n_embd=128 --max_iters=2000 --lr_decay_iters=2000 --dropout=0.0
python sample.py --out_dir=out-shakespeare-char --device=cpu

πŸ“˜ Free resource: Let's build GPT (video)

βœ… You're done when: Your model writes fake Shakespeare, and you can explain what β€œloss going down” means.

DAY 6

Fine-tune a small model

Goal: Teach an existing model a new habit with your own examples.

  1. Apple Silicon Mac: pip install "mlx-lm[train]" inside your ~/ai environment.
  2. Make a data folder with a train.jsonl file: one example per line, at least 20 lines, all in the same style (format below).
  3. Train: mlx_lm.lora --model mlx-community/Llama-3.2-1B-Instruct-4bit --train --data ./data --iters 200
  4. Compare: run mlx_lm.generate --model mlx-community/Llama-3.2-1B-Instruct-4bit --prompt "Why is the ocean salty?" with and without --adapter-path adapters.
  5. Intel Mac, or want a GPU? Open a free Unsloth notebook in Google Colab (Runtime β†’ Run all).
data/train.jsonl (2 of your 20+ lines)
{"messages": [{"role": "user", "content": "What is a sea breeze?"}, {"role": "assistant", "content": "Breezy answer: land heats faster than water, warm air rises, and cool ocean air rushes in to replace it. 🌊"}]}
{"messages": [{"role": "user", "content": "Why do kites fly?"}, {"role": "assistant", "content": "Breezy answer: moving air pushes up on the tilted kite while the string holds it in place. πŸͺ"}]}

πŸ“˜ Free resource: MLX LoRA guide

βœ… You're done when: With the adapter, answers start with β€œBreezy answer:” (or whatever style you taught it).

DAY 7

Wrap-up and next steps

Goal: Lock in what you learned and pick what's next.

  1. Run the same 5 questions from Day 1 on two or three models. Keep a favorite for phone and one for Mac.
  2. Write a one-page β€œLocal AI setup checklist” in plain words: device check, install, first model, privacy tips. This is exactly what you'd use to help a friend or neighbor set one up.
  3. Pick one next project: finish the Let's build GPT video, add more notes to your notes chat, or read llama.cpp / llm.c for the C/C++ side.
  4. Ask your Bot Hub assistant for an update to this page whenever you're ready for level 2.

πŸ“˜ Free resource: Karpathy's Zero to Hero course (free)

βœ… You're done when: You have your checklist and one next project picked.

πŸ”’ Privacy and safety, in plain words

Local AI is private by design, but a few habits keep it that way.

πŸ“š Sources and links

Everything above was checked against these pages.