Get Started

Give your offline AI real tools: live weather, your own notes and a calculator

Out of the box, the model on your laptop can't look anything up and gets sums wrong. Tool calling fixes that: you write small Python functions, the model asks to use them, and your code decides whether it can. Build a working agent with three tools and the guard rails that keep it in line.

65 minIntermediateTools: Free. The weather comes from Open-Meteo, free with no account or key for non-commercial use.Step 1 free
A Python agent (agent.py) that lets your local model call tools in a loop until it has an answer
Three tools you can read in fulllive weather from Open-Meteo, a search over your own notes folder, and a calculator that can't run code
A clear picture of what tool calling really isthe JSON the model sends, and what your code sends back
  • Guard rails you can test yourself: a tool allowlist, argument checks against the schema, a yes/no prompt before anything writes to disk, and a log of every call
  • A starter kit with sample notes, so it works the moment you unzip it
Before you start
  • Ollama running with gemma4:e2b downloaded, from Run a ChatGPT-style AI on your own laptop. 16GB of RAM is comfortable; 8GB works but is slow. Gemma 4 needs Ollama 0.20.7 or newer: check with ollama --version.
  • uv, the Python tool from Put AI in your terminal. It fetches Python and the ollama library for you, so you don't install anything by hand.
  • An internet connection for the weather tool only. The model, your notes and the calculator all stay on your PC.
  • Comfort with the terminal: cd, running a command, reading an error. If that's new, do the Terminal survival kit first.
01/06Check your model can use tools0 done
STEP 01 of 06~8 min

Check your model can use tools

Only some models are trained to ask for tools. Check yours is one of them before writing any code.

  1. A language model can only produce text. It can't open a file, fetch a web page or reliably multiply two numbers. Tool calling (also called function calling) gets round that. You describe some tools to the model. When a question needs one, the model replies with a structured request instead of an answer: the tool's name and the arguments to use. Your program runs the tool and hands the result back. The model never runs anything itself.

  2. That only works if the model was trained for it. Start Ollama (from the Start menu or Applications; on Linux it already runs as a background service), then check what you've got:

    Terminal
    ollama list
    ollama show gemma4:e2b
  3. ollama show prints a Capabilities section. You're looking for tools in it. Gemma 4 has it, along with thinking and vision. Ollama tags every model that supports this, so you can browse them all at ollama.com/search?c=tools ↗.

    • `gemma4:e2b` (4.6GB): the model from the earlier lessons. It's the default in this kit.
    • `qwen3:4b` (2.5GB): a good second choice. Qwen 3 is the model Ollama uses in its own tool calling docs ↗. Get it with ollama pull qwen3:4b if Gemma struggles.
  4. Last, make sure uv is there. It runs the Python files in this mission and installs what they need on the fly:

    Terminal
    uv --version
    Windows (only if uv is missing)
    winget install --id astral-sh.uv -e
    Mac (only if uv is missing)
    brew install uv
    Linux, or Mac without Homebrew (only if uv is missing)
    curl -LsSf https://astral.sh/uv/install.sh | sh
✓
Checkpointollama show gemma4:e2b lists tools under Capabilities, and uv --version prints a version number.
If it breaks'could not connect to a running Ollama instance' + 2 more
'could not connect to a running Ollama instance'
Ollama isn't running. Open it from the Start menu (or Applications on a Mac) and try again. On Linux, run ollama serve in another terminal window.
There's no tools in the Capabilities list
That model can't do tool calling, and Ollama will refuse to send it tools. Pull one that can, such as ollama pull qwen3:4b, and use that name everywhere this mission says gemma4:e2b.
'uv' is not recognised
Close the terminal and open a new one after installing. If it still fails, run uv by its full path once and then uv tool update-shell, or restart the PC.
Still stuck? Ask the community
Next mission · Own your AIBuild your own Perplexity that has to prove every fact, on your laptop
→