GODML
Governed, Observable & Declarative Machine Learning Framework
Declarative ML pipelines with fail-closed PCI-DSS compliance, MLflow tracking and a verified release supply chain.
Quick start
pip install godml
godml init my-project
cd my-project
# 1. Put your CSV at data/your_dataset.csv
# 2. In godml.yml, set dataset.target to the column you want to predict
# 3. The generated config enables PCI-DSS compliance, which needs a secret key:
export GODML_PII_KEY=$(python -c "import secrets; print(secrets.token_hex(32))")
godml run -f godml.yml
No cloud account is required for local training (MLflow runs locally).
What is GODML?
GODML drives the ML lifecycle — data prep, compliance, training, evaluation, registration and serving — from one declarative YAML file.
Data → PCI-DSS compliance → Train → Evaluate → MLflow registry → Serve → Monitor
(mask/hash/drop PII) (XGB/RF/LR) (thresholds) (FastAPI) (Prometheus, PSI drift)
Governance is fail-closed: if compliance is requested and cannot be applied, a pinned dataset hash does not match, or a governance check fails, the run stops instead of continuing with unprocessed data.
| Problem | Without GODML | With GODML |
|---|---|---|
| Reproducibility | Manual notebooks | Declarative YAML, verified dataset hash |
| Compliance | Ad-hoc checks | Built-in PCI-DSS (mask / HMAC hash / drop) |
| Supply chain | No SBOM | SLSA L3 provenance + SBOM on every release |
| Audit trail | Scattered logs | MLflow run with dataset hash and schema |
Installation
pip install godml # core: CLI, YAML, training with MLflow
pip install "godml[api]" # REST inference server (fastapi + uvicorn)
pip install "godml[observability]" # Prometheus metrics for the server
pip install "godml[aws]" # SageMaker executor (boto3 + sagemaker)
pip install "godml[data]" # Parquet support for dataprep (pyarrow)
pip install "godml[deep]" # LSTM forecasting (tensorflow + keras)
pip install "godml[advisor]" # LLM advisor (gpt4all, local model)
pip install "godml[all]" # every runtime extra above
Configuration
A minimal godml.yml:
name: customer-churn
version: 1.0.0
provider: mlflow
dataset:
uri: ./data/churn.csv
target: churn
hash: auto # or the SHA-256 from `godml calc-hash`; verified on run
model:
type: xgboost
hyperparameters:
max_depth: 6
eta: 0.1
n_estimators: 300
metrics:
- name: auc
threshold: 0.85
- name: accuracy
threshold: 0.80
governance:
owner: ml-team@company.com
compliance: pci-dss # optional; requires GODML_PII_KEY (see Compliance)
policy: mask_sensitive
tags:
- environment: production
deploy:
realtime: false
batch_output: ./outputs/predictions.csv
${VAR} and ${VAR:default} are resolved from the environment anywhere in
the file. For loss metrics (mse, rmse, mae, log_loss) the threshold
is an upper bound.
godml run -f godml.yml
Notebook API
from godml.notebook_api import GodmlNotebook
nb = GodmlNotebook()
nb.create_pipeline(
name="churn_xgb",
model_type="xgboost",
hyperparameters={"max_depth": 6, "n_estimators": 300},
dataset_path="./data/churn.csv",
target="churn",
)
nb.train()
nb.save_model(model_name="churn_xgb", environment="experiments")
Quick one-liner:
from godml.notebook_api import quick_train
quick_train(
model_type="random_forest",
hyperparameters={"max_depth": 5},
dataset_path="./data/churn.csv",
target="churn",
)
Hyperparameter search
import pandas as pd
from godml.notebook_api import tune_model
df = pd.read_csv("./data/churn.csv")
# tune_model expects numeric features: encode or drop text columns first
X = df.drop(columns=["churn"]).select_dtypes("number")
y = df["churn"]
result = tune_model(model_type="xgboost", X=X, y=y, metric="roc_auc", max_trials=20)
print(result["best_score"], result["best_params"])
Randomized search with cross-validation; pass use_optuna=True to use Optuna
if it is installed (pip install optuna, not included in any extra).
Advisor (requires godml[advisor])
from godml.notebook_api import advisor_full_report
advisor_full_report(df, target="churn") # prints task type, suggested models,
# hyperparameter space and data quality
Supported model types
model.type |
Algorithm |
|---|---|
xgboost |
XGBoost |
random_forest |
scikit-learn RandomForest |
logistic_regression |
scikit-learn LogisticRegression |
linear_regression |
scikit-learn LinearRegression (regression) |
lstm_forecast |
LSTM forecasting (requires [deep]) |
Compliance
PCI-DSS is the built-in compliance standard. It detects PII by column name
(whole tokens such as email, card_number, zip_code, lat) and by
content (card numbers, emails, SSN, phones, IBAN, …), and applies a policy:
governance.policy |
Effect |
|---|---|
mask_sensitive (default) |
Masks values (e.g. us**@example.com) |
hash_sensitive |
HMAC-SHA256 keyed by GODML_PII_KEY |
drop_sensitive |
Removes the columns |
GODML_PII_KEY is required whenever compliance is enabled, with any policy
and in any environment; the run stops without it. Generate it with
python -c "import secrets; print(secrets.token_hex(32))", keep it secret and
use the same key for training and serving. For throwaway local tests only,
GODML_ALLOW_INSECURE_PII_KEY=1 uses a public dev key (refused with
GODML_ENV=prod).
The dataset target is never treated as PII. Any other governance.compliance
value stops the run: no other standard is implemented.
from godml.compliance_service.pci_dss import PciDssCompliance
clean_df = PciDssCompliance(policy="drop_sensitive").apply(df)
Custom standards: subclass godml.compliance_service.base_compliance.BaseCompliance
and implement apply(df).
Architecture
┌──────────────────────────────────────────────────────┐
│ GODML Framework │
├──────────────────────────────────────────────────────┤
│ Interfaces: CLI │ Notebook API │ REST server │
├──────────────────────────────────────────────────────┤
│ Config (YAML + ${VAR}) │ Pipeline engine │
├──────────────────────────────────────────────────────┤
│ DataPrep │ PCI-DSS compliance │ Models │ Monitoring │
│ │ (fail-closed) │ │ (PSI drift)│
├──────────────────────────────────────────────────────┤
│ Executors: MLflow (local) │ SageMaker │
└──────────────────────────────────────────────────────┘
Supply chain & security
Every release is built in GitHub Actions with SLSA Level 3 provenance and published to PyPI with Trusted Publishing (OIDC). Details and current enforcement are in SECURITY.md.
| Artifact | Format | Signature | Where |
|---|---|---|---|
| Wheel + sdist | .whl, .tar.gz |
Covered by SLSA provenance | GitHub Release, PyPI |
multiple.intoto.jsonl |
SLSA v1 / in-toto | slsa-github-generator (Sigstore) | GitHub Release |
sbom.cyclonedx.json |
CycloneDX | not signed | GitHub Release |
sbom.spdx.json |
SPDX | Cosign keyless (Rekor) | Workflow artifact supplychain-artifacts |
Verify SLSA provenance
# From the GitHub Release: the wheel and multiple.intoto.jsonl
slsa-verifier verify-artifact godml-<version>-py3-none-any.whl \
--provenance-path multiple.intoto.jsonl \
--source-uri github.com/DAGMALIA/godml \
--source-tag v<version>
Verify the signed SPDX SBOM
# From the `supplychain-artifacts` artifact of the release workflow run
cosign verify-blob \
--bundle sbom.spdx.bundle \
--certificate-identity-regexp "https://github.com/DAGMALIA/godml/.github/workflows/safety_scan.yml" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
sbom.spdx.json
CI security controls
| Control | Tool | Status |
|---|---|---|
| SAST | Bandit | Blocks on HIGH |
| Fail-closed lint | ruff (S110, BLE001) + mypy |
Blocks new violations |
| Dependency CVEs | pip-audit + Safety (reviewed ignores) | Blocks, every push and PR |
| Licenses | pip-licenses | Blocks strong copyleft |
| Actions | Pinned by commit SHA, updated by Dependabot | Enforced |
| PyPI publish | OIDC Trusted Publisher | No API tokens |
| Branch / tag protection | GitHub rulesets | main and release tags |
| Score | OpenSSF Scorecard | Weekly |
CLI reference
godml init <project> # scaffold a project (godml.yml, data/, Dockerfile)
godml run -f godml.yml # run the pipeline
godml calc-hash <file> [-u godml.yml] # SHA-256 of a dataset, optionally pinned in the YAML
godml serve [--environment dev] # serve the model locally (needs [api])
godml deploy <project> <env> # build and run the Docker image for an environment
godml dataprep --help # data preparation recipes
godml --version # installed version
Roadmap
GoDML 2.0 is in progress: installation per pillar (Train, Govern, Serve, Observe, Tools), a v2 YAML spec with a migration path from 1.x, a single bundle-based serving runtime and conda-forge packages. 1.x keeps working; breaking changes come with a migration guide.
Contributing
git clone https://github.com/DAGMALIA/godml.git
cd godml
pip install -e ".[dev,test-serve,test-observe,test-aws]"
pipx install pre-commit && pre-commit install
pytest tests/ --cov=godml
License
MIT — see LICENSE.
Metadata
Release files for godml 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| godml-1.4.0.tar.gz | 117.1 kB | With provenance | Details for godml-1.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| godml-1.4.0-py3-none-any.whl | Python 3 | none | any | Details for godml-1.4.0-py3-none-any.whl |
Total release size: 263.3 kB
Release files / godml-1.4.0.tar.gz
| Download URL | godml-1.4.0.tar.gz |
|---|---|
| Size | 117.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1aebd67f9e299f6d572f9c61ad6290048f51f46263082a78836c30925abafa97
|
|
BLAKE2b-256 checksum How to use checksums |
2ce30b7e61b834657b97778a6995f70be151d248ac8f8c36f5c6e0b19f5b1de4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / godml-1.4.0-py3-none-any.whl
| Download URL | godml-1.4.0-py3-none-any.whl |
|---|---|
| Size | 146.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2d7c3b37be8dcf0a3dcc50b1992bcdce3d095f06a57e6dbfa604a9ec7c46dd2d
|
|
BLAKE2b-256 checksum How to use checksums |
1067b912a22d28f46b0cb232bb17de409e58a55eef0edfee805ac68300ea5563
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logSecurity for godml 1.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for godml-1.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.