- Change all default port references from 3003 to 3000 across scripts and documentation - Add quick installation guide for batch plugin installation to main README (EN & CN) - Simplify installation options by removing manual installation instructions - Update deployment guides and examples to reflect new default port
4.8 KiB
4.8 KiB
🚀 Local Deployment Scripts Guide
Overview
This directory contains automated scripts for deploying plugins in development to a local OpenWebUI instance. They enable quick code pushes without restarting OpenWebUI.
Prerequisites
- OpenWebUI Running: Make sure OpenWebUI is running locally (default
http://localhost:3000) - API Key: You need a valid OpenWebUI API key
- Environment File: Create a
.envfile in this directory containing your API key:api_key=sk-xxxxxxxxxxxxx
Quick Start
Deploy a Pipe Plugin
# Deploy GitHub Copilot SDK Pipe
python deploy_pipe.py
Deploy a Filter Plugin
# Deploy async_context_compression Filter (default)
python deploy_filter.py
# Deploy a specific Filter plugin
python deploy_filter.py my-filter-name
# List all available Filters
python deploy_filter.py --list
Script Documentation
deploy_filter.py — Filter Plugin Deployment Tool
Used to deploy Filter-type plugins (such as message filtering, context compression, etc.).
Key Features:
- ✅ Auto-extracts metadata from Python files (version, author, description, etc.)
- ✅ Attempts to update existing plugins, creates if not found
- ✅ Supports multiple Filter plugin management
- ✅ Detailed error messages and connection diagnostics
Usage:
# Deploy async_context_compression (default)
python deploy_filter.py
# Deploy other Filters
python deploy_filter.py async-context-compression
python deploy_filter.py workflow-guide
# List all available Filters
python deploy_filter.py --list
python deploy_filter.py -l
Workflow:
- Load API key from
.env - Find target Filter plugin directory
- Read Python source file
- Extract metadata from docstring (title, version, author, description, etc.)
- Build API request payload
- Send update request to OpenWebUI
- If update fails, auto-attempt to create new plugin
- Display results and diagnostic info
deploy_pipe.py — Pipe Plugin Deployment Tool
Used to deploy Pipe-type plugins (such as GitHub Copilot SDK).
Usage:
python deploy_pipe.py
Get an API Key
Method 1: Use Existing User Token (Recommended)
- Open OpenWebUI interface
- Click user avatar → Settings
- Find the API Keys section
- Copy your API key (starts with sk-)
- Paste into
.envfile
Method 2: Create a Long-term API Key
Create a dedicated long-term API key in OpenWebUI Settings for deployment purposes.
Troubleshooting
"Connection error: Could not reach OpenWebUI at localhost:3000"
Cause: OpenWebUI is not running or port is different
Solution:
- Make sure OpenWebUI is running
- Check which port OpenWebUI is actually listening on (usually 3000)
- Edit the URL in the script if needed
".env file not found"
Cause: .env file was not created
Solution:
echo "api_key=sk-your-api-key-here" > .env
"Filter 'xxx' not found"
Cause: Filter directory name is incorrect
Solution:
# List all available Filters
python deploy_filter.py --list
"Failed to update or create. Status: 401"
Cause: API key is invalid or expired
Solution:
- Verify your API key is valid
- Generate a new API key
- Update the
.envfile
Workflow Examples
Develop and Deploy a New Filter
# 1. Create new Filter directory in plugins/filters/
mkdir plugins/filters/my-new-filter
# 2. Create my_new_filter.py with required metadata:
# """
# title: My New Filter
# author: Your Name
# version: 1.0.0
# description: Filter description
# """
# 3. Deploy to local OpenWebUI
cd scripts
python deploy_filter.py my-new-filter
# 4. Test the plugin in OpenWebUI UI
# 5. Continue development
# ... modify code ...
# 6. Re-deploy (auto-overwrites)
python deploy_filter.py my-new-filter
Fix a Bug and Deploy Quickly
# 1. Modify the source code
# vim ../plugins/filters/async-context-compression/async_context_compression.py
# 2. Deploy immediately to local
python deploy_filter.py async-context-compression
# 3. Test the fix in OpenWebUI
# (No need to restart OpenWebUI)
Security Considerations
⚠️ Important:
- ✅ Add
.envfile to.gitignore(avoid committing sensitive info) - ✅ Never commit API keys to version control
- ✅ Use only on trusted networks
- ✅ Rotate API keys periodically
File Structure
scripts/
├── deploy_filter.py # Filter plugin deployment tool
├── deploy_pipe.py # Pipe plugin deployment tool
├── .env # API key (local, not committed)
├── README.md # This file
└── ...
Reference Resources
Last Updated: 2026-03-09
Author: Fu-Jie