Getting started
Install the SDK, scaffold an app, deploy in two commands.
Before you begin
Make sure you have Python 3.12 or newer installed. A free gworker account is required to deploy and run tasks on the unified serverless GPU cloud.
Install
Install the Python SDK and CLI from PyPI. Python 3.12+ is required.
1pip install gworker-clientLog in
Authenticate with your gworker account. Your token is saved to ~/.gworker/credentials and picked up automatically by all subsequent CLI and SDK calls.
1gworker loginScaffold
Create a project directory. This writes src/app.py with a starter task and gworker.toml with your app name and region.
1gworker init my-app2cd my-appYour first task
Decorate an async function with @app.task. Resources (gpu, memory, timeout) are declared here — not at call time. Heavy imports belong inside the function body so cold starts stay fast.
1import gworker_client as gw2 3app = gw.App("my-app")4 5@app.task(gpu=gw.Gpu("A100"), memory=8192, timeout=600)6async def greet(name: str) -> str:7 return f"hello {name}"Deploy
Upload your source. gworker selects a backend, builds the container, and returns an endpoint URL. The first build is slow; subsequent deploys hit the cache.
1gworker deploy --env devCall the task
Invoke the deployed task from Python. .run() blocks until the result is ready. .spawn() returns a handle you can await later.
1from my_app.src.app import greet2 3result = greet.run("world")4print(result) # "hello world"Tail logs
Stream stdout and stderr from all running workers. Press Ctrl-C to stop.
1gworker logs my-app --follow