← back to projects
systems project

ledger-sentinel

language: Python · FastAPI · Celeryhardware: Cloud / Containerstatus: Complete — built over a focused 2-day sprint

motivation

I wanted a pipeline that treats an LLM as one stage in a larger, testable system rather than the whole system — CSV in, cleaned and validated data, deterministic anomaly rules, then an LLM stage for the parts that are genuinely about language, all behind a task queue so a slow model call never blocks the API.

what it does

Ingests raw transaction CSVs asynchronously via Celery, normalizes inconsistent date formats and deduplicates records, flags anomalies with deterministic rules (spend outliers past 3x the account median, foreign-currency charges on domestic-only merchants), then batches uncategorized transactions through the Gemini API for classification and generates a narrative spend summary.

technical detail

The Gemini integration is genuinely wired in production, not mocked — tests patch the model client directly so the pipeline is fully unit-testable without live API calls. Batch classification runs in groups of 20 with exponential backoff. The whole thing is Dockerized with a Flower dashboard for watching the Celery queue in real time.

system architecture

spacecraft firmware (host application)
Application / Mission Software
↓ embedded-hal traits
spacecan — no_std library crate
Frame Layer
encode / decode
Service Layer
ST01 ST03 ST08 ST17 ST20
Bus Abstraction Trait
↓           ↓
STM32F4 bxCAN
(real hardware)
Mock transport
(Renode / CI)

technology used

Python
FastAPI
Celery
Redis
PostgreSQL
Alembic
Gemini API
Docker Compose