DocsPython SDKSDK — Getting Started
Python SDK

SDK — Getting Started

Submit your first FL job from Python in ten minutes — install the SDK, log in, define a model, and call rt_submit.

Overview

The ResonTech Python SDK is a thin wrapper around the same REST + S3 APIs the web wizard uses. It renders the FL configs in memory, uploads your scripts and shards directly to your bucket, and submits the job — no SSH, no SFTP, no local temp dirs.
Git hub sample

The SDK is task-agnostic: it does not assume a specific task, dataset format, loss, or optimizer. You write your model and a one-round training function; the SDK ships them to every worker and plumbs global weights in/out of the federation.

i
The SDK's job ends at submission. Progress, logs, and the final model are tracked on the web dashboard — the Job returned from rt_submit carries a dashboard_url you can open to follow along.

1. Provision a Storage Bucket (once)

Every user gets one S3-compatible bucket in the platform's Garage cluster. You must provision it before the SDK can upload anything.

  • Log in to the web dashboard.
  • Open Profile → Storage.
  • Click Provision Bucket, pick an alias (lowercase alphanumeric + hyphens, 3–30 chars), and a quota in GB.
  • Copy the accessKeyId and secretAccessKey shown.
!
The secret is displayed once. If you lose it, come back to the same page and click Rotate Key to mint a fresh pair.

2. Get the SDK

The Python SDK is distributed privately to ResonTech customers — it is not on PyPI and there is no public download. Your account contact provides access to the package. Once you have it, install it into your Python environment in the standard way for your distribution channel.

Requirements on the client side: Python 3.11+. The SDK pulls in httpx and boto3 as dependencies — nothing else. PyTorch is required on the worker side (the FL workflow operates on PyTorch state dicts), but you do not need it locally just to submit a job.

3. Configure the Client

setup.py

Every field is documented in the Configuration reference.

4. Log In

sdk.login():

  • Authenticates against the REST API and stores the JWT.
  • Resolves your bucket alias from GET /api/users/storage/bucket if you didn't set s3_bucket_alias explicitly.
  • Raises StorageError if no bucket has been provisioned yet — the message tells you to visit Profile → Storage in the web UI.

5. Check the Cluster (optional)

Make sure there's free VRAM before submitting:

6. Define Your Model

Define your model class and an fl_train function in the same module (or notebook cell). The SDK extracts the file/cell verbatim and ships it as model_def.py.

model.py
!
Keep all import statements in the same cell as the class. The SDK extracts imports from the same cell — anything outside that cell does not travel.

7. Describe Training & Federation

Anything the typed fields don't cover (mixup, weight decay, custom schedulers, …) goes into TrainingConfig.extra. See the hyperparameters reference.

8. Submit

What the call does

  • Renders the three FL configs + the three Python scripts (model_def.py, custom_client_executor.py, custom_persistor.py) in memory.
  • Writes them to s3://<your-bucket>/jobs/<slug>/ alongside requirements.txt.
  • Streams each shard zip directly from your disk (multipart for files ≥ 10 MB, 5 concurrent parts).
  • Calls POST /api/tasks with the five S3 paths.
  • Prints a tracking URL and returns a thin Job handle.

9. Track Progress

The SDK hands off to the web dashboard at this point. Open job.dashboard_url to watch the FL round counter, browse the full workspace, download the final model, and view worker logs.

Prefer to stay in Python? sdk.storage.list("jobs/<name>/") and sdk.storage.presign_get(key) give you read access to the same files without opening the UI. See Job lifecycle.

Next Steps