Tx & card risk
High-volume card transactions with amount, merchant, velocity and device signals. 6 Kafka partitions for parallel scoring.
A streaming fraud-detection platform that scores payments, SMS and email
events as they land. Kafka ingress with 6-partition fan-out, an ML+rules
scoring path fused with per-event reasoning, Redis Streams alert egress,
FastAPI + gRPC sync scoring, Prometheus + Grafana
observability, and a drift detector that PSI/JS the feature distribution every window.
The widget posts to POST /score on the live inference API and renders the
returned score ∈ [0,1], is_alert, ranked reasons[],
and end-to-end latency_ms. Flip between payments,
SMS, and email, then try a safe
or fraud preset — or edit the JSON payload and see how the score shifts.
Each channel has its own feature pipeline, rule DSL, and ML sub-model. All feed the same
scoring contract: score ∈ [0,1], is_alert, ranked
reasons[], and an end-to-end latency_ms.
High-volume card transactions with amount, merchant, velocity and device signals. 6 Kafka partitions for parallel scoring.
Short-form messaging with URL shorteners, urgency language, blocklist hits and suspicious-word vocabulary.
Longer-form content with subject/body heuristics, link volume, reply-to mismatches and spoofed display names.
Event producers feed Kafka; a consumer scores and emits alerts to a Redis Stream; a sync REST+gRPC API offers on-demand scoring for UI integrations; Prometheus scrapes custom metrics; Grafana dashboards surface throughput, latency and drift.
Offline: PR-AUC, ROC-AUC, precision@k. Online: latency percentiles and drift (PSI + JS) over a rolling window. Thresholds are tuned on offline holdout and validated against live cost/benefit.
Every layer is observable, tested, and independently scalable. The consumer and sync API share the same scoring module so online/offline feature skew is minimised.
| Layer | Tech | Role |
|---|---|---|
| Ingress | Kafka · Zookeeper · 6/3/3 partitions | Multi-topic fan-out for payments / SMS / email with independent parallelism knobs. |
| Scoring | Python · scikit-learn · rules DSL | Shared-nothing scoring module — ML features fused with a rule DSL producing ranked reasons[]. |
| Sync API | FastAPI · gRPC (protobuf) | Dual-protocol scoring endpoint for online integrations + admin /config. |
| Alert egress | Redis Streams | Downstream consumers (case-management, ops dashboards) subscribe without coupling to Kafka. |
| Observability | Prometheus · Grafana · custom exporter | Throughput, latency percentiles, drift, alert rate, threshold-effect — all dashboarded. |
| Evaluation | PR-AUC · ROC-AUC · precision@k · PSI/JS | Offline harness + drift report, tuned on holdout and validated live. |
REST and gRPC both return the same shape — a score, an alert flag, ranked reasons,
and a latency. The threshold is runtime-configurable via /config.