Skip to content

plasmate-labs/openwebui-plasmate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenWebUI-Plasmate

Web browsing for Open WebUI powered by Plasmate - the browser engine for AI agents.

10-100x token compression compared to raw HTML, making web content accessible to LLMs without burning through your context window.

Features

  • Fetch Webpages - Get readable, structured content from any URL
  • Web Search - Search the web and fetch top results automatically
  • Extract Links - Get all links from a page for navigation
  • Automatic URL Detection - Filter function auto-fetches URLs shared in chat

Requirements

Installing Plasmate

Download from GitHub releases or build from source:

git clone https://github.com/nicholasarner/plasmate.git
cd plasmate
cargo build --release
sudo cp target/release/plasmate /usr/local/bin/

Installation

Option 1: Import Tool/Function (Recommended)

  1. Download tool.json and function.json from this repository
  2. In Open WebUI, go to Workspace > Tools > Import
  3. Upload tool.json to add the web browsing tools
  4. Go to Workspace > Functions > Import
  5. Upload function.json to add the URL filter

Option 2: Copy-Paste Code

  1. In Open WebUI, go to Workspace > Tools > Create New
  2. Copy the contents of src/openwebui_plasmate/tool.py into the editor
  3. Save as "Plasmate Web Browsing"
  4. Repeat for src/openwebui_plasmate/function.py under Functions

Option 3: pip Install (for Development)

pip install openwebui-plasmate

Or from source:

git clone https://github.com/nicholasarner/openwebui-plasmate.git
cd openwebui-plasmate
pip install -e .

Configuration

Tool Settings (Valves)

Setting Default Description
plasmate_path plasmate Path to Plasmate binary
output_format text Output format: text or json
timeout_seconds 30 Fetch timeout
max_content_length 50000 Max content characters
search_engine duckduckgo Search engine: duckduckgo, google, bing
search_results_count 5 Number of search results to fetch

Function Settings (Valves)

Setting Default Description
enabled true Enable automatic URL fetching
max_urls_per_message 3 Max URLs to fetch per message
max_content_per_url 10000 Max content per URL
exclude_domains localhost,... Domains to skip
inject_position after Where to inject content

Usage

As a Tool

The LLM can call these tools directly when enabled:

Example: Fetch a webpage

User: What does the Plasmate homepage say?
Assistant: [calls fetch_webpage("https://plasmate.app")]
         The Plasmate homepage describes it as a browser engine for AI agents...

Example: Web search

User: Search for the latest news about Open WebUI
Assistant: [calls search_web("Open WebUI latest news")]
         Here are the latest developments...

Example: Extract links

User: What links are on the Hacker News front page?
Assistant: [calls extract_links("https://news.ycombinator.com")]
         Here are the current links on HN...

As a Filter Function

When the URL filter is enabled, sharing URLs automatically fetches content:

User: Can you summarize this article? https://example.com/article

[Filter automatically fetches the page content]

Assistant: Based on the article content, here is a summary...

Screenshots

Screenshots coming soon

How It Works

  1. User sends message with URL or requests web content
  2. Plasmate fetches the webpage using HTTP/1.1 or HTTP/2
  3. HTML is compiled to Semantic Object Model (SOM)
  4. SOM is converted to readable text or structured JSON
  5. Content is returned to Open WebUI with 10-100x fewer tokens

Token Compression

Plasmate achieves dramatic token compression by:

  • Removing non-semantic HTML (scripts, styles, metadata)
  • Extracting meaningful structure (headings, paragraphs, lists)
  • Preserving links and interactive elements
  • Converting to clean, readable text
Page Type Raw HTML Plasmate Compression
News Article 150K tokens 2K tokens 75x
Documentation 80K tokens 4K tokens 20x
E-commerce 200K tokens 5K tokens 40x

Docker Setup

If running Open WebUI in Docker, mount the Plasmate binary:

services:
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    volumes:
      - /usr/local/bin/plasmate:/usr/local/bin/plasmate:ro

Or install Plasmate in a custom image:

FROM ghcr.io/open-webui/open-webui:main
COPY plasmate /usr/local/bin/plasmate
RUN chmod +x /usr/local/bin/plasmate

Troubleshooting

"Plasmate not found"

Ensure Plasmate is in your PATH or update the plasmate_path valve:

  1. Go to Workspace > Tools > Plasmate Web Browsing
  2. Click the gear icon to open settings
  3. Set plasmate_path to the full path (e.g., /usr/local/bin/plasmate)

Timeout errors

Increase the timeout_seconds valve for slow pages or networks.

Content truncated

Increase max_content_length to fetch more content per page.

Contributing

Contributions welcome! Please open an issue or PR on GitHub.

License

MIT License - see LICENSE file for details.

Links

About

Open WebUI tool and function for Plasmate - add web browsing to self-hosted LLMs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages