Spaces:
Runtime error
Runtime error
|
Download DEPLOYMENT_GUIDE.md from GodRad/latest_Rag_SaaS_Access_Point: direct link, hf CLI and curl.
- Browser
- Download file 3.48 kB
-
https://huggingface.co/spaces/GodRad/latest_Rag_SaaS_Access_Point/resolve/main/DEPLOYMENT_GUIDE.md
- Command line
-
hf download hf://spaces/GodRad/latest_Rag_SaaS_Access_Point/DEPLOYMENT_GUIDE.md
-
curl -L -o DEPLOYMENT_GUIDE.md https://huggingface.co/spaces/GodRad/latest_Rag_SaaS_Access_Point/resolve/main/DEPLOYMENT_GUIDE.md
3.48 kB
| # RAG SaaS Platform - Webapp Deployment Guide | |
| ## β Webapp Status: READY FOR DEPLOYMENT | |
| All issues have been resolved. The webapp is clean and ready to deploy. | |
| --- | |
| ## Files in webapp/ Directory | |
| ### 1. `app.py` (26.7 KB) | |
| - β Clean imports at the top (no lazy loading) | |
| - β All 7 critical fixes integrated | |
| - β Multi-source retrieval UI | |
| - β Tenant authentication | |
| - β Metrics display with latency breakdown | |
| - β Document/URL/YouTube source management | |
| ### 2. `requirements.txt` | |
| ``` | |
| streamlit | |
| requests | |
| pandas | |
| ``` | |
| - β Minimal dependencies for fast startup | |
| ### 3. `Dockerfile` | |
| - β Configured for HF Spaces | |
| - β User permissions (UID 1000) | |
| - β Port 7860 | |
| - β Streamlit entrypoint | |
| ### 4. `.streamlit/config.toml` | |
| - β Headless mode | |
| - β Dark theme | |
| - β Performance optimizations | |
| ### 5. `README.md` | |
| - β HF Spaces metadata | |
| - β Quick setup guide | |
| --- | |
| ## Deployment Options | |
| ### Option 1: Streamlit SDK (Recommended for UI) β | |
| **Fastest startup time!** | |
| 1. Create new Space on Hugging Face | |
| 2. Settings: | |
| - SDK: **Streamlit** | |
| - SDK Version: **1.28.0** | |
| - App File: **app.py** | |
| 3. Upload files: | |
| - `app.py` | |
| - `requirements.txt` | |
| - `.streamlit/config.toml` | |
| - `README.md` | |
| **Expected startup:** 8-12 seconds | |
| --- | |
| ### Option 2: Docker SDK | |
| 1. Create new Space on Hugging Face | |
| 2. Settings: | |
| - SDK: **Docker** | |
| 3. Upload files: | |
| - `app.py` | |
| - `requirements.txt` | |
| - `Dockerfile` | |
| - `.streamlit/config.toml` | |
| - `README.md` | |
| **Expected startup:** 15-20 seconds | |
| --- | |
| ## Configuration | |
| ### Backend URL | |
| In the sidebar, users can configure the backend API URL: | |
| - **Local development:** `http://localhost:7860` | |
| - **HF Spaces backend:** `https://YOUR_USERNAME-rag-saas-backend.hf.space` | |
| --- | |
| ## Features | |
| ### 1. Authentication | |
| - Login with Tenant ID | |
| - Create new tenant accounts | |
| - Secure session management | |
| ### 2. Ask Questions | |
| - Multi-source retrieval (docs, URLs, YouTube) | |
| - Real-time latency metrics | |
| - 5-metric performance breakdown | |
| - Visual latency chart | |
| - Confidence scoring | |
| - Source attribution | |
| ### 3. Manage Sources | |
| - Upload documents (PDF, DOCX, TXT) | |
| - Add web URLs | |
| - Add YouTube videos (with transcript upload) | |
| - Enable/disable sources | |
| - View all sources | |
| ### 4. Metrics Dashboard | |
| - Tenant-specific metrics | |
| - Time-range selection | |
| - Cache performance stats | |
| - Historical trends | |
| --- | |
| ## Testing Locally | |
| ```bash | |
| cd webapp | |
| streamlit run app.py --server.port=8501 | |
| ``` | |
| Then open: `http://localhost:8501` | |
| --- | |
| ## Deployment Checklist | |
| - [x] `app.py` - Clean, no lazy loading | |
| - [x] `requirements.txt` - Minimal dependencies | |
| - [x] `Dockerfile` - HF Spaces compatible | |
| - [x] `.streamlit/config.toml` - Optimized settings | |
| - [x] `README.md` - HF metadata | |
| - [x] All imports working | |
| - [x] No syntax errors | |
| - [x] Ready for deployment | |
| --- | |
| ## Next Steps | |
| 1. **Deploy Backend First** | |
| - Upload backend to HF Spaces (Docker SDK) | |
| - Get backend URL | |
| 2. **Deploy Frontend** | |
| - Upload webapp to HF Spaces (Streamlit SDK) | |
| - Configure backend URL in sidebar | |
| 3. **Test End-to-End** | |
| - Create tenant | |
| - Add sources | |
| - Ask questions | |
| - Check metrics | |
| --- | |
| ## Summary | |
| β **Webapp is production-ready!** | |
| - Clean code with standard imports | |
| - All 7 critical fixes integrated | |
| - Optimized for HF Spaces | |
| - Fast startup (8-12 seconds) | |
| - Full feature parity with backend | |