Metadata-Version: 2.4
Name: lambda-ai-cloud-api-client
Version: 2.1.0
Summary: A client library for accessing Lambda Cloud API
Keywords: lambda,cloud,api,cli,compute,gpu
Author: Alexander van Eck
Author-email: Alexander van Eck <alexander@x-all.nl>
License-Expression: MIT
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Environment :: Console
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Internet
Requires-Dist: httpx>=0.23.0,<0.29.0
Requires-Dist: attrs>=22.2.0
Requires-Dist: python-dateutil>=2.8.0,<3
Requires-Dist: click>=8.3.1
Requires-Dist: rich>=13.9.4
Requires-Python: >=3.10
Project-URL: Changelog, https://github.com/alexandervaneck/lambda-ai-cloud-api-client/blob/main/CHANGELOG.md
Project-URL: Homepage, https://github.com/alexandervaneck/lambda-ai-cloud-api-client
Project-URL: Issues, https://github.com/alexandervaneck/lambda-ai-cloud-api-client/issues
Project-URL: Repository, https://github.com/alexandervaneck/lambda-ai-cloud-api-client
Description-Content-Type: text/markdown

# Lambda Cloud API - CLI

This project is a wrapper around the Lambda Cloud API with some additional Quality-of-Life additions.
The documentation of the API can be found here: https://docs-api.lambda.ai/api/cloud

## Installation

```bash
uv pip install lambda-ai-cloud-api-client
```

## Usage

1. Set up an API token and environment.

In your lambda.ai account go to https://cloud.lambda.ai/api-keys/cloud-api and generate a new Cloud AI Key.
Set this token as an environment variable in the terminal you've installed this project.

```bash
export LAMBDA_CLOUD_API_TOKEN=<your-token>
```
The project also accepts `LAMBDA_CLOUD_TOKEN` and `LAMBDA_API_TOKEN` if you prefer that naming.
Optionally you can set the api base url, `LAMBDA_CLOUD_BASE_URL`, the default is https://cloud.lambdalabs.com .

2. Using the CLI

To save on keystrokes I've named the command `lai` for lambda.ai. To see all available commands use:

```bash
lai --help
```

## Overview of features

- List instances: `lai ls`
- Get instance details: `lai get <instance-id>`
- Start an instance: `lai start --region us-east-1 --instance-type gpu_1x_a10 --ssh-key my-key --name demo`
- SSH into an instance by name or id (waits for IP and SSH availability): `lai ssh <name-or-id>`
- Stop instances: `lai stop <id-1> <id-2>`
- Restart instances: `lai restart <id-1> <id-2>`
- Rename an instance: `lai rename <instance-id> new-name`
- List instance types: `lai types --available --cheapest --region us-east-1`
  - --available shows only those instance types that are currently available
  - --cheapest finds the instance-type that is currently the cheapest $ per hour.
- List available images: `lai images --region us-east-1`
- List SSH keys: `lai keys`
