wagner-austin/API

Typed Python monorepo — 13 FastAPI services: ML training (GPT-2, LoRA/QLoRA, SD/SDXL/FLUX), NLP (Turkic IPA, Whisper STT), quant-ML risk (Kafka + XGBoost/LightGBM/ClearGBM Rust GBDT via PyO3), PDF extraction (pdfplumber, docTR OCR). Strict mypy, 100% coverage, custom static-analysis framework enforcing 20+ architecture rules.

0

stars

4,476

commits

Python

primary language

Sep 10, 2026

updated

austinwagner.org
fastapi
gradient-boosting
machine-learning
monorepo
mypy
pyo3
python
rust

README

API Platform

Typed Python monorepo for ML training, NLP, media services, and quant-ML risk modeling. Strict mypy (no Any, no cast, no type: ignore), 100% statement + branch test coverage, FastAPI + RQ + Redis + Kafka architecture.

Start here

Doing research, auditing an experiment, or reproducing a number? Read docs/RESEARCH.md first. It is the index of every body of work on this machine that produces numbers someone compares — including the two that live outside this repository — and says for each one what provenance it carries and what it does not.

The three parts of this repo worth reading first:

  1. libs/cleargbm/ + libs/cleargbm_rs/ — From-scratch interpretable gradient boosting: numpy Python orchestration with a Rust core (histogram building, tree construction, prediction pipeline) exposed via PyO3 bindings.
  2. services/covenant-radar-api/ + libs/covenant_ml/ + libs/covenant_nn/ — Multi-model risk prediction: pluggable ML backends (XGBoost, LightGBM, ClearGBM, LogReg, RF) and PyTorch NN backends (MLP, LSTM), Optuna optimization, Kafka streaming.
  3. libs/monorepo_guards/ — Custom static-analysis framework: architecture-enforcement rules (Python + Rust) that lint invariants CI-time.

The smaller services (grandma-api, github-stats-api, procart-api) are side projects.

Services

ServicePortDescription
data-bank-api8001Content-addressed file storage with atomic writes
Model-Trainer8005Language model training with LoRA/QLoRA/Unsloth fine-tuning, GPT-2, Char-LSTM, CUDA support
Art-Trainer8011Image generation model training (LoRAs for SD 1.5, SDXL, FLUX) with Kohya-ss backend
handwriting-ai8004MNIST digit recognition with calibrated confidence
turkic-api8000Turkic language detection and IPA transliteration (Kazakh, Kyrgyz, Uzbek, Turkish, Russian, +4 more)
transcript-api8003YouTube video transcription
qr-api8002QR code generation
music-wrapped-api8006Music listening analytics (Spotify, Apple, YouTube Music, Last.fm)
covenant-radar-api8007Multi-domain risk prediction with pluggable domains (Covenant, Weather/McKinnon, Esports), Kafka streaming (XGBoost, LightGBM, ClearGBM, LogReg, RF, MLP, LSTM)
grandma-api8008Multi-language audio-to-English translation (Whisper STT + language detection, GPT-4o-mini translation)
github-stats-api8009GitHub stats SVG card generation
opportunity-radar-api8010Hackathon and competition discovery
procart-api-Procedural art rendering orchestration

Clients

ClientDescription
DiscordBotDiscord bot integrating all platform services
TankpitBotTankpit.com WebSocket protocol reverse-engineering and game bot
RustedWarfareBotHeadless Rusted Warfare client — JVM agent + Python planner, no screen scraping
NavProbeReproducibility instrument for simulated navigation — seeded rollouts, canonical digests, determinism verdicts across MJX and MuJoCo-Warp

Shared Libraries

LibraryDescription
platform_coreConfig, logging, HTTP clients, FastAPI utilities, OAuth 2.0 with PKCE, job event schemas
platform_workersRQ job infrastructure, Redis utilities
platform_mlML artifact storage, manifests, device/precision auto-detection
platform_discordDiscord embed builders, event subscribers
platform_musicMusic analytics, streaming service adapters
platform_emailEmail integration (Outlook Graph API, Gmail) with OAuth 2.0
platform_calendarGoogle Calendar API for competition deadline tracking with auto-reminders
platform_codebaseCodebase capability detection and profiling
platform_devpostDevpost hackathon discovery + capability matching
platform_kaggleKaggle competition discovery + capability matching
platform_sttSpeech-to-text with OpenAI Whisper API, chunking, language detection
platform_langidSpoken language identification from audio using Meta MMS-LID
platform_translateText translation with pluggable backends (Anthropic, OpenAI)
instrument_ioScientific instrument data format readers and writers (mass spec, mzML, Excel, PDF)
monorepo_guardsCode quality rules (34 static analysis checks, Python + Rust)
covenant_domainLoan covenant domain models and rule engine
covenant_mlClassification and regression backends (XGBoost, LightGBM, ClearGBM, LogReg, RF) with Optuna, temporal/NetCDF features
covenant_nnPyTorch neural network backends (MLP, LSTM) for classification and regression
covenant_persistencePostgreSQL repositories for covenant data
cleargbmFrom-scratch interpretable gradient boosting (numpy only, Rust-accelerated via hooks)
cleargbm_rsRust core for ClearGBM: histogram building, tree construction, prediction pipeline, PyO3 bindings
procartProcedural art core (neon visuals, HDR pipeline)

Quick Start

# Start shared infrastructure (Redis + PostgreSQL + Kafka + Traefik)
make infra

# Start a specific service
make up-databank      # data-bank-api
make up-trainer       # Model-Trainer (GPU)
make up-art-trainer   # Art-Trainer (GPU)
make up-handwriting   # handwriting-ai
make up-qr            # qr-api
make up-transcript    # transcript-api
make up-turkic        # turkic-api
make up-music         # music-wrapped-api
make up-covenant      # covenant-radar-api
make up-grandma       # grandma-api
make up-github-stats  # github-stats-api
make up-opportunity   # opportunity-radar-api
make up-discord       # DiscordBot

# Start all services
make up-all

# Stop everything
make down

# Stop all services and prune Docker volumes
make clean

# Run checks across all libs/services
make check
make lint
make test

# View running containers
make status

# Stream logs
make logs

Architecture

                              +--------------+
                              | Traefik (80) |
                              +------+-------+
                                     |
                         +-----------+-----------+
                         |                       |
                   +-----v-----+           +-----v-----+
                   | Discord   |           |  Services |
                   |   Bot     |           | (FastAPI) |
                   +-----+-----+           +-----+-----+
                         |                       |
           +-------------+-------------+---------+
           |             |             |
     +-----v-----+ +-----v-----+ +-----v-----+
     |   Redis   | | PostgreSQL| | data-bank |
     | (pub/sub) | | (covenant)| | (storage) |
     +-----+-----+ +-----------+ +-----------+
           |
     +-----v-----+
     | RQ Workers|
     +-----------+

All services share:

  • platform-network (Docker bridge)
  • platform-redis (job queue + pub/sub for async services)
  • platform-postgres (covenant-radar persistence)
  • Structured JSON logging
  • Health endpoints (/healthz, /readyz)

Infrastructure

ComponentPortPurpose
Redis 76379Job queue, pub/sub, status tracking
PostgreSQL 165432Covenant-radar persistence
Kafka 3.89092Covenant-radar streaming: measurements in, predictions and alerts out
Traefik 380, 8080API gateway + dashboard

Development

# Install dependencies for a service
cd services/Model-Trainer
poetry install --with dev

# Run checks
make check

# Run just lint or test
make lint
make test

See docs/ for detailed documentation.

Code Standards

  • Type Safety: mypy strict mode, zero Any types, zero cast, zero type: ignore
  • Test Coverage: 100% statement + branch coverage enforced
  • Linting: Ruff formatting and linting
  • Architecture: Protocol-based dependency injection, _test_hooks.py pattern

Requirements

  • Python 3.11+
  • Docker + Docker Compose
  • Poetry
  • Make (via PowerShell on Windows)
  • NVIDIA GPU + CUDA 12.4 (for Model-Trainer, Art-Trainer)

License

MIT

Contributors

wagner-austin

4,476 commits

wagner-austin/API

Typed Python monorepo — 13 FastAPI services: ML training (GPT-2, LoRA/QLoRA, SD/SDXL/FLUX), NLP (Turkic IPA, Whisper STT), quant-ML risk (Kafka + XGBoost/LightGBM/ClearGBM Rust GBDT via PyO3), PDF extraction (pdfplumber, docTR OCR). Strict mypy, 100% coverage, custom static-analysis framework enforcing 20+ architecture rules.

0

stars

4,476

commits

Python

primary language

Sep 10, 2026

updated

austinwagner.org
fastapi
gradient-boosting
machine-learning
monorepo
mypy
pyo3
python
rust

README

API Platform

Typed Python monorepo for ML training, NLP, media services, and quant-ML risk modeling. Strict mypy (no Any, no cast, no type: ignore), 100% statement + branch test coverage, FastAPI + RQ + Redis + Kafka architecture.

Start here

Doing research, auditing an experiment, or reproducing a number? Read docs/RESEARCH.md first. It is the index of every body of work on this machine that produces numbers someone compares — including the two that live outside this repository — and says for each one what provenance it carries and what it does not.

The three parts of this repo worth reading first:

  1. libs/cleargbm/ + libs/cleargbm_rs/ — From-scratch interpretable gradient boosting: numpy Python orchestration with a Rust core (histogram building, tree construction, prediction pipeline) exposed via PyO3 bindings.
  2. services/covenant-radar-api/ + libs/covenant_ml/ + libs/covenant_nn/ — Multi-model risk prediction: pluggable ML backends (XGBoost, LightGBM, ClearGBM, LogReg, RF) and PyTorch NN backends (MLP, LSTM), Optuna optimization, Kafka streaming.
  3. libs/monorepo_guards/ — Custom static-analysis framework: architecture-enforcement rules (Python + Rust) that lint invariants CI-time.

The smaller services (grandma-api, github-stats-api, procart-api) are side projects.

Services

ServicePortDescription
data-bank-api8001Content-addressed file storage with atomic writes
Model-Trainer8005Language model training with LoRA/QLoRA/Unsloth fine-tuning, GPT-2, Char-LSTM, CUDA support
Art-Trainer8011Image generation model training (LoRAs for SD 1.5, SDXL, FLUX) with Kohya-ss backend
handwriting-ai8004MNIST digit recognition with calibrated confidence
turkic-api8000Turkic language detection and IPA transliteration (Kazakh, Kyrgyz, Uzbek, Turkish, Russian, +4 more)
transcript-api8003YouTube video transcription
qr-api8002QR code generation
music-wrapped-api8006Music listening analytics (Spotify, Apple, YouTube Music, Last.fm)
covenant-radar-api8007Multi-domain risk prediction with pluggable domains (Covenant, Weather/McKinnon, Esports), Kafka streaming (XGBoost, LightGBM, ClearGBM, LogReg, RF, MLP, LSTM)
grandma-api8008Multi-language audio-to-English translation (Whisper STT + language detection, GPT-4o-mini translation)
github-stats-api8009GitHub stats SVG card generation
opportunity-radar-api8010Hackathon and competition discovery
procart-api-Procedural art rendering orchestration

Clients

ClientDescription
DiscordBotDiscord bot integrating all platform services
TankpitBotTankpit.com WebSocket protocol reverse-engineering and game bot
RustedWarfareBotHeadless Rusted Warfare client — JVM agent + Python planner, no screen scraping
NavProbeReproducibility instrument for simulated navigation — seeded rollouts, canonical digests, determinism verdicts across MJX and MuJoCo-Warp

Shared Libraries

LibraryDescription
platform_coreConfig, logging, HTTP clients, FastAPI utilities, OAuth 2.0 with PKCE, job event schemas
platform_workersRQ job infrastructure, Redis utilities
platform_mlML artifact storage, manifests, device/precision auto-detection
platform_discordDiscord embed builders, event subscribers
platform_musicMusic analytics, streaming service adapters
platform_emailEmail integration (Outlook Graph API, Gmail) with OAuth 2.0
platform_calendarGoogle Calendar API for competition deadline tracking with auto-reminders
platform_codebaseCodebase capability detection and profiling
platform_devpostDevpost hackathon discovery + capability matching
platform_kaggleKaggle competition discovery + capability matching
platform_sttSpeech-to-text with OpenAI Whisper API, chunking, language detection
platform_langidSpoken language identification from audio using Meta MMS-LID
platform_translateText translation with pluggable backends (Anthropic, OpenAI)
instrument_ioScientific instrument data format readers and writers (mass spec, mzML, Excel, PDF)
monorepo_guardsCode quality rules (34 static analysis checks, Python + Rust)
covenant_domainLoan covenant domain models and rule engine
covenant_mlClassification and regression backends (XGBoost, LightGBM, ClearGBM, LogReg, RF) with Optuna, temporal/NetCDF features
covenant_nnPyTorch neural network backends (MLP, LSTM) for classification and regression
covenant_persistencePostgreSQL repositories for covenant data
cleargbmFrom-scratch interpretable gradient boosting (numpy only, Rust-accelerated via hooks)
cleargbm_rsRust core for ClearGBM: histogram building, tree construction, prediction pipeline, PyO3 bindings
procartProcedural art core (neon visuals, HDR pipeline)

Quick Start

# Start shared infrastructure (Redis + PostgreSQL + Kafka + Traefik)
make infra

# Start a specific service
make up-databank      # data-bank-api
make up-trainer       # Model-Trainer (GPU)
make up-art-trainer   # Art-Trainer (GPU)
make up-handwriting   # handwriting-ai
make up-qr            # qr-api
make up-transcript    # transcript-api
make up-turkic        # turkic-api
make up-music         # music-wrapped-api
make up-covenant      # covenant-radar-api
make up-grandma       # grandma-api
make up-github-stats  # github-stats-api
make up-opportunity   # opportunity-radar-api
make up-discord       # DiscordBot

# Start all services
make up-all

# Stop everything
make down

# Stop all services and prune Docker volumes
make clean

# Run checks across all libs/services
make check
make lint
make test

# View running containers
make status

# Stream logs
make logs

Architecture

                              +--------------+
                              | Traefik (80) |
                              +------+-------+
                                     |
                         +-----------+-----------+
                         |                       |
                   +-----v-----+           +-----v-----+
                   | Discord   |           |  Services |
                   |   Bot     |           | (FastAPI) |
                   +-----+-----+           +-----+-----+
                         |                       |
           +-------------+-------------+---------+
           |             |             |
     +-----v-----+ +-----v-----+ +-----v-----+
     |   Redis   | | PostgreSQL| | data-bank |
     | (pub/sub) | | (covenant)| | (storage) |
     +-----+-----+ +-----------+ +-----------+
           |
     +-----v-----+
     | RQ Workers|
     +-----------+

All services share:

  • platform-network (Docker bridge)
  • platform-redis (job queue + pub/sub for async services)
  • platform-postgres (covenant-radar persistence)
  • Structured JSON logging
  • Health endpoints (/healthz, /readyz)

Infrastructure

ComponentPortPurpose
Redis 76379Job queue, pub/sub, status tracking
PostgreSQL 165432Covenant-radar persistence
Kafka 3.89092Covenant-radar streaming: measurements in, predictions and alerts out
Traefik 380, 8080API gateway + dashboard

Development

# Install dependencies for a service
cd services/Model-Trainer
poetry install --with dev

# Run checks
make check

# Run just lint or test
make lint
make test

See docs/ for detailed documentation.

Code Standards

  • Type Safety: mypy strict mode, zero Any types, zero cast, zero type: ignore
  • Test Coverage: 100% statement + branch coverage enforced
  • Linting: Ruff formatting and linting
  • Architecture: Protocol-based dependency injection, _test_hooks.py pattern

Requirements

  • Python 3.11+
  • Docker + Docker Compose
  • Poetry
  • Make (via PowerShell on Windows)
  • NVIDIA GPU + CUDA 12.4 (for Model-Trainer, Art-Trainer)

License

MIT

Contributors

wagner-austin

4,476 commits

Languages

Python

88.0%

HTML

4.9%

Rust

4.6%

Java

1.4%