ollama-web 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,74 @@
1
+ name: Build, Package & Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: write
11
+
12
+ jobs:
13
+ build-pypi:
14
+ name: Build & Publish to PyPI
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - name: Set up Python
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: '3.11'
22
+ - name: Install build tools
23
+ run: pip install --upgrade build twine
24
+ - name: Build wheel and sdist
25
+ run: python -m build
26
+ - name: Publish to PyPI
27
+ if: startsWith(github.ref, 'refs/tags/v')
28
+ env:
29
+ TWINE_USERNAME: __token__
30
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
31
+ run: twine upload --skip-existing dist/*
32
+
33
+ build-binaries:
34
+ name: Build Standalone Binaries
35
+ strategy:
36
+ matrix:
37
+ include:
38
+ - os: ubuntu-latest
39
+ artifact_name: ollama-web-linux-x86_64
40
+ binary_name: ollama-web
41
+ - os: macos-latest
42
+ artifact_name: ollama-web-macos-universal
43
+ binary_name: ollama-web
44
+ - os: windows-latest
45
+ artifact_name: ollama-web-windows-x64.exe
46
+ binary_name: ollama-web.exe
47
+ runs-on: ${{ matrix.os }}
48
+ steps:
49
+ - uses: actions/checkout@v4
50
+ - name: Set up Python
51
+ uses: actions/setup-python@v5
52
+ with:
53
+ python-version: '3.11'
54
+ - name: Install dependencies & PyInstaller
55
+ run: |
56
+ pip install --upgrade pyinstaller
57
+ pip install .
58
+ - name: Build standalone executable
59
+ run: |
60
+ pyinstaller --onefile --name ollama-web src/ollama_web/__main__.py
61
+ - name: Rename and Stage Binary
62
+ shell: bash
63
+ run: |
64
+ if [ "${{ runner.os }}" = "Windows" ]; then
65
+ mv dist/ollama-web.exe dist/${{ matrix.artifact_name }}
66
+ else
67
+ chmod +x dist/ollama-web
68
+ mv dist/ollama-web dist/${{ matrix.artifact_name }}
69
+ fi
70
+ - name: Upload to GitHub Release
71
+ if: startsWith(github.ref, 'refs/tags/v')
72
+ uses: softprops/action-gh-release@v2
73
+ with:
74
+ files: dist/${{ matrix.artifact_name }}
@@ -0,0 +1,12 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.egg-info/
5
+ .installed.cfg
6
+ *.egg
7
+ build/
8
+ dist/
9
+ .env
10
+ .venv/
11
+ env/
12
+ venv/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Cicada & Antigravity Community
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,305 @@
1
+ Metadata-Version: 2.5
2
+ Name: ollama-web
3
+ Version: 1.0.0
4
+ Summary: Universal live web search, deep HTML table scraper, desktop GUI proxy daemon, and MCP server for Ollama on Linux, macOS, and Windows.
5
+ Project-URL: Homepage, https://github.com/AjarnSpencer/ollama-web
6
+ Project-URL: Repository, https://github.com/AjarnSpencer/ollama-web
7
+ Project-URL: Issues, https://github.com/AjarnSpencer/ollama-web/issues
8
+ Author-email: Ajarn Spencer Littlewood <ajarnspencer@gmail.com>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Requires-Python: >=3.9
12
+ Requires-Dist: beautifulsoup4>=4.11.0
13
+ Requires-Dist: ddgs>=1.0.0
14
+ Requires-Dist: lxml>=4.9.0
15
+ Requires-Dist: requests>=2.28.0
16
+ Provides-Extra: all
17
+ Requires-Dist: fastapi>=0.100.0; extra == 'all'
18
+ Requires-Dist: ollama-speak>=1.0.0; extra == 'all'
19
+ Requires-Dist: uvicorn>=0.22.0; extra == 'all'
20
+ Provides-Extra: proxy
21
+ Requires-Dist: fastapi>=0.100.0; extra == 'proxy'
22
+ Requires-Dist: uvicorn>=0.22.0; extra == 'proxy'
23
+ Provides-Extra: speak
24
+ Requires-Dist: ollama-speak>=1.0.0; extra == 'speak'
25
+ Description-Content-Type: text/markdown
26
+
27
+ # 🌐 ollama-web (`oweb`)
28
+
29
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
30
+ [![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/)
31
+ [![Ollama](https://img.shields.io/badge/Ollama-Local%20AI-orange.svg)](https://ollama.ai/)
32
+ [![Zero API Keys](https://img.shields.io/badge/API%20Keys-Zero%20Required-green.svg)](#zero-key-architecture)
33
+
34
+ > **Universal live web search, deep HTML table scraper, desktop GUI proxy daemon, and MCP server for Ollama on Linux, macOS, and Windows.**
35
+
36
+ `ollama-web` bridges the gap between local AI and the live internet. It works universally across **any model** you have downloaded locally (`llama3.1`, `dolphin-llama3`, `gemma2`, `qwen2.5`, `mistral`, etc.), requires **zero API keys**, converts sports scores and fixture lists into structured markdown tables, and provides a **transparent proxy daemon** so desktop GUI apps (like Chatbox, LibreChat, and Open WebUI) get real-time internet search out of the box.
37
+
38
+ ---
39
+
40
+ ## ✨ Features
41
+
42
+ - **Universal Model Agnostic:** Automatically queries your local Ollama daemon (`/api/tags`). Never assumes specific models are installed; dynamically resolves and fuzzy-matches whatever you have on disk.
43
+ - **Interactive First-Run Setup:** If you don't specify a model, an interactive numbered menu shows your local models and lets you select a default with one keystroke, remembered across sessions.
44
+ - **Zero API Key Requirement:** Combines DuckDuckGo and Google News RSS out of the box. Zero accounts, zero credit cards, zero rate-limit blocks.
45
+ - **Deep HTML Table & JavaScript Scraper:** Automatically converts HTML tables into clean Markdown tables, and falls back to Jina Reader (`r.jina.ai`) for JavaScript-rendered scoreboards.
46
+ - **Explicit URL Deep Reader:** Pass any URL in your prompt to scrape full page text (up to 7,500 chars) directly into your model context.
47
+ - **Real-Time Terminal Streaming (Never Stare at a Blank Screen):** Live search queries and page-reading progress appear immediately so you always know what the tool is doing. Model tokens stream live token-by-token directly to your terminal—fully visible, readable, and copy-pasteable.
48
+ - **Zero-Flag Spoken Audio:** Answers are automatically spoken aloud as soon as generation completes when the lightweight companion `ollama-speak` is installed. No complex pipes or extra flags needed! If you prefer silence, simply pass `-q` or `--mute`.
49
+ - **Unix Composable Voice:** Seamlessly pairs with companion [`ollama-speak`](https://github.com/AjarnSpencer/ollama-speak) for multilingual spoken readout via pipes (`| ollama-speak`) or automatic background narration. Pipes never swallow text!
50
+ - **Syntax Guardrails:** Proactively detects common CLI slip-ups like unclosed quotes (`"`) or accidental `-m web` flags without crashing.
51
+ - **Transparent Desktop GUI Proxy (`--proxy`):** Runs a lightweight local proxy on `127.0.0.1:11435`. Point any Ollama GUI client (Ollama Desktop, Chatbox, LibreChat, Open WebUI) to port 11435 for instant live web search.
52
+ - **Native MCP Server (`--mcp`):** Plugs directly into Claude Desktop, Cursor, and Antigravity as a Model Context Protocol tool provider.
53
+
54
+ ---
55
+
56
+ ## 🚀 Quickstart and Installation
57
+
58
+ ### Option 1 (Recommended) — One-Line Turnkey Installer
59
+ Works cleanly on fresh Linux, macOS, and WSL systems without requiring manual virtual environments or tripping PEP 668 system python locks.
60
+
61
+ **Linux and macOS:**
62
+ ```bash
63
+ curl -fsSL https://raw.githubusercontent.com/AjarnSpencer/ollama-web/main/install.sh | bash
64
+ ```
65
+
66
+ **Windows (PowerShell):**
67
+ ```powershell
68
+ irm https://raw.githubusercontent.com/AjarnSpencer/ollama-web/main/install.ps1 | iex
69
+ ```
70
+
71
+ What the turnkey installer does:
72
+ - Sets up an isolated virtual environment in `~/.local/share/ollama-web/venv` (zero system conflicts).
73
+ - Symlinks `ollama-web` and `oweb` launchers into `~/.local/bin/`.
74
+ - Configures user `PATH` if not already set.
75
+
76
+ ---
77
+
78
+ ### Option 2 — Install from GitHub with pipx or pip
79
+ If you prefer managing Python CLI tools via `pipx` (recommended by Python Packaging Authority for standalone tools) or an active virtual environment:
80
+
81
+ **Using pipx (Recommended for Python users):**
82
+ ```bash
83
+ pipx install git+https://github.com/AjarnSpencer/ollama-web.git
84
+ ```
85
+
86
+ **Using pip in a virtual environment:**
87
+ ```bash
88
+ pip install git+https://github.com/AjarnSpencer/ollama-web.git
89
+ ```
90
+
91
+ ---
92
+
93
+ ### Option 3 — Standalone Single-File Binaries (Zero Python Required)
94
+ Download the standalone executable for your operating system from the [Latest Releases](https://github.com/AjarnSpencer/ollama-web/releases):
95
+ - **Windows:** `ollama-web-windows-x64.exe`
96
+ - **macOS:** `ollama-web-macos-universal`
97
+ - **Linux:** `ollama-web-linux-x86_64` / `ollama-web-linux-arm64`
98
+
99
+ ---
100
+
101
+ ### 📦 Publishing to PyPI (For Maintainers)
102
+ To unlock global installation via `pip install ollama-web` worldwide:
103
+ 1. Build distributions: `python3 -m build` (generates wheels and tarballs in `dist/`).
104
+ 2. Upload to PyPI: `twine upload dist/*` with your PyPI token.
105
+ Once published, users can install directly via `pip install --upgrade ollama-web`.
106
+
107
+ ---
108
+
109
+ ## 📖 Complete Command Line Reference and Flags
110
+
111
+ `ollama-web` accepts flexible argument ordering. You can pass flags anywhere or use positional tokens.
112
+
113
+ ### Flags Table
114
+
115
+ | Flag | Short | Default | Description |
116
+ | :--- | :--- | :--- | :--- |
117
+ | `--model MODEL` | `-m` | `config.default_model` | Specify target Ollama model (fuzzy-matched against local models) |
118
+ | `--install-hook` | | | Seamlessly add live search and voice to native `ollama run` in your terminal |
119
+ | `--remove-hook` | | | Remove terminal shell hook from `.bashrc` / `.zshrc` |
120
+ | `--mute` | `-q`, `--quiet` | `False` | Mute spoken audio output (silent text-only terminal mode) |
121
+ | `--speak` | `-s` | `True` (auto) | Force spoken voice output (voice is already ON by default if companion is installed) |
122
+ | `--proxy` | | `False` | Launch transparent desktop GUI proxy daemon |
123
+ | `--port PORT` | | `11435` | Custom TCP port for the proxy daemon |
124
+ | `--mcp` | | `False` | Run as standard Model Context Protocol (stdio MCP) server |
125
+ | `--list-models` | `-l` | | Print table of all locally installed Ollama models and exit |
126
+ | `--no-search` | | `False` | Query model directly without live web search |
127
+ | `--think` | | `False` | Enable reasoning thinking stream (DeepSeek-R1, QwQ, etc.) |
128
+ | `-h`, `--help` | | | Show full help manual and flag descriptions |
129
+
130
+ ---
131
+
132
+ ## 💡 Practical Tutorials and Workflows
133
+
134
+ ### Tutorial 1 — Quick Real-Time Web Search (Text + Automatic Voice)
135
+ Run a live web search using your configured default model:
136
+ ```bash
137
+ ollama-web "What are the latest breakthroughs in fusion energy this week?"
138
+ ```
139
+ `ollama-web` will:
140
+ 1. Search live web sources and Google News RSS.
141
+ 2. Scrape top resulting pages with live status updates on stderr so you know what is happening.
142
+ 3. Stream tokens directly to your terminal in real time (fully readable and copy-pasteable).
143
+ 4. Automatically speak the summary aloud when finished if companion `ollama-speak` is installed.
144
+
145
+ ---
146
+
147
+ ### Tutorial 2 — Silent Terminal Mode (`-q` / `--mute`)
148
+ If you want to read in silence without audio playback:
149
+ ```bash
150
+ ollama-web -q "Latest developments in quantum computing"
151
+ ```
152
+ Or use `--mute` anytime.
153
+
154
+ ---
155
+
156
+ ### Tutorial 3 — Native Terminal Integration (`ollama-web --install-hook`)
157
+ If you want your standard `ollama` terminal command to automatically gain live web search and voice without changing your habits:
158
+ ```bash
159
+ ollama-web --install-hook
160
+ source ~/.bashrc # or source ~/.zshrc
161
+ ```
162
+ Now, whenever you use `ollama` in the terminal:
163
+ - **One-shot prompt with live search + voice:**
164
+ ```bash
165
+ ollama run llama3.1 "What are today's top tech headlines?"
166
+ ```
167
+ - **Direct web search shortcut:**
168
+ ```bash
169
+ ollama web "Champions League fixtures this week"
170
+ ```
171
+ - **Standard Ollama commands:**
172
+ `ollama list`, `ollama pull`, and interactive sessions continue to pass through directly to the native `ollama` binary without modification.
173
+
174
+ To remove the hook at any time:
175
+ ```bash
176
+ ollama-web --remove-hook
177
+ ```
178
+
179
+ ---
180
+
181
+ ### Tutorial 4 — Targeting a Specific Local Model
182
+ You can specify the model either with `-m` or by typing the model name directly as the first argument:
183
+ ```bash
184
+ # Using the -m flag:
185
+ ollama-web -m dolphin-llama3:70b "Latest UEFA Champions League results and standings"
186
+
187
+ # Or using natural positional syntax:
188
+ ollama-web qwen2.5:32b "Summarize today's top artificial intelligence headlines"
189
+ ```
190
+
191
+ ---
192
+
193
+ ### Tutorial 5 — Extracting HTML Tables into Markdown
194
+ Ask for tables directly—`ollama-web` automatically converts complex HTML tables from web pages into clean Markdown tables:
195
+ ```bash
196
+ ollama-web -m llama3.1 "Latest 5 English Premier League results and table standings"
197
+ ```
198
+
199
+ ---
200
+
201
+ ### Tutorial 6 — Deep Scraping Explicit URLs
202
+ If you want your local LLM to read and analyze an exact web article or blog post, simply include the URL in your prompt:
203
+ ```bash
204
+ ollama-web "https://arstechnica.com/science/ Summarize the lead space exploration article"
205
+ ```
206
+ `ollama-web` will detect the URL, fetch its full clean text (up to 7,500 characters), and feed it directly into the prompt context alongside any web search results.
207
+
208
+ ---
209
+
210
+ ### Tutorial 7 — Reasoning Models with Thinking Mode (`--think`)
211
+ For reasoning models (like `deepseek-r1`, `qwq`, or thinking-enabled checkpoints), pass `--think` to stream internal reasoning tokens before the final answer:
212
+ ```bash
213
+ ollama-web -m deepseek-r1:14b --think "Analyze the current economic trends from today's market news"
214
+ ```
215
+
216
+ ---
217
+
218
+ ### Tutorial 8 — Pure Local Inference Without Web Search (`--no-search`)
219
+ Need to ask your model a general programming or logic question without scraping the web? Pass `--no-search`:
220
+ ```bash
221
+ ollama-web --no-search -m llama3.1 "Write a Python script to sort a dictionary by values"
222
+ ```
223
+
224
+ ---
225
+
226
+ ### Tutorial 9 — Interactive REPL Session
227
+ Running `ollama-web` without arguments launches an interactive shell with conversation memory:
228
+ ```bash
229
+ ollama-web
230
+ ```
231
+ Inside the interactive prompt:
232
+ - `/model <name>` — Switch the active local model on the fly
233
+ - `/models` — List all local Ollama models and their parameters
234
+ - `/mute` or `/speak` — Toggle companion voice audio on or off
235
+ - `/clear` — Reset conversational memory
236
+ - `/exit` — Quit the session
237
+
238
+ ---
239
+
240
+ ### Tutorial 10 — Spoken Voice with Companion `ollama-speak`
241
+ `ollama-web` pairs natively with [`ollama-speak`](https://github.com/AjarnSpencer/ollama-speak):
242
+
243
+ **Method A — Zero-Flag Automatic Voice:**
244
+ Just run `ollama-web "..."`. The terminal prints text live while you listen to the spoken answer.
245
+
246
+ **Method B — Unix Pipe (Zero-Swallow Output):**
247
+ ```bash
248
+ ollama-web "Who won yesterday's basketball matches?" | ollama-speak
249
+ ```
250
+ `ollama-speak` mirrors the text directly to `stdout` so pipes never swallow your screen output.
251
+
252
+ ---
253
+
254
+ ### Tutorial 11 — Transparent Desktop GUI Proxy (`--proxy`)
255
+ Enable live web search inside your favorite Ollama desktop apps (Chatbox, LibreChat, Open WebUI, Jan.ai):
256
+
257
+ 1. **Start the proxy in a background terminal:**
258
+ ```bash
259
+ ollama-web --proxy --port 11435
260
+ ```
261
+ 2. **Point your desktop app's Ollama Base URL to port 11435:**
262
+ - Change `http://127.0.0.1:11434` to `http://127.0.0.1:11435`
263
+ 3. **Submit any question from your GUI:**
264
+ The proxy automatically searches the web, deep-scrapes tables, injects context, and streams tokens back into your graphical desktop app!
265
+
266
+ ---
267
+
268
+ ### Tutorial 12 — Model Context Protocol (MCP) in Claude Desktop
269
+ To expose web search tools directly to Claude Desktop, Cursor, or Antigravity, add this to your `claude_desktop_config.json`:
270
+ ```json
271
+ {
272
+ "mcpServers": {
273
+ "ollama-web": {
274
+ "command": "ollama-web",
275
+ "args": ["--mcp"]
276
+ }
277
+ }
278
+ }
279
+ ```
280
+
281
+ ---
282
+
283
+ ## ⚙️ Persistent Configuration
284
+
285
+ Your defaults are saved in `~/.config/ollama-web/config.json` (or `%APPDATA%\ollama-web\config.json` on Windows):
286
+
287
+ ```json
288
+ {
289
+ "default_model": "llama3.1:70b",
290
+ "search_mode": "auto",
291
+ "num_ctx": 16384,
292
+ "max_search_results": 5,
293
+ "voice_enabled": true
294
+ }
295
+ ```
296
+
297
+ ---
298
+
299
+ ## 🤝 Contributing
300
+
301
+ Contributions, issues, and feature requests are welcome! Feel free to check the [Issues page](https://github.com/AjarnSpencer/ollama-web/issues).
302
+
303
+ ## 📄 License
304
+
305
+ This project is licensed under the [MIT License](LICENSE).