pi-ollama-web-search
v0.1.1
Published
pi extension adding Ollama web_search and web_fetch tools
Readme
pi Ollama Web Search Extension
Adds two pi extension tools backed by Ollama's hosted web APIs:
ollama_web_search→POST /api/web_searchollama_web_fetch→POST /api/web_fetch
Default API host is https://ollama.com.
Requirements
- A free Ollama account
- API key from https://ollama.com/settings/keys
- pi installed
Installation
Option A: install from npm (recommended)
pi install npx:@mariozechner/pi-ollama-web-search -lOption B: install from GitHub
pi install git:github.com/mcollina/pi-ollama-web-search -lOption C: clone and install locally
git clone [email protected]:mcollina/pi-ollama-web-search.git
cd pi-ollama-web-search
pi install . -lAfter install, run /reload in pi (or restart pi).
Configuration
You can configure the extension in pi settings (supports a custom key per project).
Project-local config (preferred)
Create .pi/settings.json in your project:
{
"ollamaWebSearch": {
"apiKey": "ollama_key_for_this_project",
"baseUrl": "https://ollama.com"
}
}Global config
Create or update ~/.pi/agent/settings.json:
{
"ollamaWebSearch": {
"apiKey": "ollama_key_for_all_projects",
"baseUrl": "https://ollama.com"
}
}Environment fallback
If not set in config, the extension falls back to:
OLLAMA_API_KEYOLLAMA_WEB_BASE_URL(optional)
export OLLAMA_API_KEY="your_key_here"
export OLLAMA_WEB_BASE_URL="https://ollama.com"Resolution order
.pi/settings.json→ollamaWebSearch~/.pi/agent/settings.json→ollamaWebSearch- Environment variables
Usage
Ask pi normally; the model can call:
ollama_web_searchquery(string, required)max_results(integer, optional, 1-10)
ollama_web_fetchurl(string, required)
Notes
- Output is truncated to pi defaults (50KB / 2000 lines) to protect context window.
- Tool errors are surfaced directly if key/config is missing or request fails.
