This guide explains how to run RadSysX locally while using a remote GPU VM for the BiomedParse backend, mirroring production for the model service.
- Backend (GPU): runs on a cloud VM exactly as in production (see
DEPLOY_GPU.md). - Frontend (local): runs Next.js dev server on your workstation and calls the remote backend via
NEXT_PUBLIC_BP_API_BASE.
- A running GPU VM with the backend deployed as described in
DEPLOY_GPU.md(port 8000 open to your IP or VPN/subnet). - Your workstation with Node.js 18+ (or current LTS) and a package manager (npm or pnpm).
- Optional but recommended: Git, curl.
Follow DEPLOY_GPU.md to:
- Build the Docker image with CUDA.
- Run the container with
--gpus all, mount your checkpoint, and expose:8000. - Verify:
curl http://<VM_IP>:8000/api/biomedparse/v1/healthExpect { "status": "healthy", "gpu_available": true }.
Create a .env.local file under frontend/ with the remote API base of your VM:
# Frontend (Next.js) reads this at build/runtime in dev
NEXT_PUBLIC_BP_API_BASE=http://<VM_IP>:8000/api/biomedparse/v1Notes:
- If
NEXT_PUBLIC_BP_API_BASEis not set, the frontend will attempt to call a local backend at/api/biomedparse/v1. For local development with a remote GPU backend, you must set this variable. - Ensure firewall/security groups allow access from your workstation to the VM’s
:8000. - If you containerize the frontend with Docker, rename
.env.localto.env(or copy its contents) so it can be loaded by the container (e.g., with--env-file frontend/.env). - On your local OS firewall, allow outbound to the VM and inbound to
localhost:3000if restricted; on the cloud side, open TCP port8000to your IP only.
From the repository root:
cd frontend
npm install
npm run devThen open your browser at http://localhost:3000.
- In the Right Panel, upload an image (2D) or a NIfTI volume (3D
.nii/.nii.gz). - Enter one or more prompts (e.g.,
liver, tumor). - Toggle “Return heatmap” (optional) and adjust threshold/
slice_batch_sizeif needed. - Click “Analyze with BiomedParse”.
- For 3D results, you will see
mask_url/heatmap_url. Use the provided buttons to apply Labelmap or Heatmap overlays. Opacity can be adjusted for heatmaps.
- Cannot reach backend: check that
NEXT_PUBLIC_BP_API_BASEpoints tohttp://<VM_IP>:8000/api/biomedparse/v1and that the VM firewall allows your client IP. - CORS errors: backend dev config allows all origins by default (see
backend/server.py). If you changed it, permithttp://localhost:3000. - OOM on backend: lower
BP_SLICE_BATCH_SIZE(env) or pass?slice_batch_size=in 3D requests from UI. - Missing checkpoint: ensure the VM container has
BP3D_CKPTpointing to a valid path (mounted with-v). - Heatmap validation failures: keep
BP_VALIDATE_HEATMAP=1and ensure NPZ containsprobasuint8.
If you prefer, you can also run the backend locally (CPU-only will be slow) or create a small local proxy that forwards /api/biomedparse/v1/* to the VM. This is not required; the recommended flow is to point the frontend directly to the VM via NEXT_PUBLIC_BP_API_BASE.