--- title: MANIT Chat RAG emoji: 🎓 colorFrom: blue colorTo: indigo sdk: docker app_port: 7860 pinned: false --- # MANIT Chat RAG An AI-powered academic assistant for Maulana Azad National Institute of Technology (MANIT), Bhopal, built with a Retrieval-Augmented Generation (RAG) pipeline. It uses FastAPI for the API backend and serves a minimalist, modern, static HTML/JS/CSS web interface. This project is configured for single-container Docker deployment, making it ready to be hosted directly on **Hugging Face Spaces** as a Docker Space. ## 🚀 How to Run Locally with Docker 1. Ensure your Groq API key is set in `server/.env`: ```env groq_api_key=your_groq_api_key_here ``` 2. Build the unified Docker image: ```bash docker build -t manit-chat . ``` 3. Run the container, mounting the data volume and passing the environment file: ```bash docker run -p 7860:7860 --env-file server/.env -v "$(pwd)/server/data:/app/server/data" manit-chat ``` 4. Open your web browser and navigate to `http://localhost:7860`. --- ## ☁️ How to Deploy to Hugging Face Spaces 1. Create a new Space on [Hugging Face](https://huggingface.co/new-space). 2. Give it a name and select **Docker** as the SDK. 3. Choose **Blank** (default template) as the starting point. 4. Clone your Space repository locally, or add it as a Git remote in this project folder: ```bash git init git add . git commit -m "Configure for Hugging Face Spaces" git remote add origin https://huggingface.co/spaces/YOUR_USERNAME/YOUR_SPACE_NAME git push -u origin main --force ``` 5. Once pushed, go to the **Settings** tab of your Hugging Face Space page: * Scroll down to **Variables and secrets**. * Click **New secret**. * Set the **Name** to `groq_api_key`. * Set the **Value** to your Groq API key (`gsk_...`). 6. Hugging Face will automatically detect the root `Dockerfile` and build it. Once complete, your Space will be active and running online!