MATIH Platform is in active MVP development. Documentation reflects current implementation status.
13. ML Service & MLOps
Experiment Tracking
Artifact Management

Artifact Management

Artifacts are files associated with experiment runs -- trained models, datasets, plots, configuration files, evaluation reports, and any other binary or text data relevant to reproducing or understanding a training run.


Uploading Artifacts

POST /api/v1/experiments/runs/{run_id}/log-artifact
Content-Type: multipart/form-data
X-Tenant-ID: acme-corp
 
file: @model.pkl
artifact_path: models/

Response

{
  "message": "Artifact logged",
  "run_id": "...",
  "artifact": "models/model.pkl"
}

Artifact Types

TypeExtensionExample
Serialized models.pkl, .joblib, .pt, .h5model.pkl
ONNX models.onnxmodel.onnx
Configuration.json, .yamlhyperparams.json
Evaluation plots.png, .svgconfusion_matrix.png
Data samples.csv, .parquettest_predictions.csv
Text reports.txt, .mdevaluation_report.md

SDK Artifact Methods

The ExperimentTracker provides several methods for artifact logging:

with tracker.start_run(experiment_name="fraud-detection") as run:
    # Log a single file
    run.log_artifact("/tmp/model.pkl", artifact_path="models")
 
    # Log a dictionary as JSON
    run.log_dict(
        {"threshold": 0.5, "features": ["amount", "frequency"]},
        "config/model_config.json"
    )
 
    # Log text content
    run.log_text(
        "Model achieved 91.2% accuracy on holdout set",
        "reports/summary.txt"
    )
 
    # Log a matplotlib figure
    import matplotlib.pyplot as plt
    fig, ax = plt.subplots()
    ax.plot(losses)
    run.log_artifact.__self__._tracker.log_figure(fig, "plots/loss_curve.png")

Storage Location

Artifacts are stored in S3-compatible object storage. The default location is derived from the experiment:

s3://matih-artifacts/experiments/{experiment_id}/runs/{run_id}/artifacts/

This can be overridden per experiment via the artifact_location field at creation time.


Artifact Directory Logging

To log an entire directory of artifacts:

tracker.log_artifacts("/path/to/artifacts/directory", artifact_path="evaluation")

This uploads all files in the directory to {artifact_uri}/evaluation/.


Source Files

FilePath
Artifact Upload Endpointdata-plane/ml-service/src/api/experiments.py
ArtifactManagerdata-plane/ml-service/src/tracking/artifact_manager.py
EnhancedArtifactServicedata-plane/ml-service/src/tracking/enhanced_artifact_service.py