Prbhvv/mllm-recommender-api
0
1# Deployment Guide ๐2 3This guide explains how to deploy your **Next-Gen Recommender** for free using **Hugging Face Spaces** (Backend) and **Vercel** (Frontend).4 5## Part 1: Backend (Hugging Face Spaces)6 7We use Hugging Face Spaces because it provides free CPU resources (16GB RAM) suitable for running your PyTorch model.8 91. **Create a Space**:10 * Go to [huggingface.co/spaces](https://huggingface.co/spaces) and create a new Space.11 * **Name**: `mllm-recommender-api` (or similar).12 * **SDK**: Select **Docker**.13 * **Hardware**: Free CPU (Basic).14 152. **Upload Files**:16 * Clone your Space locally:17 ```bash18 git clone https://huggingface.co/spaces/YOUR_USERNAME/mllm-recommender-api19 ```20 * Copy **ALL** files from your project folder (`MLLM-MSR`) into this cloned directory.21 * **Important**: Ensure `Dockerfile`, `requirements.txt`, `api/`, `gnn_fusion/`, `models/`, `data/`, and `embeddings/` are included.22 * *Note: Large files (>10MB) require `git lfs`.*23 ```bash24 git lfs install25 git lfs track "*.pt" "*.npz" "*.csv"26 ```27 * Push the files:28 ```bash29 git add .30 git commit -m "Initial deploy"31 git push32 ```33 343. **Get Backend URL**:35 * Once built, your API will be available at: `https://YOUR_USERNAME-mllm-recommender-api.hf.space`.36 * Test it: `https://YOUR_USERNAME-mllm-recommender-api.hf.space/health`37 38---39 40## Part 2: Frontend (Vercel)41 421. **Push Code to GitHub**:43 * Create a new repository on GitHub.44 * Push your `web` folder code to it.45 462. **Deploy on Vercel**:47 * Go to [vercel.com](https://vercel.com) and "Add New Project".48 * Import your GitHub repository.49 * **Root Directory**: Select `web` (since your frontend is in the `web` subfolder).50 * **Environment Variables**:51 * Add `VITE_API_URL` = `https://YOUR_USERNAME-mllm-recommender-api.hf.space` (The URL from Part 1).52 * Click **Deploy**.53 54## ๐ Done!55 56Your app is now live!57- **Frontend**: `https://your-project.vercel.app`58- **Backend**: `https://YOUR_USERNAME-mllm-recommender-api.hf.space`59 