--- title: Backend emoji: 🤖 colorFrom: gray colorTo: blue sdk: docker app_port: 7860 --- # COMSATS Chatbot — FastAPI backend Docker Space running **FastAPI** + **Uvicorn** on port **7860**. Open `/docs` for Swagger. ## Secrets (required for embedding downloads) In the Space **Settings → Variables and secrets**, add a **secret** named **`HF_TOKEN`** with a Hub token from [your tokens page](https://huggingface.co/settings/tokens) (read access is enough). The app maps this to `HUGGING_FACE_HUB_TOKEN` at startup via `space_credentials.py` — no `.env` file in the repo. **First boot** may take several minutes: dependencies install, the BGE embedding model downloads, and the FAISS index is built from the bundled CSV files (nothing under `faiss_kb/*.faiss` is committed).