2026-03-09 21:42:17 +08:00
|
|
|
# ⚡ Quick Deployment Reference
|
2026-03-09 20:31:25 +08:00
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
## One-line Deploy Commands
|
2026-03-09 20:31:25 +08:00
|
|
|
|
|
|
|
|
```bash
|
2026-03-09 21:42:17 +08:00
|
|
|
# Deploy async_context_compression Filter (default)
|
2026-03-09 20:31:25 +08:00
|
|
|
cd scripts && python deploy_filter.py
|
|
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
# List all available Filters
|
2026-03-09 20:31:25 +08:00
|
|
|
cd scripts && python deploy_filter.py --list
|
|
|
|
|
```
|
|
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
## Setup Steps (One time only)
|
2026-03-09 20:31:25 +08:00
|
|
|
|
|
|
|
|
```bash
|
2026-03-09 21:42:17 +08:00
|
|
|
# 1. Enter scripts directory
|
2026-03-09 20:31:25 +08:00
|
|
|
cd scripts
|
|
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
# 2. Create .env file with your OpenWebUI API key
|
2026-03-09 20:31:25 +08:00
|
|
|
echo "api_key=sk-your-api-key-here" > .env
|
|
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
# 3. Make sure OpenWebUI is running on localhost:3000
|
2026-03-09 20:31:25 +08:00
|
|
|
```
|
|
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
## Get Your API Key
|
2026-03-09 20:31:25 +08:00
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
1. Open OpenWebUI → user avatar → Settings
|
|
|
|
|
2. Find "API Keys" section
|
|
|
|
|
3. Copy your key (starts with sk-)
|
|
|
|
|
4. Paste into `.env` file
|
2026-03-09 20:31:25 +08:00
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
## Deployment Workflow
|
2026-03-09 20:31:25 +08:00
|
|
|
|
|
|
|
|
```bash
|
2026-03-09 21:42:17 +08:00
|
|
|
# 1. Edit plugin code
|
2026-03-09 20:31:25 +08:00
|
|
|
vim ../plugins/filters/async-context-compression/async_context_compression.py
|
|
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
# 2. Deploy to local
|
2026-03-09 20:31:25 +08:00
|
|
|
python deploy_filter.py
|
|
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
# 3. Test in OpenWebUI (no restart needed)
|
2026-03-09 20:31:25 +08:00
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
# 4. Deploy again (auto-overwrites)
|
2026-03-09 20:31:25 +08:00
|
|
|
python deploy_filter.py
|
|
|
|
|
```
|
|
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
## Common Commands
|
2026-03-09 20:31:25 +08:00
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
| Command | Description |
|
|
|
|
|
|---------|-------------|
|
|
|
|
|
| `python deploy_filter.py` | Deploy async_context_compression |
|
|
|
|
|
| `python deploy_filter.py filter-name` | Deploy specific Filter |
|
|
|
|
|
| `python deploy_filter.py --list` | List all available Filters |
|
|
|
|
|
| `python deploy_pipe.py` | Deploy GitHub Copilot SDK Pipe |
|
2026-03-09 20:31:25 +08:00
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
## Troubleshooting
|
2026-03-09 20:31:25 +08:00
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
| Error | Cause | Solution |
|
|
|
|
|
|-------|-------|----------|
|
|
|
|
|
| Connection error | OpenWebUI not running | Start OpenWebUI or check port |
|
|
|
|
|
| .env not found | Config file not created | `echo "api_key=sk-..." > .env` |
|
|
|
|
|
| Filter not found | Filter name is wrong | Run `python deploy_filter.py --list` |
|
|
|
|
|
| Status 401 | API key invalid | Update key in `.env` |
|
2026-03-09 20:31:25 +08:00
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
## File Locations
|
2026-03-09 20:31:25 +08:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
openwebui-extensions/
|
|
|
|
|
├── scripts/
|
2026-03-09 21:42:17 +08:00
|
|
|
│ ├── deploy_filter.py ← Filter deployment tool
|
|
|
|
|
│ ├── deploy_pipe.py ← Pipe deployment tool
|
|
|
|
|
│ ├── .env ← API key (don't commit)
|
|
|
|
|
│ └── DEPLOYMENT_GUIDE.md ← Full guide
|
2026-03-09 20:31:25 +08:00
|
|
|
│
|
|
|
|
|
└── plugins/
|
|
|
|
|
└── filters/
|
|
|
|
|
└── async-context-compression/
|
|
|
|
|
├── async_context_compression.py
|
|
|
|
|
├── README.md
|
|
|
|
|
└── README_CN.md
|
|
|
|
|
```
|
|
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
## Suggested Workflow
|
2026-03-09 20:31:25 +08:00
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
### Fast Iterative Development
|
2026-03-09 20:31:25 +08:00
|
|
|
|
|
|
|
|
```bash
|
2026-03-09 21:42:17 +08:00
|
|
|
# Terminal 1: Start OpenWebUI (if not running)
|
|
|
|
|
docker run -d -p 3000:8080 ghcr.io/open-webui/open-webui:latest
|
2026-03-09 20:31:25 +08:00
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
# Terminal 2: Development loop (repeated)
|
2026-03-09 20:31:25 +08:00
|
|
|
cd scripts
|
2026-03-09 21:42:17 +08:00
|
|
|
code ../plugins/filters/async-context-compression/ # Edit code
|
|
|
|
|
python deploy_filter.py # Deploy
|
|
|
|
|
# → Test in OpenWebUI
|
|
|
|
|
# → Go back to edit, repeat
|
2026-03-09 20:31:25 +08:00
|
|
|
```
|
|
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
### CI/CD Integration
|
2026-03-09 20:31:25 +08:00
|
|
|
|
|
|
|
|
```bash
|
2026-03-09 21:42:17 +08:00
|
|
|
# In GitHub Actions
|
2026-03-09 20:31:25 +08:00
|
|
|
- name: Deploy filter to staging
|
|
|
|
|
run: |
|
|
|
|
|
cd scripts
|
|
|
|
|
python deploy_filter.py async-context-compression
|
|
|
|
|
env:
|
|
|
|
|
api_key: ${{ secrets.OPENWEBUI_API_KEY }}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
2026-03-09 21:42:17 +08:00
|
|
|
📚 **More Help**: See `DEPLOYMENT_GUIDE.md`
|