mlops
Shared MLOps platform package — not a machine learning project of its own. It gives every ML project the generic building blocks of a training pipeline (data validation, experiment tracking, quality gates, drift monitoring), so each project imports them instead of re-writing the same tracking/quality-gate/validation/monitoring logic:
mlops.validation.run_expectations(df, rules)— run Great Expectations rulesmlops.mlflow_tracking.log_and_register(...)/promote_model_to_production(...)— MLflow experiment tracking and model registrymlops.quality_gate.check_threshold(...)— stop a pipeline if a metric regressedmlops.monitoring.check_drift(reference_data, current_data)— Evidently drift detectionmlops.git_info.get_current_commit_hash()— commit hash for run metadata
Everything project-specific (data source, feature engineering, model training, API serving, the
orchestration flow that wires these steps together) stays in each consuming project's own repo —
mlops only provides the reusable building blocks above.
Install
pip install mlops_abp
# or with uv
uv add mlops_abp
The distribution is named mlops_abp on PyPI; the importable package is mlops:
from mlops import log_and_register, check_threshold, run_expectations, check_drift
For local development against a checkout of this repo instead of the published release:
cd /path/to/your-project
uv add --editable /path/to/mlops
Usage
from mlops import check_threshold, log_and_register, run_expectations
run_expectations(df_train, rules=[
{"expectation": "expect_column_values_to_not_be_null", "kwargs": {"column": "target"}},
])
run_id = log_and_register(
model=model,
run_name="baseline",
params=params,
metrics=metrics,
model_name="your_model_name",
experiment_name="your_project_experiment", # distinct per project
)
check_threshold(metrics["accuracy"], threshold=0.85, metric_name="accuracy")
Drift monitoring:
from mlops import check_drift
if check_drift(reference_data=baseline_df, current_data=recent_df):
print("Drift detected — consider retraining")
Shared platform infrastructure (optional, for self-hosting MLflow/Prefect)
git clone <this-repo>
cd mlops
cp .env.example .env
docker compose up -d # postgres (MLflow backend store) + mlflow-server + prefect-server
- MLflow UI: http://localhost:5000
- Prefect UI: http://localhost:4200
Development
uv sync
uv run pytest tests/ -v
uv run ruff check mlops/ tests/
License
MIT — see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mlops_abp-0.1.2.tar.gz.
File metadata
- Download URL: mlops_abp-0.1.2.tar.gz
- Upload date:
- Size: 349.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
193cf716efb89362062fdb0f7e9ce636d5981846e13bdb521885959e813e7aae
|
|
| MD5 |
849894ae5a869ec40fa5f65dc23b205e
|
|
| BLAKE2b-256 |
a48c4b089778b9482c1040df2849782b125df23f23e5bba25ce1dc6967797688
|
File details
Details for the file mlops_abp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: mlops_abp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ec0a0df98cfa41699f51f1cb4da85aec7da5b5d0ebdb0f3768bbd6f96a96779
|
|
| MD5 |
b97206da847944106452c552bda85b19
|
|
| BLAKE2b-256 |
4e4865d6698a750f6dab3883641111d95696b8362a07b6bf522c662037a15360
|