Monorepo for RadioShaq: ham radio AI orchestration and remote SDR reception. One main app (single PyPI package); Python is managed with uv.
What this repo does
- RadioShaq — AI-powered orchestrator for ham radio, emergency comms, and field–HQ coordination. FastAPI backend, React (Vite) web UI, Postgres + Alembic, optional real radios and SDR. The remote receiver (SDR listen-only station) is bundled; run with
radioshaq run-receiver.
- Python 3.11+ and uv
- PostgreSQL — Easiest is Docker on port 5434 (avoids conflict with local 5432). Or use an existing server and set
RADIOSHAQ_DATABASE__POSTGRES_URL. - Optional: Node.js + PM2 for running the API under PM2; Docker for Postgres.
All steps below assume you are in radioshaq/ unless noted.
Guided prompts for mode, database (Docker or URL), JWT, LLM, and optional radio/memory. Writes .env and config.yaml, can start Docker and run migrations.
cd radioshaq
uv sync --all-extras
radioshaq setup
# Minimal: radioshaq setup --quick
# CI: radioshaq setup --no-input --mode fieldThen start the API (see Option D or manual steps below).
One script: install deps, create config, start Docker Postgres (port 5434), run migrations, install PM2 if Node is present.
# Windows (from radioshaq/)
.\infrastructure\local\setup.ps1# Linux/macOS (from radioshaq/)
./infrastructure/local/setup.shThen start the API with radioshaq launch pm2 or radioshaq run-api.
cd radioshaq
uv sync --all-extras
# Start Postgres (port 5434)
cd infrastructure/local && docker compose up -d postgres && cd ../..
# Migrations (from radioshaq/)
uv run alembic -c infrastructure/local/alembic.ini upgrade head
# Start API
uv run python -m radioshaq.api.serverFrom repo root, Postgres and migrations can be run as:
cd radioshaq/infrastructure/local && docker compose up -d postgres && cd ../../..
python radioshaq/infrastructure/local/run_alembic.py upgrade headStart dependencies and API in one go:
# Postgres only (port 5434)
radioshaq launch docker
# With Hindsight (semantic memory): radioshaq launch docker --hindsight
# Postgres + API under PM2
radioshaq launch pm2
# With Hindsight: radioshaq launch pm2 --hindsightThen run migrations if needed: uv run alembic -c infrastructure/local/alembic.ini upgrade head from radioshaq/.
Endpoints: API docs http://localhost:8000/docs, web UI http://localhost:8000/, health http://localhost:8000/health.
Most endpoints require a Bearer JWT. Request a token (no prior auth in dev), then send it on protected routes.
PowerShell:
$r = Invoke-RestMethod -Method Post -Uri "http://localhost:8000/auth/token?subject=op1&role=field&station_id=STATION-01"
$env:TOKEN = $r.access_token
Invoke-RestMethod -Uri "http://localhost:8000/auth/me" -Headers @{ Authorization = "Bearer $env:TOKEN" }Bash:
TOKEN=$(curl -s -X POST "http://localhost:8000/auth/token?subject=op1&role=field&station_id=STATION-01" | jq -r .access_token)
curl -H "Authorization: Bearer $TOKEN" http://localhost:8000/auth/meRoles: field, hq, receiver. Set RADIOSHAQ_TOKEN to use the CLI below.
| Command | Description |
|---|---|
radioshaq token --subject op1 --role field --station-id STATION-01 |
Get JWT (then set RADIOSHAQ_TOKEN) |
radioshaq health |
Liveness; radioshaq health --ready for readiness |
radioshaq message process "your request" |
Send message through REACT orchestrator |
radioshaq message inject "text" |
Inject into RX path (demo). Options: --band, --source-callsign |
radioshaq message relay "msg" --source-band 40m --target-band 2m |
Relay between bands |
radioshaq transcripts list |
List transcripts. Options: --callsign, --band, --destination-only |
radioshaq callsigns list |
List registered callsigns |
radioshaq callsigns add <callsign> |
Register a callsign |
API base URL: RADIOSHAQ_API (default http://localhost:8000). Use radioshaq --help and radioshaq <command> --help for options.
With the API running, in a second terminal from radioshaq/:
uv run python scripts/demo/run_demo.pyGets a token, injects on 40m, relays to 2m, and polls /transcripts. See radioshaq/scripts/demo/README.md.
- Process a message:
POST /messages/processwith JSON{"message": "your request"}and headerAuthorization: Bearer <token>. - Transcripts:
GET /transcripts?callsign=<callsign>&destination_only=true&band=<band>for messages for you on a band. - See http://localhost:8000/docs for the full OpenAPI spec.
From radioshaq/ (SDR listen-only station streaming to HQ):
uv sync --extra dev --extra test
# With hardware: uv sync --extra sdr # or --extra hackrf
# Set env then run
# JWT_SECRET=... STATION_ID=RECEIVER-01 HQ_URL=http://your-hq:8000
uv run radioshaq run-receiverDefault port 8765. HQ accepts uploads at POST /receiver/upload. See docs/ and radioshaq/README.md.
All from radioshaq/:
uv run pytest tests/unit tests/integration -v
uv run mypy radioshaq
uv run ruff check . && uv run ruff format .
uv run alembic -c infrastructure/local/alembic.ini upgrade headFrontend: cd web-interface && npm install && npm run dev.
| Doc | Description |
|---|---|
| docs/quick-start.md | Step-by-step first run |
| docs/configuration.md | Config file, env vars, interactive setup |
| docs/radio-usage.md | Rig models, CAT, hardware |
| docs/api-reference.md | API overview |
| radioshaq/README.md | App install, auth, demo, monitoring |
radioshaq/ # Main application (single PyPI package)
├── radioshaq/ # Python package (API, radio, audio, orchestrator)
│ └── remote_receiver/ # Bundled SDR receiver (radioshaq run-receiver)
├── web-interface/ # React frontend (Vite + TypeScript)
├── tests/ # pytest (unit + integration)
├── infrastructure/ # Docker, PM2, AWS Lambda, Alembic
└── scripts/ # Demo and utilities
docs/ # Quick-start, configuration, snippets
.github/ # Workflows, PYPI_README.md
GPL-2.0-only