Skip to content

Docs · Studio SDK

Animica Studio SDK

A Modal-style serverless developer experience: decorate a Python function, then run it on Animica's decentralized GPU/CPU fleet with .remote() / .map(), metered and settled in ANM on-chain. For the product overview see studio.animica.org ; this page is the SDK reference.

import animica.studio as studio

app = studio.App("trainer")

@app.function(image=studio.Image.debian_slim().pip_install("torch"), gpu="A100", timeout=900)
def train(seed: int) -> float:
    import torch
    return float(torch.randn(1024, seed % 8 + 1).mean())

train.remote(42)          # one call on the fleet (settles in ANM)
train.map(range(128))     # fan-out across providers
train.local(42)           # sandbox on your machine, zero infra

Install

pip install animica

The SDK is included in the complete client (local mode + ref/JSON serialization work out of the box).

pip install "animica[all]"

Adds the full distributed client: cloudpickle (closures/lambdas) and omni-sdk (on-chain ANM escrow for remote runs).

API surface

studio.App(name) Create an app namespace for your functions.
@app.function(...) Decorate a function to run it on the fleet. Options: image, gpu, timeout, secrets, volumes, schedule.
fn.remote(*args) Run the function once on the fleet (remote mode) and return the result.
fn.map(iterable) Fan out across inputs — thousands of parallel calls with one line.
fn.local(*args) Run in a sandbox on your machine — zero infrastructure, for dev/test.
studio.Image.debian_slim() Declare an image; chain .pip_install(...) / .apt_install(...). Content-addressed.
studio.Secret.from_name(...) Inject secrets into a function — no plaintext in the job.
studio.Volume.from_name(...) Mount a persistent volume for caches, datasets, checkpoints.

Run from the CLI

animica studio run app.py::train          # run a function
animica studio run app.py::train --local  # sandbox locally

For AI agents

Studio is discoverable and usable by autonomous agents. An llms.txt manifest and an MCP server expose studio_run, studio_deploy and studio_list tools so an agent can run and deploy compute on its own, paying from a wallet. Point your agent at studio.animica.org/llms.txt .

FAQ

Local mode vs. remote mode?

fn.local() runs the function in a sandbox on your own machine with zero infrastructure — great for development. fn.remote() and fn.map() dispatch to Animica's decentralized fleet and settle the cost in ANM on-chain. The same decorated function works in both.

How is compute priced?

Per second of CPU/GPU time, quoted before each run and escrowed in ANM. Payout splits to the provider, treasury and miners by the on-chain economics. No monthly minimums.

Do I need the [all] extra for Studio?

No. The SDK works on plain pip install animica using ref + JSON serialization and local mode. The studio extras (cloudpickle for closures/lambdas, omni-sdk for on-chain ANM escrow on remote runs) come with pip install "animica[all]" or pip install "animica[studio]".

Can AI agents use Studio?

Yes. Studio ships an MCP server and an llms.txt manifest so agents can discover the platform and call studio_run / studio_deploy / studio_list to execute and deploy functions autonomously, paying from a wallet. Point an agent at https://studio.animica.org/llms.txt.

See also: Studio overview · Mining & animica up · All docs