Skip to main content
Build Coverage The Chamber Python SDK provides a simple, intuitive interface for submitting and managing GPU workloads programmatically.

Features

One-Liner Submissions

Auto-containerize and submit workloads without Docker or Kubernetes expertise

Workload Submission

Submit GPU workloads with full control over resources, priority, and scheduling

Monitoring

Track workload status, retrieve GPU metrics, and get workload statistics

Capacity Management

Query available GPU capacity, budgets, and manage allocations

Distributed Training

Support for multi-node distributed training with gang and elastic scheduling

Teams & Templates

Manage teams and use workload templates for consistent configurations

Quick Examples

One-Liner: Auto-Containerize & Submit

The fastest way to get your training code running on GPUs. No Dockerfile or Kubernetes knowledge required:
from chamber_sdk import ChamberClient

client = ChamberClient.from_config()

# Configure registries once (persisted to ~/.chamber/config.json)
ChamberClient.add_registry("prod", "us-east1-docker.pkg.dev/my-project/prod", set_default=True)
ChamberClient.add_registry("dev", "us-east1-docker.pkg.dev/my-project/dev")

# Submit to default registry
job = client.run("./my-project", gpus=4, team="ml-research")

# Or specify a registry by name
job = client.run("./my-project", gpus=4, team="ml-research", registry="dev")
print(f"Submitted: {job.id}")
Install with pip install chamber-sdk[run] to use this feature. See the Auto-Containerize & Run guide for details.

Standard: Full Control

For production workloads where you need complete control:
from chamber_sdk import ChamberClient, JobClass

# Initialize client
client = ChamberClient.from_config()

# Submit a training workload
job = client.submit_job(
    name="llm-fine-tuning",
    initiative_id="team-ml",
    gpu_type="H100",
    requested_gpus=8,
    job_class=JobClass.RESERVED,
    tags={"experiment": "gpt-finetune-v1"}
)

print(f"Submitted workload: {job.id}")

# Wait for completion
result = client.wait_for_completion(job.id, timeout=3600)
print(f"Workload finished with status: {result.status}")

# Get metrics
if result.status.value == "COMPLETED":
    metrics = client.get_workload_metrics(job.id)
    print(f"GPU utilization: {metrics.gpu_utilization.avg:.1f}%")

API Endpoint

The SDK connects to the Chamber API at https://api.usechamber.io/v1 by default. You can override this for custom deployments:
client = ChamberClient(
    token="ch.your-token",
    api_url="https://custom.api.example.com/v1"
)

Requirements

  • Python 3.8 or higher
  • requests library (installed automatically)

Security

The SDK is designed with security as a priority:
  • Input Validation - All user inputs are validated before being passed to external commands or APIs
  • Credential Protection - Tokens and credentials are never logged or exposed in error messages
  • Safe Command Execution - Shell injection is prevented through strict input sanitization
  • Path Traversal Protection - File operations are restricted to intended directories
Credentials loaded from ~/.chamber/token.json or environment variables are handled securely and never included in debug output or exception messages.

Supported Container Registries

Push container images to your preferred registry with automatic authentication:
RegistryAuto-AuthAuto-Create Repo
Google Artifact Registry✅ via gcloud CLI
AWS ECR✅ via AWS CLI
Just provide your registry URL—the SDK automatically detects the type and handles authentication. No manual docker login required.

What’s New

  • Seamless Multi-Cloud Registries - Full support for Google Artifact Registry and AWS ECR with auto-authentication
  • Named Registries - Configure registries once, use by name (e.g., registry="prod")
  • Auto-Containerize & Run - Submit workloads in one line without Docker/K8s expertise
  • Framework Detection - Auto-detect PyTorch, TensorFlow, JAX and select optimal base images
  • Distributed Training - Auto-detect DeepSpeed, Accelerate, Ray and configure appropriately
  • Workload Search - Advanced filtering with full-text search
  • Aggregations - Get workload counts by status, GPU type, team, and more
  • Teams API - List, create, and manage teams
  • Templates - Use predefined workload templates

Next Steps