mixle.inference.production.serving module¶
Production scoring with activity + computation logging and health/problem reporting.
A Service wraps a fitted model (loaded directly or from a Registry alias) and
scores production batches, recording every computation – record count, wall time, mean log-likelihood,
and how many records were unscorable (outside the model’s support) – to an in-memory activity log (and
optionally a JSONL file). health() summarizes recent activity so problems (rising unscorable rate,
falling log-likelihood, slow batches) are visible; with a reference sample set it can also flag drift.
- class Service(model, *, name=None, reference=None, log_path=None, keep=1000)[source]
Bases:
objectA deployed model that scores batches and logs each computation for monitoring.
- classmethod from_registry(registry, name, *, alias='production', **kw)[source]
Load the model an alias points at in
registryand serve it (carrying its provenance header).
- score(records)[source]
Return per-record log-densities and log the computation (timing, mean log-lik, unscorable count).
- check_drift(records)[source]
Drift of
recordsversus the service’s reference sample (requires areference).