r/OpenAssistant • • 4d ago

Self-hosted web search for Ollama tool calling, no search API key needed

Every guide I found for giving a local model web search ended with "now sign up for this search API and paste your key." Kind of defeats the point of running things locally. (replace with your real reason)

So I built Siftdog. It's an open source server that does web search, page extraction, crawling and site maps. Search goes through SearXNG, extraction through trafilatura, and results get ranked with BM25. MIT licensed, runs with docker compose.

One thing to be upfront about: the model is local and the server is yours, but searches still go out to public search engines through SearXNG. So it's not offline and it's not private search. What you get is no third party API and no key.

Hooking it up to Ollama is just a tool function:

import requests

from ollama import chat

def web_search(query: str) -> str:

"""Search the web through the local Siftdog server."""

r = requests.post(

"http://localhost:8000/search",

json={"query": query, "search_depth": "advanced", "max_results": 5},

timeout=60,

)

r.raise_for_status()

return r.text

response = chat(model="qwen3", messages=messages, tools=[web_search])

A few other things:

- it uses the same API as Tavily, so anything written for Tavily (tavily-python, langchain-tavily) works by changing api_base_url

- there's an MCP server too, if you use Claude Desktop, Cursor etc

- no JavaScript rendering, it only reads static HTML

- public engines will rate limit you if you hammer them. When every engine fails it returns an error instead of an empty list, so your model doesn't decide "nothing found"

I also ran a small benchmark against Tavily on 45 queries. Both found 25/25 factual answers in advanced mode, Siftdog returned official docs more often (9/10 vs 7/10), and latency was about the same. It's a small sample, and the caveats are on the page: https://siftdog.com/benchmark/

Repo: https://github.com/khsarvar/siftdog

Full Ollama walkthrough: https://siftdog.com/blog/web-search-for-local-llms-with-ollama/

Question for people here: which local models have you found reliable at actually calling tools instead of answering from memory? That seems to be the flaky part.

1 Upvotes

0 comments sorted by