Your Local LLM Can Now Search the Web: Ollama's Web Search Plugin

Ollama's web search and web fetch API lets a local model pull live results off the web. Here's how to turn it on, two home-lab uses, and the privacy catch nobody mentions.

Your Local LLM Can Now Search the Web: Ollama's Web Search Plugin
Photo by Mohammad Rahmani / Unsplash
Ollama added a hosted web search and web fetch API that lets a local model pull live results off the internet instead of guessing from stale training data. Your model still runs on your own box — but the search itself runs through Ollama's cloud with a free API key. Here's how to turn it on, two home-lab uses that earn their keep, and the privacy catch nobody puts in the headline.

Back when I ran a local Ollama box, half the point was keeping my prompts in-house. No sending my half-formed questions off to someone else's server. Just me and a model on my own hardware.

There was always one annoying gap, though. A local model is frozen at its training cutoff. So the second I asked something like "what's the current stable version of Proxmox?" I'd get a confident answer that was six months out of date — and I'd end up tabbing over to a cloud model anyway. Which kind of defeated the point.

Ollama's web search API is the fix for exactly that gap. I ran that local Ollama, Open WebUI, and LiteLLM stack for a good while, and this is the one piece it was always missing. Let's wire it up.

A man sitting in front of three computer monitors
Photo by Veronica / Unsplash

What the plugin actually does

There are two pieces, and it helps to keep them straight.

Web search is the discovery step. You hand it a query like "latest Ollama release notes" and it returns a handful of results — each with a title, a URL, and a snippet of the page content. Think of it as the model doing a Google search and getting the top hits back as text.

Web fetch is the read step. You hand it a single URL and it pulls back that page's title, its main content, and the links on it. This is what you use when you already know the page you want and just need the model to read it.

The important beginner bit: this is a tool. "Tool calling" just means the model can decide, mid-answer, that it needs to reach out and run one of these functions — then fold the results back into its response. You're not hard-coding a search; you're giving the model a button it can press when it realizes it doesn't know something current.

One thing to be clear about up front: the search runs on Ollama's servers, not yours. Your model does the thinking locally, but the actual web lookup is a hosted API call, as the official Ollama docs spell out. More on why that matters at the end.

Turning it on

The setup is genuinely short. Here's the whole thing.

1. Get a free API key. Web search is included with a free Ollama account. Sign in at ollama.com/settings/keys and create a key.

2. Export it so the tools can find it:

# The libraries and CLI look for this env var
export OLLAMA_API_KEY="your_api_key"

3. Test it with curl before you write any code. This is the fastest way to confirm your key works:

curl https://ollama.com/api/web_search \
  --header "Authorization: Bearer $OLLAMA_API_KEY" \
  -d '{
    "query": "what is ollama?"
  }'

You'll get back a JSON object with a results array — each entry a title, url, and content snippet. By default you get 5 results; you can pass max_results to bump it up to 10.

4. Or call it from Python. Install the library (you need version 0.6.0 or newer) and it's a one-liner:

pip install 'ollama>=0.6.0'
import ollama

response = ollama.web_search("what is ollama?")
print(response)

That's the entire on-ramp. Key, env var, done.

magnifying glass near gray laptop computer
Photo by Agence Olloweb / Unsplash

Letting the model decide

Calling the search yourself is fine, but the real payoff is handing the model both tools and letting it choose when to reach out. That's a "search agent" — a small loop where the model thinks, decides it needs live info, calls the tool, reads the result, and answers.

You'll want a model that's good at tool use. Ollama recommends qwen3 or gpt-oss. Here's the shape of it with a small Qwen 3 model:

ollama pull qwen3:4b
from ollama import chat, web_search, web_fetch

available_tools = {'web_search': web_search, 'web_fetch': web_fetch}
messages = [{'role': 'user', 'content': "what is ollama's new engine?"}]

response = chat(
    model='qwen3:4b',
    messages=messages,
    tools=[web_search, web_fetch],
    think=True,
)
# If response.message.tool_calls exists, run the tool,
# append its output as a 'tool' message, and call chat() again
# until the model stops asking for tools.

The model looks at your question, decides "I don't actually know this," emits a web_search tool call, you run it, feed the results back, and it writes a grounded answer. No hardcoded logic about when to search — the model works that out.

One gotcha worth knowing before it bites you: search results can be thousands of tokens. Ollama recommends bumping your model's context length to around 32,000 tokens, otherwise long results get truncated and the answer suffers.

Two home-lab uses that actually pay off

Beyond the demo, here's where this earns a spot in a home lab.

Summarize a project's latest changelog. Point web_fetch at a releases page and ask for the highlights. Instead of reading three pages of GitHub release notes, you get "here's what changed since the version you're on." Great before a Proxmox or container upgrade.

Confirm the current version of a tool. This is the exact frustration from the top of the post. Ask "what's the latest stable release of X and is it a breaking change from Y?" and the model actually checks instead of hallucinating a version number. For anyone who self-hosts and lives one upgrade behind, that's a small but real win — and it ties neatly into using AI as a read-only helper the way I described in managing my home lab with AI.

The catches (because there always are some)

This is the part the launch posts skip, so let's be honest about it.

Your search leaves the building. The headline is "local model + web search," and the inference genuinely stays on your hardware. But the search itself is a call to ollama.com with your API key and your query attached. If your whole reason for running local was that prompts never leave your machine, understand that your search queries now do. It's a hosted service wearing a local-first jacket.

There are rate limits. The free tier is generous for tinkering and light personal use, but it's a free tier. Lean on it hard — a busy agent hammering search on every turn — and you'll want a paid Ollama subscription for higher limits.

Sometimes a cloud model is just the right tool. If you need deep, multi-hop research across dozens of pages, a big hosted model with its own search will often do it better than a 4B local model juggling a 32k context. This feature shines for quick, grounded lookups — not for replacing every cloud query you've ever made.

A padlock rests on a computer keyboard
Photo by Sasun Bughdaryan / Unsplash

Final thoughts

If I still had that local box running, this is the first thing I'd bolt on. The frozen-at-training-cutoff problem was the single most annoying thing about self-hosting a model, and a free API key plus one env var makes most of it go away.

Just go in clear-eyed about the trade. "Local" here means your model thinks locally, not that nothing leaves your network — your search queries take a trip to Ollama's cloud on the way. For a lot of home-lab use that's a perfectly fair deal. For the genuinely air-gapped crowd, it's a dealbreaker, and that's worth knowing before you wire it in rather than after.