Skip to main content

anycloud Python SDK

Submit jobs and run workloads on any cloud with anycloud.

Install

pip install anycloud-sdk

Quick start

import anycloud

ac = anycloud.Client()

job = ac.submit("my-training:latest", gpu="h100:8", env={"LR": "0.01"})
job.wait()
print(job.logs())

Chaining jobs

prep = ac.submit("prep:latest")
prep.wait()

train = ac.submit("train:latest", gpu="h100:8", env={"LR": "0.01"})
train.wait()

eval_job = ac.submit("eval:latest")
eval_job.wait()

Fan-out / fan-in

from anycloud import Submission

split = ac.submit("split:latest")
split.wait()

shards = ac.submit_many([
    Submission(image="worker:latest", env={"LR": lr})
    for lr in ["0.1", "0.01", "0.001"]
])
shards.wait()

merge = ac.submit("merge:latest")
merge.wait()

Workload images

Publish an image containing your code and dependencies, then select its entrypoint with command. Use an immutable tag or digest when reproducibility matters:

job = ac.submit(
    "ghcr.io/acme/trainer:git-a1b2c3d",
    gpu="h100:8",
    command=["python", "-m", "training", "--lr", "0.01"],
)
job.wait()

service = ac.serve(
    "ghcr.io/acme/inference:git-a1b2c3d",
    gpu="L40S:1",
    command=["python", "-m", "myapp"],
    deployment_id="model-a-001",
)
service.wait_running(timeout=600)
print(service.url)

AnyCloud sets PORT=8088 for Services by default; override it with env={"PORT": "<port>"}. When a workload fails, DeploymentFailedError.logs includes its container logs:

from anycloud import DeploymentFailedError

try:
    job.wait()
except DeploymentFailedError as e:
    print(e.state, e.logs)

Buckets

Discover storage, inspect objects, and chain data between jobs using bucket handles. Select a credential saved with anycloud credentials new:

ac = anycloud.Client(credentials="aws-prod")

for bucket in ac.list_buckets():
    print(bucket.name, bucket.region, bucket.created_at)

data  = ac.bucket("training-data")
model = ac.bucket("model-output")

data.upload("~/datasets/imagenet.tar", remote_path="datasets/imagenet.tar")
data.upload_directory("~/datasets/shards", prefix="datasets/shards/")

for entry in data.list_objects(prefix="datasets/"):
    print(entry.kind, entry.key, entry.size_bytes)

all_objects = data.list_objects(recursive=True, limit=None)

prep  = ac.submit("prep:latest", input=data, output=model)
prep.wait()

train = ac.submit("train:latest", input=model, output=model, gpu="h100:8")
train.wait()

model.download_directory("~/checkpoints", prefix="checkpoints/")

Listings default to 1,000 sorted results; limit=None exhausts every API page. Prefixes are literal, so include a trailing / to browse a folder. Bucket I/O and listing stream through the local anycloud api server—no provider SDK extras are needed. Input buckets must already exist; output buckets used by a Job can be created by the server.

Downloads validate the received byte count and atomically replace the target only after a complete response. Incomplete responses are retried twice, then raise DownloadIntegrityError while preserving any existing target.

Directory upload, download, and prefix deletion use four workers by default; pass concurrency=1 through 32 to tune the bound. They return a BucketOperationResult. Partial item failures raise BucketOperationError with the result summary and ordered (object_key, exception) failures.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anycloud_sdk-0.1.61.tar.gz (43.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anycloud_sdk-0.1.61-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file anycloud_sdk-0.1.61.tar.gz.

File metadata

  • Download URL: anycloud_sdk-0.1.61.tar.gz
  • Upload date:
  • Size: 43.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for anycloud_sdk-0.1.61.tar.gz
Algorithm Hash digest
SHA256 0c88401c28d0a19f1d7bac194f31669b37cff6e05df046be422e910735ea1814
MD5 877f260ae48605d81a06d9eea3d5d2aa
BLAKE2b-256 21b15ee1add2568c6230f9a602935b9bd3ac690b73aab768b6aea4101f011c41

See more details on using hashes here.

Provenance

The following attestation bundles were made for anycloud_sdk-0.1.61.tar.gz:

Publisher: release.yml on anycloud-sh/anycloud

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anycloud_sdk-0.1.61-py3-none-any.whl.

File metadata

  • Download URL: anycloud_sdk-0.1.61-py3-none-any.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for anycloud_sdk-0.1.61-py3-none-any.whl
Algorithm Hash digest
SHA256 ed4e455738b7b23c4c6ebb9e155f1d59ecc94ba40a489b8806fac047b01c070d
MD5 5f5c9c34090ee2cc24de7192a77578d3
BLAKE2b-256 b466e23a8d651d9ba22693a36121b6e3fb3299a89a4b049bd7b8967ab845d3a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for anycloud_sdk-0.1.61-py3-none-any.whl:

Publisher: release.yml on anycloud-sh/anycloud

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.64

2 files

0.1.63

2 files

0.1.62

2 files

This release

0.1.61 This release

2 files

0.1.60

2 files

0.1.59

2 files

0.1.58

2 files

0.1.57

2 files

0.1.56

2 files

0.1.55

2 files

0.1.54

2 files

0.1.53

2 files

0.1.52

2 files

0.1.51

2 files

0.1.50

2 files

0.1.49

2 files

0.1.48

2 files

0.1.47

2 files

0.1.46

2 files

0.1.45

2 files

0.1.44

2 files

0.1.43

2 files

0.1.42

2 files

0.1.41

2 files

0.1.40

2 files

0.1.39

2 files

0.1.38

2 files

0.1.36

2 files

0.1.35

2 files

0.1.34

2 files

0.1.33

2 files

0.1.32

2 files

0.1.31

2 files

0.1.30

2 files

0.1.29

2 files

0.1.28

2 files

0.1.27

2 files

0.1.26

2 files

0.1.25

2 files

0.1.24

2 files

0.1.22

2 files

0.1.21

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.10

2 files

0.1.6

2 files

0.1.5

2 files

0.1.3

2 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