Docs › Integrations › Ollama
How to give a local Ollama model web search
Ollama connects to Blopus over the configuration below. This page has the exact configuration, where it goes, how to check it worked, and what to do when the tools do not show up.
Before you start
You need a Blopus API key. Create one in the
Blopus console β it is shown once, so store it before closing the
dialog. Keys start with blp_live_. If you do not have an account yet, pick a plan
on the pricing section; the first key is issued immediately.
Everything below bills from the same credit pool: a search costs one credit per block of ten
results, and fetch is billed the same way. See
rate limits and credits for the exact rules.
Set up Blopus in Ollama
Hand your local model the Blopus tool through Ollamaβs tool-calling API.
Function calling
tools = [{"type": "function", "function": { "name": "search", "parameters": {"type": "object", "properties": { "query": {"type": "string"}, "freshness": {"enum": ["pd", "pw", "pm", "all"]}}}}}]
Python
import ollama resp = ollama.chat(model="llama3.1", messages=[{"role": "user", "content": "latest on ..."}], tools=[search]) # handler calls Blopus
cURL
curl -X POST https://api.blopus.ai/v1/search \ -H "Authorization: Bearer blp_live_..." \ -H "Content-Type: application/json" \ -d '{"query":"...","count":5,"freshness":"pw"}'
Replace blp_live_... with your own key. Treat it like a password β
anyone holding it can spend your credits. If a key is ever pasted somewhere public, revoke it in
the console and create a new one; revocation takes effect within thirty seconds.
Check that it worked
Restart Ollama after saving the configuration β most clients only read MCP settings at start-up. Then confirm two tools are listed:
searchβ takes a query, returns ranked web resultsfetchβ takes a URL, returns the extracted page text
The quickest end-to-end check is to ask the model something it cannot know from training data β today's date in a news story, or the current version number of a fast-moving package. If it answers with a source link, the connection is live.
If the tools do not appear
- Nothing in the tool list. Almost always a restart: the config is read once at start-up. Quit Ollama fully rather than reloading a window.
- 401 unauthorized. The key is wrong, revoked, or the
Bearerprefix is missing. The header must readAuthorization: Bearer blp_live_.... - 402 payment required. The monthly credit allowance is spent. Usage and remaining credits are in the console; see credits.
- 429 too many requests. You are over the per-minute ceiling for your plan. Back off
and retry β the response carries a
Retry-Aftervalue. - Malformed JSON config. A trailing comma is the usual culprit. Paste the file into a JSON validator before assuming the server is at fault.
Full error reference: API error codes.
Related
- The Blopus MCP server β transport, tools and arguments
- Search endpoint reference β filters, freshness, domains, topics
- All supported clients
- Ollama docs: tool calling