MLOps#

Twiga ships a production layer that closes the loop between model development and real-world deployment. The four modules below form a coherent MLOps stack that mirrors Twiga’s config-driven, Pydantic-first design principles.

Modules#

Installation#

Install the full MLOps stack with a single extra:

pip install twiga[mlops]

This pulls in MLflow, FastAPI, uvicorn, Evidently, and Prefect.

At a glance#

Module

Class / function

Responsibility

twiga.tracking

TwigaTracker

MLflow experiment tracking

twiga.forecaster

on_save_checkpoint

Persist model + pipeline with versioned manifest

twiga.forecaster

on_load_checkpoint

Restore model + pipeline from checkpoint

twiga.serve

create_app()

FastAPI REST API factory

twiga.serve

ModelLoader

Checkpoint to forecaster loader

twiga.serve

ForecastMonitor

Evidently drift & performance reports

twiga.pipeline

training_flow

Prefect training orchestration

twiga.pipeline

retraining_flow

Drift-triggered retraining