productivity
Lambda Labs Lua API for KosmoKrator Agents
Agent-facing Lua documentation and function reference for the Lambda Labs KosmoKrator integration.Lua Namespace
Agents call this integration through app.integrations.lambda_labs.*.
Use lua_read_doc("integrations.lambda-labs") inside KosmoKrator to discover the same reference at runtime.
Call Lua from the Headless CLI
Use kosmo integrations:lua when a shell script, CI job, cron job, or another coding CLI should run a deterministic
Lambda Labs workflow without starting an interactive agent session.
kosmo integrations:lua --eval 'dump(app.integrations.lambda_labs.list_instances({}))' --json kosmo integrations:lua --eval 'print(docs.read("lambda-labs"))' --json
kosmo integrations:lua --eval 'print(docs.read("lambda-labs.list_instances"))' --json Workflow file
Put repeatable logic in a Lua file, then execute it with JSON output for the calling process.
local lambda_labs = app.integrations.lambda_labs
local result = lambda_labs.list_instances({})
dump(result) kosmo integrations:lua workflow.lua --json
kosmo integrations:lua workflow.lua --force --json integrations:lua exposes app.integrations.lambda_labs, app.mcp.*, docs.*, json.*, and regex.*. Use app.integrations.lambda_labs.default.* or app.integrations.lambda_labs.work.* when you configured named credential accounts.
MCP-only Lua
If the script only needs configured MCP servers and does not need Lambda Labs, use the narrower mcp:lua command.
# Use mcp:lua for MCP-only scripts; use integrations:lua for this integration namespace.
kosmo mcp:lua --eval 'dump(mcp.servers())' --json Agent-Facing Lua Docs
This is the rendered version of the full Lua documentation exposed to agents when they inspect the integration namespace.
Lambda Labs — Lua API Reference
list_instances
List all GPU instances in the Lambda Labs account.
Parameters
None.
Example
local result = app.integrations["lambda-labs"].list_instances({})
for _, instance in ipairs(result.data) do
print(instance.name .. " (" .. instance.status .. ") - " .. instance.instance_type)
end
get_instance
Get details for a specific GPU instance.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The instance ID |
Example
local result = app.integrations["lambda-labs"].get_instance({ id = "12345" })
local inst = result.data
print(inst.name .. " - " .. inst.ip .. " - " .. inst.status)
launch_instance
Launch a new GPU instance.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | A human-readable name for the instance |
region_name | string | yes | Region to launch in (e.g., "us-east-1", "us-west-2", "europe-central-1") |
instance_type | string | yes | Instance type slug (e.g., "gpu_1x_a100", "gpu_8x_h100") |
ssh_key_ids | array | yes | Array of SSH key IDs to assign |
image_id | string | no | Image ID for the instance OS |
quantity | integer | no | Number of instances to launch (default: 1) |
Common Region Names
us-east-1, us-west-2, europe-central-1, asia-south-1, me-west-1
Common Instance Types
gpu_1x_a100, gpu_2x_a100, gpu_4x_a100, gpu_8x_a100, gpu_1x_h100, gpu_4x_h100, gpu_8x_h100, gpu_1x_a6000, gpu_1x_rtx6000
Example
local result = app.integrations["lambda-labs"].launch_instance({
name = "gpu-training-01",
region_name = "us-east-1",
instance_type = "gpu_1x_a100",
ssh_key_ids = { "ssh_key_id_here" },
quantity = 1
})
print("Launched instance: " .. result.data[1].id)
list_ssh_keys
List all SSH keys registered in the account.
Parameters
None.
Example
local result = app.integrations["lambda-labs"].list_ssh_keys({})
for _, key in ipairs(result.data) do
print(key.name .. " (ID: " .. key.id .. ")")
end
list_instance_types
List all available GPU instance types and configurations.
Parameters
None.
Example
local result = app.integrations["lambda-labs"].list_instance_types({})
for _, itype in ipairs(result.data) do
print(itype.name .. " - " .. (itype.description or "") .. " - $" .. itype.price_per_hour .. "/hr")
end
list_images
List all available machine images (OS templates).
Parameters
None.
Example
local result = app.integrations["lambda-labs"].list_images({})
for _, image in ipairs(result.data) do
print(image.id .. " - " .. image.name)
end
get_current_user
Get the current authenticated user information.
Parameters
None.
Example
local result = app.integrations["lambda-labs"].get_current_user({})
print("User: " .. result.data.email .. " (ID: " .. result.data.id .. ")")
Multi-Account Usage
If you have multiple Lambda Labs accounts configured, use account-specific namespaces:
-- Default account (always works)
app.integrations["lambda-labs"].list_instances({})
-- Explicit default (portable across setups)
app.integrations["lambda-labs"].default.list_instances({})
-- Named accounts
app.integrations["lambda-labs"].production.list_instances({})
app.integrations["lambda-labs"].research.list_instances({})
All functions are identical across accounts — only the credentials differ.
Raw agent markdown
# Lambda Labs — Lua API Reference
## list_instances
List all GPU instances in the Lambda Labs account.
### Parameters
None.
### Example
```lua
local result = app.integrations["lambda-labs"].list_instances({})
for _, instance in ipairs(result.data) do
print(instance.name .. " (" .. instance.status .. ") - " .. instance.instance_type)
end
```
---
## get_instance
Get details for a specific GPU instance.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `id` | string | yes | The instance ID |
### Example
```lua
local result = app.integrations["lambda-labs"].get_instance({ id = "12345" })
local inst = result.data
print(inst.name .. " - " .. inst.ip .. " - " .. inst.status)
```
---
## launch_instance
Launch a new GPU instance.
### Parameters
| Name | Type | Required | Description |
|------|------|----------|-------------|
| `name` | string | yes | A human-readable name for the instance |
| `region_name` | string | yes | Region to launch in (e.g., `"us-east-1"`, `"us-west-2"`, `"europe-central-1"`) |
| `instance_type` | string | yes | Instance type slug (e.g., `"gpu_1x_a100"`, `"gpu_8x_h100"`) |
| `ssh_key_ids` | array | yes | Array of SSH key IDs to assign |
| `image_id` | string | no | Image ID for the instance OS |
| `quantity` | integer | no | Number of instances to launch (default: 1) |
### Common Region Names
`us-east-1`, `us-west-2`, `europe-central-1`, `asia-south-1`, `me-west-1`
### Common Instance Types
`gpu_1x_a100`, `gpu_2x_a100`, `gpu_4x_a100`, `gpu_8x_a100`, `gpu_1x_h100`, `gpu_4x_h100`, `gpu_8x_h100`, `gpu_1x_a6000`, `gpu_1x_rtx6000`
### Example
```lua
local result = app.integrations["lambda-labs"].launch_instance({
name = "gpu-training-01",
region_name = "us-east-1",
instance_type = "gpu_1x_a100",
ssh_key_ids = { "ssh_key_id_here" },
quantity = 1
})
print("Launched instance: " .. result.data[1].id)
```
---
## list_ssh_keys
List all SSH keys registered in the account.
### Parameters
None.
### Example
```lua
local result = app.integrations["lambda-labs"].list_ssh_keys({})
for _, key in ipairs(result.data) do
print(key.name .. " (ID: " .. key.id .. ")")
end
```
---
## list_instance_types
List all available GPU instance types and configurations.
### Parameters
None.
### Example
```lua
local result = app.integrations["lambda-labs"].list_instance_types({})
for _, itype in ipairs(result.data) do
print(itype.name .. " - " .. (itype.description or "") .. " - $" .. itype.price_per_hour .. "/hr")
end
```
---
## list_images
List all available machine images (OS templates).
### Parameters
None.
### Example
```lua
local result = app.integrations["lambda-labs"].list_images({})
for _, image in ipairs(result.data) do
print(image.id .. " - " .. image.name)
end
```
---
## get_current_user
Get the current authenticated user information.
### Parameters
None.
### Example
```lua
local result = app.integrations["lambda-labs"].get_current_user({})
print("User: " .. result.data.email .. " (ID: " .. result.data.id .. ")")
```
---
## Multi-Account Usage
If you have multiple Lambda Labs accounts configured, use account-specific namespaces:
```lua
-- Default account (always works)
app.integrations["lambda-labs"].list_instances({})
-- Explicit default (portable across setups)
app.integrations["lambda-labs"].default.list_instances({})
-- Named accounts
app.integrations["lambda-labs"].production.list_instances({})
app.integrations["lambda-labs"].research.list_instances({})
```
All functions are identical across accounts — only the credentials differ. local result = app.integrations.lambda_labs.list_instances({})
print(result) Functions
list_instances Read
List all GPU instances in the Lambda Labs account. Returns instance IDs, names, status, IP addresses, and GPU configuration.
- Lua path
app.integrations.lambda_labs.list_instances- Full name
lambda-labs.lambda_labs_list_instances
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_instance Read
Get details for a specific Lambda Labs GPU instance by ID. Returns full instance information including status, IP, region, and GPU type.
- Lua path
app.integrations.lambda_labs.get_instance- Full name
lambda-labs.lambda_labs_get_instance
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | yes | The instance ID. |
launch_instance Write
Launch a new GPU instance on Lambda Labs. Requires a region name, instance type, SSH key IDs, and optionally a name and image.
- Lua path
app.integrations.lambda_labs.launch_instance- Full name
lambda-labs.lambda_labs_launch_instance
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | A human-readable name for the instance (e.g., "gpu-training-01"). |
region_name | string | yes | The region to launch in (e.g., "us-east-1", "us-west-2", "europe-central-1"). |
instance_type | string | yes | The instance type slug (e.g., "gpu_1x_a100", "gpu_8x_h100"). |
ssh_key_ids | array | yes | Array of SSH key IDs to assign to the instance. |
image_id | string | no | The image ID to use for the instance OS. |
quantity | integer | no | Number of instances to launch (default: 1). |
list_ssh_keys Read
List all SSH keys registered in the Lambda Labs account. Returns key IDs, names, and public key fingerprints.
- Lua path
app.integrations.lambda_labs.list_ssh_keys- Full name
lambda-labs.lambda_labs_list_ssh_keys
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_instance_types Read
List all available GPU instance types on Lambda Labs. Returns specs including GPU model, VRAM, vCPUs, memory, and pricing.
- Lua path
app.integrations.lambda_labs.list_instance_types- Full name
lambda-labs.lambda_labs_list_instance_types
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
list_images Read
List all available machine images on Lambda Labs. Returns image IDs, names, and descriptions for OS templates and custom images.
- Lua path
app.integrations.lambda_labs.list_images- Full name
lambda-labs.lambda_labs_list_images
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
get_current_user Read
Get information about the current authenticated Lambda Labs user, including email, user ID, and account status.
- Lua path
app.integrations.lambda_labs.get_current_user- Full name
lambda-labs.lambda_labs_get_current_user
| Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||