|
| 1 | +# Open WebUI + LiteLLM Deployment |
| 2 | + |
| 3 | +A phased deployment of Open WebUI with LiteLLM proxy for chatting with Claude models, designed to work with the Ambient Code Platform's Kind cluster. |
| 4 | + |
| 5 | +## Architecture |
| 6 | + |
| 7 | +- **Phase 1**: Open WebUI → LiteLLM → Anthropic Claude API (simple proxy, no auth) |
| 8 | +- **Phase 2** (Future): Long-running Claude service for Amber agent integration |
| 9 | + |
| 10 | +## Quick Start (Phase 1) |
| 11 | + |
| 12 | +### Prerequisites |
| 13 | + |
| 14 | +1. **Kind cluster running** with nginx-ingress: |
| 15 | + ```bash |
| 16 | + cd ../../e2e |
| 17 | + ./scripts/setup-kind.sh |
| 18 | + # Or if using Podman: CONTAINER_ENGINE=podman ./scripts/setup-kind.sh |
| 19 | + ``` |
| 20 | + |
| 21 | +2. **Anthropic API key**: Get yours from [console.anthropic.com](https://console.anthropic.com) |
| 22 | + |
| 23 | +### Deploy |
| 24 | + |
| 25 | +1. **Configure API key**: |
| 26 | + ```bash |
| 27 | + cd overlays/phase1-kind |
| 28 | + |
| 29 | + # Edit secrets.yaml and replace sk-ant-YOUR-KEY-HERE with your actual key |
| 30 | + # Or use sed: |
| 31 | + sed -i.bak 's/sk-ant-YOUR-KEY-HERE/sk-ant-api01-YOUR-ACTUAL-KEY/g' secrets.yaml |
| 32 | + ``` |
| 33 | + |
| 34 | +2. **Deploy to Kind**: |
| 35 | + ```bash |
| 36 | + cd ../.. # Back to components/open-webui-llm/ |
| 37 | + make phase1-deploy |
| 38 | + ``` |
| 39 | + |
| 40 | +3. **Wait for pods** (automatic, but you can check): |
| 41 | + ```bash |
| 42 | + make phase1-status |
| 43 | + ``` |
| 44 | + |
| 45 | +4. **Access Open WebUI**: |
| 46 | + - **Docker**: http://vteam.local/chat |
| 47 | + - **Podman**: http://vteam.local:8080/chat |
| 48 | + |
| 49 | +### Usage |
| 50 | + |
| 51 | +1. Open the URL in your browser |
| 52 | +2. No login required (Phase 1 has auth disabled) |
| 53 | +3. Select a model from the dropdown: |
| 54 | + - `claude-sonnet-4-5` (recommended) |
| 55 | + - `claude-sonnet-3-7` |
| 56 | + - `claude-haiku-3-5` |
| 57 | +4. Start chatting! |
| 58 | + |
| 59 | +## Management Commands |
| 60 | + |
| 61 | +```bash |
| 62 | +# View logs |
| 63 | +make phase1-logs # Open WebUI logs |
| 64 | +make phase1-logs-litellm # LiteLLM logs |
| 65 | + |
| 66 | +# Check status |
| 67 | +make phase1-status # All resources |
| 68 | + |
| 69 | +# Run health checks |
| 70 | +make phase1-test # Verify LiteLLM and Open WebUI connectivity |
| 71 | + |
| 72 | +# Clean up |
| 73 | +make phase1-clean # Remove all resources |
| 74 | +``` |
| 75 | + |
| 76 | +## Troubleshooting |
| 77 | + |
| 78 | +### Pods not starting |
| 79 | + |
| 80 | +```bash |
| 81 | +# Check pod status |
| 82 | +kubectl get pods -n openwebui |
| 83 | + |
| 84 | +# View pod logs |
| 85 | +kubectl logs -n openwebui deployment/openwebui |
| 86 | +kubectl logs -n openwebui deployment/litellm |
| 87 | + |
| 88 | +# Describe pod for events |
| 89 | +kubectl describe pod -n openwebui -l app=openwebui |
| 90 | +``` |
| 91 | + |
| 92 | +### LiteLLM errors |
| 93 | + |
| 94 | +**"No API key provided"**: |
| 95 | +- Check secrets.yaml has your actual Anthropic API key |
| 96 | +- Verify secret was created: `kubectl get secret litellm-secrets -n openwebui -o yaml` |
| 97 | + |
| 98 | +**"Model not found"**: |
| 99 | +- Check LiteLLM config: `kubectl get cm litellm-config -n openwebui -o yaml` |
| 100 | +- Verify model names match Anthropic's API |
| 101 | + |
| 102 | +### Ingress not working |
| 103 | + |
| 104 | +**Docker** (ports 80/443): |
| 105 | +```bash |
| 106 | +# Verify vteam.local resolves to 127.0.0.1 |
| 107 | +grep vteam.local /etc/hosts |
| 108 | + |
| 109 | +# Test ingress |
| 110 | +curl http://vteam.local/chat |
| 111 | +``` |
| 112 | + |
| 113 | +**Podman** (ports 8080/8443): |
| 114 | +```bash |
| 115 | +# Use port 8080 |
| 116 | +curl http://vteam.local:8080/chat |
| 117 | +``` |
| 118 | + |
| 119 | +**Fallback - Port forwarding**: |
| 120 | +```bash |
| 121 | +# Access via localhost instead |
| 122 | +make phase1-port-forward |
| 123 | +# Then open: http://localhost:8080 |
| 124 | +``` |
| 125 | + |
| 126 | +### PVC not binding |
| 127 | + |
| 128 | +```bash |
| 129 | +# Check PVC status |
| 130 | +kubectl get pvc -n openwebui |
| 131 | + |
| 132 | +# If pending, check storage class |
| 133 | +kubectl get sc |
| 134 | + |
| 135 | +# Kind should have 'standard' storage class by default |
| 136 | +``` |
| 137 | + |
| 138 | +## Component Structure |
| 139 | + |
| 140 | +``` |
| 141 | +. |
| 142 | +├── base/ # Shared base manifests |
| 143 | +│ ├── namespace.yaml |
| 144 | +│ ├── rbac.yaml # ServiceAccounts |
| 145 | +│ ├── litellm/ # LiteLLM proxy |
| 146 | +│ │ ├── deployment.yaml |
| 147 | +│ │ ├── service.yaml |
| 148 | +│ │ └── configmap.yaml # Model routing |
| 149 | +│ ├── open-webui/ # Web UI |
| 150 | +│ │ ├── deployment.yaml |
| 151 | +│ │ ├── service.yaml |
| 152 | +│ │ └── pvc.yaml # Persistent storage |
| 153 | +│ └── kustomization.yaml |
| 154 | +│ |
| 155 | +├── overlays/ |
| 156 | +│ ├── phase1-kind/ # Phase 1: Simple deployment |
| 157 | +│ │ ├── kustomization.yaml |
| 158 | +│ │ ├── secrets.yaml # API keys (edit this!) |
| 159 | +│ │ ├── ingress.yaml # Nginx ingress |
| 160 | +│ │ └── pvc-patch.yaml # Reduced storage for Kind |
| 161 | +│ │ |
| 162 | +│ └── phase2-production/ # Phase 2: Future (OAuth, Claude service) |
| 163 | +│ └── (planned) |
| 164 | +│ |
| 165 | +├── docs/ |
| 166 | +│ ├── PHASE1.md # Detailed Phase 1 guide |
| 167 | +│ └── PHASE2.md # Phase 2 migration plan |
| 168 | +│ |
| 169 | +├── Makefile # Deployment automation |
| 170 | +└── README.md # This file |
| 171 | +``` |
| 172 | + |
| 173 | +## Data Flow |
| 174 | + |
| 175 | +``` |
| 176 | +User Browser → vteam.local/chat → Nginx Ingress → Open WebUI Service |
| 177 | + → Open WebUI Pod → LiteLLM Service → LiteLLM Pod → Anthropic API |
| 178 | +``` |
| 179 | + |
| 180 | +## Phase 2 (Future) |
| 181 | + |
| 182 | +Phase 2 will add: |
| 183 | +- **Authentication**: OAuth2 proxy for production use |
| 184 | +- **Claude Service**: Long-running Claude Code sessions |
| 185 | +- **Amber Integration**: Direct integration with Amber agent |
| 186 | +- **Production deployment**: OpenShift Routes, proper RBAC |
| 187 | + |
| 188 | +See `docs/PHASE2.md` for migration plan (coming soon). |
| 189 | + |
| 190 | +## Files You May Need to Edit |
| 191 | + |
| 192 | +- **`overlays/phase1-kind/secrets.yaml`**: Add your Anthropic API key here (required) |
| 193 | +- **`base/litellm/configmap.yaml`**: Add more models or adjust LiteLLM settings |
| 194 | +- **`base/open-webui/deployment.yaml`**: Change resource limits or add environment variables |
| 195 | + |
| 196 | +## Clean Up |
| 197 | + |
| 198 | +```bash |
| 199 | +# Remove deployment but keep namespace |
| 200 | +make phase1-clean |
| 201 | + |
| 202 | +# Remove namespace too |
| 203 | +kubectl delete namespace openwebui |
| 204 | +``` |
| 205 | + |
| 206 | +## Next Steps |
| 207 | + |
| 208 | +1. Try chatting with different Claude models |
| 209 | +2. Explore Open WebUI settings (http://vteam.local/chat/settings) |
| 210 | +3. Review LiteLLM logs to see API calls: `make phase1-logs-litellm` |
| 211 | +4. Plan for Phase 2 migration (see `docs/PHASE2.md`) |
| 212 | + |
| 213 | +## Support |
| 214 | + |
| 215 | +- **Documentation**: See `docs/` directory |
| 216 | +- **Issues**: Create an issue in the main repository |
| 217 | +- **Logs**: Always check logs first: `make phase1-logs` |
0 commit comments