|
| 1 | +# HuggingChat ChatUI Deployment for OpenShift |
| 2 | + |
| 3 | +This directory contains OpenShift deployment manifests for HuggingFace ChatUI, which provides the HuggingChat interface accessible through the dashboard. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +ChatUI is deployed as a containerized web application that provides a chat interface similar to HuggingChat. It connects to the semantic-router service for LLM inference and uses MongoDB for data persistence. |
| 8 | + |
| 9 | +## Components |
| 10 | + |
| 11 | +- **Deployment**: ChatUI application container |
| 12 | +- **Service**: ClusterIP service for internal access |
| 13 | +- **Route**: OpenShift route for external access with TLS |
| 14 | +- **Dependencies**: MongoDB (deployed separately) |
| 15 | + |
| 16 | +## Configuration |
| 17 | + |
| 18 | +The ChatUI deployment is configured via environment variables: |
| 19 | + |
| 20 | +- `OPENAI_BASE_URL`: Points to semantic-router service (http://semantic-router:8801/v1) |
| 21 | +- `MONGODB_URL`: MongoDB connection string (mongodb://mongo:27017) |
| 22 | +- `PUBLIC_APP_NAME`: Display name ("HuggingChat") |
| 23 | +- `LOG_LEVEL`: Logging level (info) |
| 24 | + |
| 25 | +## Deployment |
| 26 | + |
| 27 | +ChatUI is deployed automatically when running the full OpenShift deployment script: |
| 28 | + |
| 29 | +```bash |
| 30 | +cd deploy/openshift |
| 31 | +./deploy-to-openshift.sh |
| 32 | +``` |
| 33 | + |
| 34 | +### Manual Deployment |
| 35 | + |
| 36 | +If deploying manually, ensure MongoDB is deployed first: |
| 37 | + |
| 38 | +```bash |
| 39 | +# Deploy MongoDB |
| 40 | +oc apply -f deploy/openshift/mongo/deployment.yaml |
| 41 | + |
| 42 | +# Deploy ChatUI |
| 43 | +oc apply -f deploy/openshift/chatui/deployment.yaml |
| 44 | +``` |
| 45 | + |
| 46 | +## Accessing ChatUI |
| 47 | + |
| 48 | +### Through Dashboard |
| 49 | + |
| 50 | +Access ChatUI through the semantic-router dashboard at `/huggingchat`: |
| 51 | + |
| 52 | +```bash |
| 53 | +DASHBOARD_URL=$(oc get route dashboard -n vllm-semantic-router-system -o jsonpath='{.spec.host}') |
| 54 | +echo "HuggingChat: https://$DASHBOARD_URL/huggingchat" |
| 55 | +``` |
| 56 | + |
| 57 | +### Direct Access |
| 58 | + |
| 59 | +Get the ChatUI route URL: |
| 60 | + |
| 61 | +```bash |
| 62 | +CHATUI_URL=$(oc get route chatui -n vllm-semantic-router-system -o jsonpath='{.spec.host}') |
| 63 | +echo "ChatUI direct URL: https://$CHATUI_URL" |
| 64 | +``` |
| 65 | + |
| 66 | +## Integration with Dashboard |
| 67 | + |
| 68 | +The dashboard backend proxies ChatUI at `/embedded/chatui/` and the frontend displays it in an iframe at `/huggingchat`. The integration requires: |
| 69 | + |
| 70 | +1. **TARGET_CHATUI_URL environment variable** in dashboard ConfigMap pointing to `http://chatui:3000` |
| 71 | +2. **ChatUI service** running and accessible within the cluster |
| 72 | +3. **MongoDB service** running for ChatUI data persistence |
| 73 | + |
| 74 | +## Troubleshooting |
| 75 | + |
| 76 | +### ChatUI Not Loading |
| 77 | + |
| 78 | +1. Check if ChatUI pod is running: |
| 79 | + |
| 80 | + ```bash |
| 81 | + oc get pods -l app=chatui -n vllm-semantic-router-system |
| 82 | + ``` |
| 83 | + |
| 84 | +2. Check ChatUI logs: |
| 85 | + |
| 86 | + ```bash |
| 87 | + oc logs -f deployment/chatui -n vllm-semantic-router-system |
| 88 | + ``` |
| 89 | + |
| 90 | +3. Verify MongoDB connection: |
| 91 | + |
| 92 | + ```bash |
| 93 | + oc get pods -l app=mongo -n vllm-semantic-router-system |
| 94 | + ``` |
| 95 | + |
| 96 | +### Dashboard Shows "HuggingChat not configured" Error |
| 97 | + |
| 98 | +This means the `TARGET_CHATUI_URL` environment variable is not set in the dashboard deployment. Verify the dashboard ConfigMap: |
| 99 | + |
| 100 | +```bash |
| 101 | +oc get configmap dashboard-config -n vllm-semantic-router-system -o yaml | grep CHATUI |
| 102 | +``` |
| 103 | + |
| 104 | +If missing, redeploy the dashboard with the updated configuration. |
| 105 | + |
| 106 | +## Security |
| 107 | + |
| 108 | +- **OpenShift Security Contexts**: Runs with restricted security contexts (no privilege escalation, dropped capabilities) |
| 109 | +- **HTTPS Access**: Secure external access via OpenShift routes with TLS edge termination |
| 110 | +- **Network Policies**: Internal cluster communication only (no direct external access to backend services) |
| 111 | + |
| 112 | +## Resource Requirements |
| 113 | + |
| 114 | +- **CPU**: 100m request, 500m limit |
| 115 | +- **Memory**: 256Mi request, 1Gi limit |
| 116 | +- **Depends on**: MongoDB (additional resources) |
| 117 | + |
| 118 | +## Notes |
| 119 | + |
| 120 | +- ChatUI uses the same semantic-router backend as OpenWebUI |
| 121 | +- Both chat interfaces (ChatUI and OpenWebUI) are available through the dashboard |
| 122 | +- ChatUI requires MongoDB while OpenWebUI has its own data storage |
| 123 | +- The dashboard automatically configures the proxy routing based on the TARGET_CHATUI_URL environment variable |
0 commit comments