A centralized training server for the Bjorn swarm. Each Bjorn device explores its environment and sends anonymized feedback to the Cortex. The Cortex aggregates field experience across the fleet, trains a model, and redistributes it to all connected devices.
The current version targets local experimentation and iterative testing. Production deployment on a VPS is a future milestone.
- Bjorn devices send anonymized
.csv.gztraining files to the Cortex upload endpoint. - The Cortex trains a TensorFlow/Keras model on the aggregated data.
- The latest model is served back to connected devices on request.
- Live training status is streamed via WebSocket.
- FastAPI backend and dashboard UI.
- Upload endpoint for
.csv.gztraining data. - Training pipeline with TensorFlow/Keras.
- Live status via WebSocket.
- JWT authentication with MFA (TOTP).
- Python 3.10+
- TensorFlow-compatible environment (GPU optional)
pip install -r Cortex/requirements.txtcd Cortex
python server.pyAccess the dashboard on http://localhost:8000.
docker compose up -d --buildLocal configs (security_config.json, server_config.json) can contain secrets and are git-ignored. Commit only the sanitized .example variants. Rotate any secret previously exposed before pushing.
Do not expose this service publicly without HTTPS and a reverse proxy.
| Method | Path | Description |
|---|---|---|
| GET | /setup |
Initial setup page |
| GET | /setup/qr |
TOTP provisioning QR |
| POST | /token |
Issue JWT (OAuth2 password flow) |
| GET | / |
Dashboard |
| POST | /upload |
Upload training data |
| POST | /train/start |
Trigger training |
| GET | /model/latest |
Latest model metadata |
| GET | /model/download/{filename} |
Download model artifact |
| WS | /ws/logs |
Real-time training events |
MIT.
