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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| prefect_slate-0.2.0.tar.gz | 3.9 kB | Without provenance | Details for prefect_slate-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| prefect_slate-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for prefect_slate-0.2.0-py3-none-any.whl |
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
|
Security for prefect-slate 0.2.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.