This project consists of a multi-agent system built with CAMEL AI, featuring a FastAPI backend and React frontend, integrated with the MedGemma AI model.
backend/- FastAPI backend with multi-agent systemfrontend/- React + TypeScript + Vite frontendmodel/- vLLM / llamacpp service configuration for MedGemma model
- Docker and Docker Compose OR Locally with:
- Python 3.11 or 3.12
- Node.js 20+
- UV package manager
- Hugging Face account and API token
- (Optional) Cloudflare Tunnel token for external access
cd frontend
npm install
npm run devcd backend
uv sync
uv run uvicorn app:api --host 0.0.0.0 --port 3001 --reloadTo run the full-stack application:
From the root directory
docker-compose up -dThis builds and starts:
- Frontend (built into static files)
- Backend (FastAPI serving on port 8000)
- Combined into a single container
Access the Application: http://localhost:8000
NOTE: By default, the agents use Gemini and Medigent team's hosted MedGemma API. To switch to local hardware (fully private/offline), view the Setting Up Local Model section.
Use this option if you want to run the MedGemma model entirely on your own hardware rather than relying on external hosted servers for full data privacy and offline performance.
-
Configure your HuggingFace token in
model/.env:HF_TOKEN=your_token_here -
Run the weights download script:
cd backend uv run python app/model/download_models.pyThis script fetches the base MedGemma GGUF and the required vision projector file.
-
Once downloaded, you need to run the docker compose which will read the ./models directory
cd model docker-compose up -d -
You need to configure the Medgemma model config in https://medigent.awelkaircodes.org or your locally hosted frontend. The model server will be available at
http://localhost:8080/v1. You need to host the backend locally if you don't have a public domain, otherwise configure Cloudflare tunnel to forward requests to your endpoint to use it with our public website.
To protect sensitive agent credentials (like API keys), Medigent uses Fernet symmetric encryption. API keys are encrypted on the frontend before being sent to the backend, where they are decrypted for use.
-
Generate an encryption key:
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())" -
Configure the backend: Add to
backend/.env:ENCRYPTION_KEY=your_generated_key_here -
Configure the frontend: Add to
frontend/.env.local:VITE_ENCRYPTION_KEY=your_generated_key_here
Make sure both keys match exactly.
