The Celesto CLI provides fast, serverless deployment for Agentor agents, MCP servers, and AI applications with built-in observability and scalability.
Installation
The Celesto CLI is installed automatically with Agentor:
Verify installation:
Quick Start
Deploy an agent in three steps:
# main.py
from agentor import Agentor
agent = Agentor(
name="Weather Agent",
model="gpt-5-mini",
tools=["get_weather"],
instructions="You are a helpful weather assistant."
)
agent.serve(port=8000)
Create a celesto.yaml file (optional):
name: weather-agent
runtime: python3.11
entry_point: main.py
env_vars:
OPENAI_API_KEY: ${OPENAI_API_KEY}
Your agent is now live at:
https://api.celesto.ai/deploy/apps/weather-agent
Authentication
Get your API key from the Celesto Dashboard.
Set it as an environment variable:
export CELESTO_API_KEY="your-api-key"
Or configure it directly:
celesto auth login --api-key your-api-key
Deployment Options
Deploy Specific Directory
celesto deploy --folder ./my-agent
Deploy with Custom Name
celesto deploy --name production-agent
Deploy with Environment Variables
celesto deploy --env OPENAI_API_KEY=sk-xxx --env DEBUG=true
Deploy MCP Server
# mcp_server.py
from agentor.mcp import LiteMCP
mcp = LiteMCP(name="my-mcp-server", version="1.0.0")
@mcp.tool(description="Get weather")
def get_weather(location: str) -> str:
return f"Weather in {location}: Sunny, 72°F"
if __name__ == "__main__":
mcp.serve(port=8000)
Deploy:
Access at:
https://api.celesto.ai/deploy/apps/my-mcp-server/mcp
Configuration File
Create celesto.yaml for advanced configuration:
# Application name (defaults to directory name)
name: my-agent
# Python runtime version
runtime: python3.11
# Entry point file
entry_point: main.py
# Environment variables
env_vars:
OPENAI_API_KEY: ${OPENAI_API_KEY}
MODEL: gpt-5-mini
DEBUG: false
# Dependencies (defaults to requirements.txt)
dependencies: requirements.txt
# Region (optional)
region: us-east-1
# Scaling configuration (optional)
scaling:
min_instances: 1
max_instances: 10
target_cpu_utilization: 70
Environment Variables
From .env File
Create a .env file:
OPENAI_API_KEY=sk-xxx
ANTHROPIC_API_KEY=sk-ant-xxx
CELESTO_API_KEY=cel-xxx
Variables are automatically loaded during deployment.
From Command Line
celesto deploy --env OPENAI_API_KEY=sk-xxx --env MODEL=gpt-4o
From YAML
env_vars:
OPENAI_API_KEY: ${OPENAI_API_KEY} # From local env
MODEL: gpt-5-mini # Hardcoded
DEBUG: ${DEBUG:-false} # With default value
Managing Deployments
List Deployments
Output:
NAME STATUS URL
weather-agent running https://api.celesto.ai/deploy/apps/weather-agent
my-mcp-server running https://api.celesto.ai/deploy/apps/my-mcp-server
Get Deployment Info
celesto info weather-agent
View Logs
celesto logs weather-agent
Follow logs in real-time:
celesto logs weather-agent --follow
Update Deployment
Make changes to your code, then redeploy:
The existing deployment will be updated.
Delete Deployment
celesto delete weather-agent
Using Deployed Agents
HTTP Requests
import requests
url = "https://api.celesto.ai/deploy/apps/weather-agent/chat"
headers = {
"Authorization": f"Bearer {CELESTO_API_KEY}",
"Content-Type": "application/json"
}
response = requests.post(
url,
json={"input": "What's the weather in Paris?"},
headers=headers
)
print(response.json())
Streaming Requests
import requests
url = "https://api.celesto.ai/deploy/apps/weather-agent/chat"
headers = {
"Authorization": f"Bearer {CELESTO_API_KEY}",
"Content-Type": "application/json"
}
response = requests.post(
url,
json={"input": "Tell me a story", "stream": True},
headers=headers,
stream=True
)
for line in response.iter_lines(decode_unicode=True):
if line:
print(line, flush=True)
A2A Protocol
Access the agent card:
curl https://api.celesto.ai/deploy/apps/weather-agent/.well-known/agent-card.json
Send A2A messages:
import requests
url = "https://api.celesto.ai/deploy/apps/weather-agent/"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "message/send",
"params": {
"message": {
"parts": [
{"kind": "text", "text": "What's the weather?"}
]
}
}
}
response = requests.post(url, json=payload)
print(response.json())
MCP Protocol
Connect to deployed MCP server:
import asyncio
from agentor import Agentor
from agentor.mcp import MCPServerStreamableHttp
async def main():
mcp_url = "https://api.celesto.ai/deploy/apps/my-mcp-server/mcp"
headers = {"Authorization": f"Bearer {CELESTO_API_KEY}"}
async with MCPServerStreamableHttp(
name="Deployed MCP",
params={"url": mcp_url, "headers": headers}
) as server:
agent = Agentor(
name="Agent",
model="gpt-5-mini",
tools=[server]
)
result = await agent.arun("Use the weather tool")
print(result.final_output)
asyncio.run(main())
Production Best Practices
Use Environment Variables for Secrets
# Good
import os
agent = Agentor(
name="Agent",
model="gpt-5-mini",
api_key=os.environ.get("OPENAI_API_KEY")
)
# Bad
agent = Agentor(
name="Agent",
model="gpt-5-mini",
api_key="sk-hardcoded-key-bad" # Don't do this!
)
Use specific versions in requirements.txt:
agentor==0.1.0
requests==2.31.0
pydantic==2.5.0
Automatic tracing is enabled when CELESTO_API_KEY is set:
from agentor import Agentor
# Tracing auto-enabled with CELESTO_API_KEY
agent = Agentor(
name="Production Agent",
model="gpt-5-mini"
)
# Or explicitly enable
agent = Agentor(
name="Production Agent",
model="gpt-5-mini",
enable_tracing=True
)
from agentor.mcp import MCPServerStreamableHttp
async with MCPServerStreamableHttp(
name="Server",
params={
"url": mcp_url,
"timeout": 30 # 30 second timeout
}
) as server:
# Use server
try:
result = await agent.arun(user_input)
except Exception as e:
logger.error(f"Agent error: {e}")
# Fallback logic
from fastapi import FastAPI
from agentor import Agentor
app = FastAPI()
agent = Agentor(name="Agent", model="gpt-5-mini")
@app.get("/health")
def health():
return {"status": "healthy"}
@app.post("/chat")
async def chat(message: str):
result = await agent.arun(message)
return {"response": result.final_output}
View metrics in the Celesto dashboard:
Request latency
Error rates
Token usage
Throughput
Troubleshooting
Deployment Fails
Check logs:
Common issues:
- Missing dependencies in
requirements.txt
- Invalid environment variables
- Syntax errors in code
Application Crashes
View error logs:
celesto logs <app-name> --tail 100
Enable debug mode:
celesto deploy --env DEBUG=true
- Check model selection (lighter models are faster)
- Enable caching for MCP servers
- Review trace data for bottlenecks
Connection Timeouts
Increase timeout in client:
response = requests.post(
url,
json={"input": "query"},
timeout=60 # 60 seconds
)
Cost Optimization
- Use lighter models for simple tasks (
gpt-5-mini vs gpt-4o)
- Implement caching for repeated queries
- Set appropriate
max_tokens limits
- Monitor token usage in dashboard
Support
Get help:
Next Steps
Last modified on March 20, 2026