Skip to main content

prefect-slate

Prefect tasks for Slate — move datasets and model weights between object stores from your Prefect flows at 984 MB/s, 4.4× faster than aws s3 cp.

Install

pip install prefect-slate

Setup

Make sure slate-api is running:

DATABASE_URL=sqlite:slate.db?mode=rwc slate-api

Usage

from prefect import flow
from prefect_slate import slate_transfer, SlateCredentials

creds = SlateCredentials(base_url="http://slate-api:3030")

@flow(name="ml-training-pipeline")
def ml_pipeline():
    # Ingest raw dataset from S3 to GCS
    ingest_result = slate_transfer(
        src="s3://raw-data/datasets/imagenet/",
        dst="gs://ml-staging/datasets/imagenet/",
        slate_credentials=creds,
    )
    print(f"Ingested {ingest_result['bytes_transferred']} bytes")

    # Copy model weights to GPU node (Prefect waits automatically via return value)
    weights_result = slate_transfer(
        src="gs://ml-staging/weights/llama-3-70b/",
        dst="/mnt/nvme/weights/",
        slate_credentials=creds,
        priority=10,
        max_attempts=5,
        wait_for=[ingest_result],
    )
    print(f"Peak speed: {weights_result['peak_throughput_mbps']:.1f} MB/s")

if __name__ == "__main__":
    ml_pipeline()

Server-side pipeline chaining

For transfers that should be chained inside Slate itself (not just Prefect task ordering), use depends_on_job:

@flow
def pipeline():
    # Submit both jobs to Slate; Slate worker handles the dependency
    ingest = slate_transfer(
        src="s3://raw/",
        dst="gs://stage/",
        slate_credentials=creds,
    )
    # Slate won't start this until the ingest job_id completes
    slate_transfer(
        src="gs://stage/",
        dst="gs://prod/",
        slate_credentials=creds,
        depends_on_job=ingest["job_id"],
    )

Supported stores

URL scheme Provider
s3://bucket/prefix AWS S3, MinIO, Cloudflare R2
gs://bucket/prefix Google Cloud Storage
az://container/prefix Azure Blob Storage
/path or file:///path Local filesystem

Task reference

slate_transfer(
    src="s3://...",                     # required
    dst="gs://...",                     # required
    slate_credentials=creds,            # required
    priority=0,                         # higher = picked up sooner
    max_attempts=3,                     # retries with exponential backoff
    depends_on_job=None,                # Slate job ID (server-side chaining)
    callback_url=None,                  # webhook on complete/fail
    poll_interval=3.0,                  # seconds between status polls
    timeout=None,                       # raise after N seconds
)

Returns a dict with job_id, bytes_transferred, peak_throughput_mbps, started_at, completed_at.

Metadata

Release files for prefect-slate 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prefect-slate 0.2.0
File Size Uploaded
prefect_slate-0.2.0.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prefect-slate 0.2.0
File Interpreter ABI Platform
prefect_slate-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 kB

Release files / prefect_slate-0.2.0.tar.gz

Download URL prefect_slate-0.2.0.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d056ddc8bf387e5e36e3043bc33c1371f30da355914d5ff5f67bf9c9455c830e
BLAKE2b-256 checksum
How to use checksums
62acd178f6b6d38ebde0c454d6b1ad49d1c4a68cf7b45746f8f6c7702d61f079
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / prefect_slate-0.2.0-py3-none-any.whl

Download URL prefect_slate-0.2.0-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9187c100863624337e6ee2234b83ea981b86a67a75049dabadc1c96f8c1a9978
BLAKE2b-256 checksum
How to use checksums
4a7616970ac55cabb3be59a849f376ab5ade430a3b31d49443191f8108b5a013
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page