0
All projects

Movie Recommendation (MLOps)

A team course project that served an SVD++ recommender through FastAPI with model routing, per-request provenance, data checks and CI.

Role
Built the provenance logging, build-time commit injection, the Kafka ingestion notebook and the Docker setup
When
Mar 2025 - May 2025
Status
Complete
Context
Responsible AI Engineering, team of 6
Stack
  • Python
  • FastAPI
  • Surprise
  • Docker
  • Jenkins
  • LaunchDarkly
  • Evidently

The problem

A recommender in a notebook is the easy part. The course asked for everything around it: serving, routing between model versions, knowing which model and which build produced a given recommendation, data checks and CI.

There were six of us. My part was provenance: every recommendation records the model version, data version and the exact pipeline commit. I also wrote the Kafka ingestion notebook and the Dockerfile, and added the GitHub Actions workflows after the course. Teammates built the LaunchDarkly routing, the Jenkinsfile and tests, model tuning and evaluation, and the drift and schema checks.

How it works

  1. 1

    Ingest

    A Kafka extraction notebook turns the event stream into the processed training dataset.

  2. 2

    Train and retrain

    SVD++ with grid search, with dated snapshots kept for each retraining run.

  3. 3

    Serve

    A FastAPI recommendation endpoint in Docker. A LaunchDarkly flag picks which model variant answers, with a fallback when no key is set.

  4. 4

    Provenance

    Every response logs the user, model version, data version and the pipeline commit that built the container.

  5. 5

    Checks

    Schema validation, drift reports, a fairness check and offline and online evaluation.

  6. 6

    CI

    Jenkins runs formatting, tests and a full compose bring-up, then coverage.

Decisions and tradeoffs

  • Inject the commit hash at build time. Jenkins passes it into the Docker build, with fallbacks to git rev-parse and then "unknown", so a container with no .git folder still logs where it came from.
  • A fallback flag client, so the API still runs locally without a LaunchDarkly key.

Results

  • 312 of 316

    Logged recommendation calls that carry the exact commit that built the serving container

    provenance_logs/provenance_log.jsonl (the 4 without one predate the injection)

  • 30.7%

    Online click-through rate across 304 recommendation events from 100 simulated users

    evaluation/online, online_evaluation_report.json

  • 26

    Test functions across the API and pipeline

    tests/

Line charts of click-through rate, watch-through rate and average rating over two weeks
The team's online telemetry over two weeks of simulated users. It shows the logging working end to end, not real engagement.

Limits

The schema check is a standalone script and doesn't run in CI, and there's no production traffic behind any of it.

Next project

Counterfactual Fact Verification

How well small local LLMs check FEVER claims with and without evidence, and how easily hand-written counterfactuals fool them.