5.6 KiB
5.6 KiB
Ollama Sidebar
A browser sidebar chat extension that connects to a self-hosted Ollama instance. Built for Orion (WebKit) with full Chrome support. No cloud, no accounts, no bundler — loads unpacked directly from disk.
Requirements
- Ollama running locally or on a remote host
- Chrome 114+ or Orion (beta Chrome extension support)
- At least one model pulled in Ollama
OLLAMA_ORIGINS=*set on the Ollama instance if proxied through Nginx or another reverse proxy
Browser Compatibility
| Browser | Status | Notes |
|---|---|---|
| Orion | ✅ Main supported browser | File picker button does not open a picker — drag and drop files onto the chat instead. Under investigation. |
| Chrome | ✅ Fully working | All features including file picker. sidebar_action manifest warning is expected and harmless. |
| Firefox | 🔜 Not yet supported | Possible future support. |
Installation
- Clone or download this repository
- Open the
icons/folder — if the PNG files are missing, opengenerate_icons.htmlin a browser and save the three icons into theicons/folder - Chrome: go to
chrome://extensions, enable Developer Mode, click Load unpacked, select the project folder - Orion: go to Tools → Extensions → Install from Disk, select the project folder
- Click the extension icon in the toolbar to open the sidebar
First-time setup
- Click the ⚙ Settings button in the sidebar header
- Set your Ollama Base URL (default:
http://localhost:11434) - Click Test Connection — connected models will appear in the dropdowns
- Set a Default Chat Model
- Click Save Settings
If Ollama is behind a reverse proxy with bearer token auth, enter the token in the Bearer Token field.
Features
Chat
- Streaming responses with stop, regenerate, and edit
- Thinking/reasoning block support (collapsed by default)
- Full markdown rendering with syntax-highlighted code blocks
- Token metrics per response (tokens, tok/s, duration)
Context
- Add the current page as context with the 🌐 button — uses a Readability-style algorithm to extract main content, strips navigation and noise
- Drag and drop files onto the chat to attach (
.txt,.md,.csv,.pdf, images) - PDF text extraction via PDF.js
- Image support for vision-capable models (llava, qwen-vl, etc.)
- Keyword and semantic RAG — relevant chunks are selected before being sent, scaled to your model's context window
Sessions
- Multiple named chat sessions with create, delete, search, and export as Markdown
- Auto-generated session names from the first message
- Session history persisted in browser storage
Personas
- 8 built-in personas (Assistant, Code Reviewer, Study Buddy, Writing Editor, Rubber Duck, Devil's Advocate, Technical Writer, Be Brief/BLUF)
- Create and save custom personas
- Each session tracks its active persona's system prompt
Prompt Templates
- 10 built-in templates triggered with
/in the input - Create and save custom templates
Models
- Per-session model selector
- Pull new models from the Settings page without leaving the browser
- Multi-model comparison mode — send the same prompt to two models side by side
- Semantic RAG via Ollama
/api/embedendpoint (configure embedding model in Settings)
Settings
- Dark/light theme
- Compact message density
- Auto-scroll during generation
- Response language lock
- Model parameters (temperature, top-p, top-k, repeat penalty, seed, context length, max tokens)
- Default system prompt
- Debug panel with live log, system info, and connection status
Keyboard shortcuts
| Shortcut | Action |
|---|---|
Enter |
Send message |
Shift+Enter |
New line |
Ctrl+K |
New chat |
Ctrl+L |
Clear conversation (press twice to confirm) |
Ctrl+/ |
Open templates |
Ctrl+, |
Open settings |
Ctrl+? |
Show all shortcuts |
Esc |
Close panels and overlays |
Project structure
├── background.js # Service worker — message routing, stream relay
├── content.js # Content script — page text extraction
├── sidepanel.html # Sidebar UI
├── sidepanel.js # Sidebar logic
├── sidepanel.css # Sidebar styles
├── settings.html # Options page
├── settings.js # Options page logic
├── settings.css # Options page styles
├── manifest.json # Extension manifest (MV3)
├── marked.min.js # Markdown rendering
├── highlight.min.js # Syntax highlighting
├── hljs-github-dark.min.css # Highlight.js theme
├── pdf.min.js # PDF.js v3 — PDF text extraction
├── pdf.worker.min.js # PDF.js worker
├── pdf-init.js # PDF.js worker initialisation
└── icons/
├── icon16.png
├── icon48.png
└── icon128.png
Notes
- File upload: Chrome supports the native file picker via the attach button. Orion does not currently open the file picker — drag and drop files directly onto the chat area instead. This is under investigation.
- Semantic RAG: Requires an embedding model pulled in Ollama (recommended:
nomic-embed-text-v2-moe). Configure it under Settings → Models → Embedding Model. If not configured, keyword matching is used. - Multi-model comparison: Results are not saved to session history.
- Debug panel: Available in Settings → Debug (collapsed by default). Logs auto-clear after 30 minutes.
- Ollama CORS: If requests are blocked, ensure
OLLAMA_ORIGINS=*is set in your Ollama environment or your reverse proxy passes the correct CORS headers.
License
MIT