Lambda Labs GPU Cloud
Comprehensive guide to running ML workloads on Lambda Labs GPU cloud with on-demand instances and 1-Click Clusters.
When to use Lambda Labs
Use Lambda Labs when:
- Need dedicated GPU instances with full SSH access
- Running long training jobs (hours to days)
- Want simple pricing with no egress fees
- Need persistent storage across sessions
- Require high-performance multi-node clusters (16-512 GPUs)
- Want pre-installed ML stack (Lambda Stack with PyTorch, CUDA, NCCL)
Key features:
- GPU variety: B200, H100, GH200, A100, A10, A6000, V100
- Lambda Stack: Pre-installed PyTorch, TensorFlow, CUDA, cuDNN, NCCL
- Persistent filesystems: Keep data across instance restarts
- 1-Click Clusters: 16-512 GPU Slurm clusters with InfiniBand
- Simple pricing: Pay-per-minute, no egress fees
- Global regions: 12+ regions worldwide
Use alternatives instead:
- Modal: For serverless, auto-scaling workloads
- SkyPilot: For multi-cloud orchestration and cost optimization
- RunPod: For cheaper spot instances and serverless endpoints
- Vast.ai: For GPU marketplace with lowest prices
Quick start
Account setup
- Create account at https://lambda.ai
- Add payment method
- Generate API key from dashboard
- Add SSH key (required before launching instances)
Launch via console
- Go to https://cloud.lambda.ai/instances
- Click "Launch instance"
- Select GPU type and region
- Choose SSH key
- Optionally attach filesystem
- Launch and wait 3-15 minutes
Connect via SSH
ssh ubuntu@<INSTANCE-IP>
ssh -i ~/.ssh/lambda_key ubuntu@<INSTANCE-IP>
GPU instances
Available GPUs
| GPU |
VRAM |
Price/GPU/hr |
Best For |
| B200 SXM6 |
180 GB |
$4.99 |
Largest models, fastest training |
| H100 SXM |
80 GB |
$2.99-3.29 |
Large model training |
| H100 PCIe |
80 GB |
$2.49 |
Cost-effective H100 |
| GH200 |
96 GB |
$1.49 |
Single-GPU large models |
| A100 80GB |
80 GB |
$1.79 |
Production training |
| A100 40GB |
40 GB |
$1.29 |
Standard training |
| A10 |
24 GB |
$0.75 |
Inference, fine-tuning |
| A6000 |
48 GB |
$0.80 |
Good VRAM/price ratio |
| V100 |
16 GB |
$0.55 |
Budget training |
Instance configurations
8x GPU: Best for distributed training (DDP, FSDP)
4x GPU: Large models, multi-GPU training
2x GPU: Medium workloads
1x GPU: Fine-tuning, inference, development
Launch times
- Single-GPU: 3-5 minutes
- Multi-GPU: 10-15 minutes
Lambda Stack
All instances come with Lambda Stack pre-installed:
- Ubuntu 22.04 LTS
- NVIDIA drivers (latest)
- CUDA 12.x
- cuDNN 8.x
- NCCL (for multi-GPU)
- PyTorch (latest)
- TensorFlow (latest)
- JAX
- JupyterLab
Verify installation
nvidia-smi
python -c "import torch; print(torch.cuda.is_available())"
nvcc --version
Python API
Installation
pip install lambda-cloud-client
Authentication
import os
import lambda_cloud_client
configuration = lambda_cloud_client.Configuration(
host="https://cloud.lambdalabs.com/api/v1",
access_token=os.environ["LAMBDA_API_KEY"]
)
List available instances
with lambda_cloud_client.ApiClient(configuration) as api_client:
api = lambda_cloud_client.DefaultApi(api_client)
types = api.instance_types()
for name, info in types.data.items():
print(f"{name}: {info.instance_type.description}")
Launch instance
from lambda_cloud_client.models import LaunchInstanceRequest
request = LaunchInstanceRequest(
region_name="us-west-1",
instance_type_name="gpu_1x_h100_sxm5",
ssh_key_names=["my-ssh-key"],
file_system_names=["my-filesystem"],
name="training-job"
)
response = api.launch_instance(request)
instance_id = response.data.instance_ids[0]
print(f"Launched: {instance_id}")
List running instances
instances = api.list_instances()
for instance in instances.data:
print(f"{instance.name}: {instance.ip} ({instance.status})")
Terminate instance
from lambda_cloud_client.models import TerminateInstanceRequest
request = TerminateInstanceRequest(
instance_ids=[instance_id]
)
api.terminate_instance(request)
SSH key management
from lambda_cloud_client.models import AddSshKeyRequest
request = AddSshKeyRequest(
name="my-key",
public_key="ssh-rsa AAAA..."
)
api.add_ssh_key(request)
keys = api.list_ssh_keys()
api.delete_ssh_key(key_id)
CLI with curl
List instance types
curl -u $LAMBDA_API_KEY: \
https://cloud.lambdalabs.com/api/v1/instance-types | jq
Launch instance
curl -u $LAMBDA_API_KEY: \
-X POST https://cloud.lambdalabs.com/api/v1/instance-operations/launch \
-H "Content-Type: application/json" \
-d '{
"region_name": "us-west-1",
"instance_type_name": "gpu_1x_h100_sxm5",
"ssh_key_names": ["my-key"]
}' | jq
Terminate instance
curl -u $LAMBDA_API_KEY: \
-X POST https://cloud.lambdalabs.com/api/v1/instance-operations/terminate \
-H "Content-Type: application/json" \
-d '{"instance_ids": ["<INSTANCE-ID>"]}' | jq
Persistent storage
Filesystems
Filesystems persist data across instance restarts:
/lambda/nfs/<FILESYSTEM_NAME>
python train.py --checkpoint-dir /lambda/nfs/my-storage/checkpoints
Create filesystem
- Go to Storage in Lambda console
- Click "Create filesystem"
- Select region (must match instance region)
- Name and create
Attach to instance
Filesystems must be attached at instance launch time:
- Via console: Select filesystem when launching
- Via API: Include
file_system_names in launch request
Best practices
/lambda/nfs/storage/
โโโ datasets/
โโโ checkpoints/
โโโ models/
โโโ outputs/
/home/ubuntu/
โโโ working/
SSH configuration
Add SSH key
ssh-keygen -t ed25519 -f ~/.ssh/lambda_key
Multiple keys
echo 'ssh-rsa AAAA...' >> ~/.ssh/authorized_keys
Import from GitHub
ssh-import-id gh:username
SSH tunneling
ssh -L 8888:localhost:8888 ubuntu@<IP>
ssh -L 6006:localhost:6006 ubuntu@<IP>
ssh -L 8888:localhost:8888 -L 6006:localhost:6006 ubuntu@<IP>
JupyterLab
Launch from console
- Go to Instances page
- Click "Launch" in Cloud IDE column
- JupyterLab opens in browser
Manual access
jupyter lab --ip=0.0.0.0 --port