Skip to content

Client

The main entry point for the Canard SDK.

Constructor

Client(
    api_url: str,
    api_key: str | None = None,
    dashboard_url: str | None = None,
    s3_results_bucket: str = "isaac-sim-results",
    s3_tensorboard_bucket: str = "isaac-sim-tensorboard",
    aws_region: str = "us-east-1",
)
Parameter Type Default Description
api_url str required Canard API base URL (https://api.canard.cloud)
api_key str None API key. If omitted, loaded from env/file
dashboard_url str None Dashboard URL (auto-derived from api_url)
s3_results_bucket str "isaac-sim-results" S3 bucket for results
s3_tensorboard_bucket str "isaac-sim-tensorboard" S3 bucket for TB logs
aws_region str "us-east-1" AWS region

Can be used as a context manager:

with Client(api_url="https://api.canard.cloud") as client:
    run = client.submit_training_run(...)

submit_training_run

client.submit_training_run(
    name: str,
    task_name: str = "Template-G1-Training-Direct-v0",
    code_url: str,
    num_envs: int = 1000,
    max_iterations: int = 1500,
    enable_video: bool = False,
    video_interval: int = 2000,
    seed: int | None = None,
    checkpoint_url: str | None = None,
    code_ref: str | None = None,
    gpu_count: int = 2,
    wait: bool = False,
) -> RunHandle

Submit a single RL training run. Returns a RunHandle for monitoring.

Prints estimated cost and dashboard URL on submission.

If wait=True, blocks until the run completes.


submit_training_sweep

client.submit_training_sweep(
    name: str,
    task_name: str = "Template-G1-Training-Direct-v0",
    code_url: str,
    sweep_params: dict[str, list] | None = None,
    num_envs: int = 1000,
    max_iterations: int = 1500,
    enable_video: bool = False,
    seed: int | None = None,
    code_ref: str | None = None,
    gpu_count: int = 2,
    wait: bool = False,
    **training_kwargs,
) -> RunHandle

Submit a hyperparameter sweep. Creates one task per parameter combination.

sweep_params is a dict mapping parameter names to lists of values:

sweep_params={"learning_rate": [1e-4, 3e-4], "entropy_coef": [0.01, 0.05]}
# Creates 2 x 2 = 4 tasks

Additional PPO kwargs (e.g., gamma=0.99) are applied to all tasks.


submit_run

client.submit_run(
    name: str,
    config: dict | RunConfig,
    wait: bool = False,
) -> RunHandle

Submit a run with a raw config dict or RunConfig object. Lower-level alternative to submit_training_run.


get_run

client.get_run(run_slug: str) -> Run

Fetch a run by its slug identifier.

Raises: RunNotFoundError if the slug doesn't exist.


list_runs

client.list_runs(limit: int = 100) -> list[Run]

List all runs for the authenticated user.


get_run_metrics

client.get_run_metrics(run_slug: str) -> RunMetrics

Get aggregated metrics for a run (reward, FPS, success rate, training progress).


get_run_tasks

client.get_run_tasks(run_slug: str) -> list[Task]

Get all tasks for a run, including their status, parameters, and metrics.


list_artifacts

client.list_artifacts(
    run_slug: str,
    artifact_type: str | None = None,
) -> list[dict]

List artifacts for a run. Optionally filter by type ("checkpoint", "video", "tensorboard", "policy", "summary").


get_artifact_url

client.get_artifact_url(run_slug: str, s3_key: str) -> str

Get a presigned HTTPS download URL for an artifact.


download_artifact

client.download_artifact(
    run_slug: str,
    s3_key: str,
    output_dir: Path | str,
) -> Path

Download an artifact to a local directory. Returns the local file path.


get_queue_status

client.get_queue_status() -> QueueStatus

Get platform queue and worker status.


close

client.close() -> None

Close the HTTP client connection. Called automatically when using with Client(...) as client:.