Summary
Bet Analyzer is a custom AI analysis engine that consolidates a dozen external data sources into a single daily betting recommendation report. It uses a deliberate two-stage AI architecture — a lightweight model pre-screens the universe, then a frontier reasoning model handles the deep analysis on what's left. The whole thing runs on GitHub Actions on a tight cost and time budget. It's the engine behind The Sharp Edge's daily content pipeline.
The Problem
A naive approach to AI-powered sports analysis is to dump every data source into a frontier reasoning model and ask it for picks. That works exactly once before the cost and latency become unworkable. With 12+ heterogeneous sources, dozens of games per day, and a daily content cadence, the brute-force version was a non-starter on both runtime and dollars.
I needed an engine that could (a) ingest all the data without losing signal, (b) make principled decisions about what's worth deep analysis, and (c) finish inside a 45-minute budget on a free-tier CI runner. And it had to produce output reliable enough to publish to paying members the same morning.
The Approach
The core decision was to split the AI work in two stages by cost and capability:
External data sources (12+)
↓
Data preparation
↓
Stage 1: Lightweight classifier model (~90 seconds)
↓ filters and tags candidate games
Stage 2: Frontier reasoning model (~24 minutes)
↓ deep analysis on the surviving set
Structured analysis report (markdown + JSON)
↓
Archived + handed to The Sharp Edge for HTML generation
Stage 1 is a fast, cheap classifier that does pre-screening — picking out which matchups have enough signal to be worth the frontier model's time. Stage 2 is the expensive reasoning step, but it's only running on the curated subset Stage 1 hands it. Together they finish in ~26 minutes for a fraction of the cost of a single-stage approach.
The other architectural choice that mattered: convergence over confidence. The system only surfaces a play when multiple independent signals agree on it. A single signal — even a strong one — is downgraded. This kills a lot of false positives that a model would otherwise be eager to publish.
What I Built
- Data preparation layer — normalizes and merges 12+ external feeds with different formats, field names, and freshness windows
- Stage 1 classifier — lightweight model that scores every game and flags which ones have enough signal density for deep analysis
- Stage 2 reasoning engine — frontier model that performs structured analysis on the curated subset, emitting tier-ranked recommendations with rationale
- Five-source convergence rule — only flag plays where multiple independent signals agree; suppress contradictions
- GitHub Actions orchestration — daily run on a 45-minute timeout with retries, structured logging, and artifact archiving
- Markdown + JSON dual output — markdown for human review, JSON for downstream programmatic consumption (HTML dashboards, etc.)
Engineering Highlights
- Two-stage architecture as a cost lever. Routing a frontier reasoning model only at games that survived a cheaper classifier dropped daily AI cost meaningfully and shrunk total runtime to fit a free CI budget. The win came from the architecture decision, not from prompt tuning.
- Convergence-based filtering. Models will happily surface a "strong play" off a single noisy signal. Building convergence into the report logic — explicitly counting how many independent sources agree, downgrading single-source picks — produced output that holds up under post-hoc review.
- Schema-stable output. Downstream consumers (HTML generators, analytics) depend on a consistent JSON shape. Locked the output schema with explicit field names (
betting_analysis.play_rankings.clear_winners[],strong_leans[]) and validated it on every run, so generators don't break when the model gets creative. - Cross-repo by design. The engine lives in its own repo; the platform that uses it checks it out at workflow time. That separation lets me iterate on analysis logic without redeploying the platform, and it's the same pattern I'd recommend to clients building modular AI pipelines.
Outcome
Powers a daily-content product that ships to paying members without manual intervention. Stays inside its time and cost budget on every run. Output schema has been stable long enough that downstream HTML generators haven't needed a change in months — which is the real measure of an AI pipeline working.
Tech footprint
- Backend — Python orchestrator + per-source ingestion modules
- Data — JSON intermediate artifacts, markdown reports
- AI — two-stage architecture: lightweight classification model + frontier reasoning model
- Orchestration — GitHub Actions, 45-minute timeout, artifact archiving
- Cross-repo integration — separate engine repo, checked out at runtime by the platform that consumes it