This guide shows how to launch both the backend API and the frontend portal simultaneously so you can run the full TBVision experience locally.
-
Python & venv – Python 3.11+ is required. Create/activate the
venvin the repo root:Create virtual env:
python -m venv venv
Activate virtual env: For Unix/Linux/Mac:
source venv/bin/activateFor Windows:
.\venv\Scripts\activate
-
Dependencies – Install backend and model requirements:
pip install -r requirements.txt
-
Node.js – The frontend (under
frontend/) expects Node 18+. Install deps when required. -
Model weights – Ensure
weights/xraytb_net.pthexists or pointCHECKPOINT_PATHin.envto your checkpoint. -
Vector DB – Start Qdrant (default
http://localhost:6333). Create the collection manually if you customized it.- docker-compose up --build
-
Load Knowledge base
python -m scripts.load_knowledge
-
Environment variables – Copy
.env.exampleto.envwith overrides such as:CHECKPOINT_PATH=weights/xraytb_net.pth ALLOWED_ORIGINS=http://localhost:3000 GEMINI_API_KEY=... MISTRAL_API_KEY=...
-
Start both backend and frontend together via the helper script (it launches the backend, then the frontend dev server with hot reload):
./run.sh
-
The backend listens on
http://127.0.0.1:8000by default and exposes/api/predict+/api/rag. The frontend default port is3000.