Skip to main content

Python SDK and CLI for the Celesto AI platform.

Project description

Celesto

PyPI version npm version Python License

Celesto gives AI agents their own isolated computer. Your agent can run commands, create files, and use tools without touching your machine.

pip install celesto        # Python SDK + CLI
npm install @celestoai/sdk # JavaScript/TypeScript SDK

Quick Start

Python:

from celesto import Celesto

client = Celesto()

computer = client.computers.create(cpus=2, memory=2048)
print(f"Computer ready: {computer['name']}")

result = client.computers.exec(computer["id"], "uname -a")
print(result["stdout"])

client.computers.delete(computer["id"])

JavaScript / TypeScript:

import { Celesto } from "@celestoai/sdk";

const celesto = new Celesto({ token: process.env.CELESTO_API_KEY });

const computer = await celesto.computers.create({ cpus: 2, memory: 2048 });
console.log(`Computer ready: ${computer.name}`);

const result = await celesto.computers.exec(computer.id, "uname -a");
console.log(result.stdout);

await celesto.computers.delete(computer.id);

CLI:

export CELESTO_API_KEY="your-api-key"

celesto computer create --cpus 2 --memory 2048
celesto computer run einstein "ls -la"
celesto computer ssh einstein       # interactive shell
celesto computer delete einstein

Why Celesto?

  • Fast -- computers boot in seconds
  • Isolated -- each computer is separated from your machine
  • Simple -- three API calls: create, exec, delete
  • Built for agents -- give your AI a computer it can safely use

Installation

pip install celesto

Requires Python 3.10+.

Authentication

Get your API key from celesto.ai under Settings > Security.

export CELESTO_API_KEY="your-api-key"

Or pass it directly:

client = Celesto(api_key="your-api-key")

OpenAI Agents SDK sandboxes

OpenAI agents can use Celesto as their working computer. This lets the agent read files, run commands, and create artifacts in an isolated place.

OpenAI calls this a SandboxAgent: an agent that has a separate computer for its work. Celesto supports two options:

  • Hosted Celesto computers for cloud runs.
  • Local SmolVM sandboxes for work on your own machine.
pip install "celesto[openai-agents]"  
from agents import Runner
from agents.run import RunConfig
from agents.sandbox import SandboxAgent, SandboxRunConfig
from celesto.integrations.openai_agents import (
    CelestoSandboxClient,
    CelestoSandboxClientOptions,
)

agent = SandboxAgent(
    name="Workspace analyst",
    instructions="Inspect the sandbox workspace before answering.",
)

client = CelestoSandboxClient()
session = await client.create(options=CelestoSandboxClientOptions(cpus=2, memory=2048))
try:
    async with session:
        result = await Runner.run(
            agent,
            "Run `uname -a` in the sandbox and summarize the result.",
            run_config=RunConfig(sandbox=SandboxRunConfig(session=session)),
        )
        print(result.final_output)
finally:
    await client.delete(session)

Use SmolVMSandboxClient and SmolVMSandboxClientOptions from the same module when you want the same agent flow to run on a local SmolVM sandbox.

Computers API

Create

computer = client.computers.create(cpus=2, memory=2048)
print(computer["name"])  # e.g., "einstein"

Execute commands

result = client.computers.exec(computer["id"], "apt-get update && apt-get install -y curl")
print(result["stdout"])
print(result["exit_code"])

Lifecycle

client.computers.stop(computer_id)
client.computers.start(computer_id)
client.computers.delete(computer_id)

List

result = client.computers.list()
for vm in result["computers"]:
    print(f"{vm['name']}: {vm['status']}")

CLI

Command Description
celesto computer create [--cpus N] [--memory MB] Create a computer
celesto computer list List all computers
celesto computer run <name> "command" Execute a command
celesto computer ssh <name> Interactive shell
celesto computer stop <name> Stop a computer
celesto computer start <name> Start a stopped computer
celesto computer delete <name> [--force] Delete a computer

JSON output

All commands support --json for machine-readable output:

celesto computer list --json
celesto computer create --cpus 2 --memory 2048 --json
celesto computer run einstein "uname -a" --json

Error Handling

from celesto.sdk.exceptions import (
    CelestoAuthenticationError,  # 401/403
    CelestoNotFoundError,        # 404
    CelestoValidationError,      # 400/422
    CelestoRateLimitError,       # 429 -- has retry_after attribute
    CelestoServerError,          # 5xx
    CelestoNetworkError,         # connection failures
)

Links

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

celesto-0.0.4.tar.gz (71.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

celesto-0.0.4-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

Details for the file celesto-0.0.4.tar.gz.

File metadata

  • Download URL: celesto-0.0.4.tar.gz
  • Upload date:
  • Size: 71.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for celesto-0.0.4.tar.gz
Algorithm Hash digest
SHA256 bde7048173ed1dac21d83f830de8f916d2da9ad223c5e0bf5c7b01715ee9bf02
MD5 bee88ea4eb3d736d28c8b09dabab186c
BLAKE2b-256 69e5ced27bca6c6215ab56be14b59b251bf347538e70cd1d44037d7c8c0ddf71

See more details on using hashes here.

Provenance

The following attestation bundles were made for celesto-0.0.4.tar.gz:

Publisher: release.yml on CelestoAI/sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file celesto-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: celesto-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 34.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for celesto-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7fcc0b5a7c97edffb5fefbe0b848f2ab84ece6c8b56c1065c21ff8ca81af972f
MD5 67a696e5d5a19988a814273755a64fda
BLAKE2b-256 2a771e6fac02cb5be8fcd57bafd4540a590df468b352d5957de688e07c3c05d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for celesto-0.0.4-py3-none-any.whl:

Publisher: release.yml on CelestoAI/sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page