Skip to main content

anycloud Python SDK

Submit jobs, run workloads on any cloud.

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()

Decorator (run a Python function remotely)

Skip the image-build loop — decorate a function, and AnyCloud clones your repo on the remote VM:

@anycloud.function(image="ghcr.io/acme/trainer:latest", gpu="h100:8")
def train(lr: float):
    ...

jobs = train.map([0.1, 0.01, 0.001])  # fan out across args
jobs.wait()

Decorator deployments clone your committed, pushed GitHub repo on the remote VM. Private repos work after anycloud login, or with GITHUB_TOKEN set to a token with repo read access. The image must include git. See reference.

Serve decorator (run a long-lived daemon)

Use @anycloud.serve for one long-running server process with a stable URL:

import os
import anycloud

@anycloud.serve(image="ghcr.io/acme/inference:latest", gpu="L40S:1")
def node():
    import uvicorn
    from myapp import app

    uvicorn.run(app, host="0.0.0.0", port=int(os.environ["PORT"]))

server = node.start(id="model-a-001")
server.wait_running(timeout=600)
print(server.url)

The entrypoint must block. AnyCloud sets PORT=8088 by default; override it with env={"PORT": "<port>"}. The public URL is https://<deployment-id>.anycloud.sh. @anycloud.serve uses the same private-repo git-clone authentication as @anycloud.function.

The live SDK e2e suite includes serve-decorator coverage:

bash test/integration/e2e.sh sdk-python-serve

When a remote function fails, DeploymentFailedError.logs includes the labeled bootstrap error:

from anycloud import DeploymentFailedError

try:
    train.submit(0.01).wait()
except DeploymentFailedError as e:
    print(e.state, e.logs)

Buckets

Chain data between jobs using bucket handles. Output buckets are auto-created by the server; upload() auto-creates input buckets.

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

data.upload("~/datasets/imagenet")  # auto-creates bucket

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("~/checkpoints/")

Bucket I/O streams through the local anycloud api server using a credential registered with anycloud credentials new — no extra installs needed. Use Client(credentials="<name>") so the SDK knows which credential to pass.

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.50.tar.gz (44.1 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.50-py3-none-any.whl (29.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for anycloud_sdk-0.1.50.tar.gz
Algorithm Hash digest
SHA256 7725bdf5ee7c9e92a331e5ee603dfbb9cc6370ebefd181fe71e8abea6f15ec46
MD5 f5c0731efe4d864d1f51336bbc43e41c
BLAKE2b-256 d9d52251691b81812a157facdf1cfa4ed4eb4797ca698dd5f7988da50f9d83a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for anycloud_sdk-0.1.50.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.50-py3-none-any.whl.

File metadata

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

File hashes

Hashes for anycloud_sdk-0.1.50-py3-none-any.whl
Algorithm Hash digest
SHA256 b9f5c12b09c0fefd7cc8cdb3d88fa06de68da36cc2765696732cce4e8401deec
MD5 245a3276105f2cbfcbdee7e01c441d52
BLAKE2b-256 859372c3cc4d2b76a7cf180a723b773c1e2748e719130a7d741270391d3e4ed0

See more details on using hashes here.

Provenance

The following attestation bundles were made for anycloud_sdk-0.1.50-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

0.1.61

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

This release

0.1.50 This release

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