Skip to main content
Deploy agents to RunAgent cloud infrastructure for production use with automatic scaling, monitoring, and global availability.

Prerequisites

Before deploying to the cloud, you need:
  1. RunAgent Account - Sign up at run-agent.ai
  2. API Key - Get your API key from the dashboard
  3. Configured CLI - Authenticate your CLI with your API key

Authentication Setup

Configure your CLI with your API key:
The setup command will:
  • Validate your API key with the RunAgent middleware
  • Store credentials securely in ~/.runagent/config.json
  • Display your account information and tier
  • Show middleware sync status

Teardown Configuration

Remove stored credentials:

Deployment Methods

Method 1: Quick Deploy (Upload + Start)

Deploy your agent in a single command:
This command will:
  1. Validate your agent configuration
  2. Upload agent code and metadata to the cloud
  3. Start the agent automatically
  4. Return the deployment endpoint
Output:

Method 2: Two-Step Deploy (Upload Then Start)

For more control, upload and start separately:

Step 1: Upload Agent

Upload Process:
  1. Agent validation (checks for required files)
  2. Fingerprint generation (for duplicate detection)
  3. Metadata upload (config + entrypoints)
  4. Source code packaging and upload
  5. Local database tracking
Output:

Step 2: Start Agent

Output:

Agent Configuration

Agent ID and Entrypoints

When you initialize a new agent with runagent init, it automatically:
  1. Generates a unique agent ID and adds it to runagent.config.json
  2. Creates a basic configuration with framework and template settings
Important: You must add your entrypoints to the configuration file before deploying.
Example runagent.config.json after init:
Add your entrypoints:

Manually Editing Agent ID

If you manually edit the agent_id in runagent.config.json, you must register the agent:
Important: If you manually change the agent_id in your config file, RunAgent won’t recognize it until you register it. Always run runagent register . after manually editing the agent ID.

Agent Validation

Before upload, RunAgent validates your agent:

Required Files

  • runagent.config.json - Agent configuration with valid agent_id and entrypoints
  • main.py or agent.py - Entry point file
  • requirements.txt - Python dependencies (optional)

Validation Checks

  • βœ… Configuration file exists and is valid JSON
  • βœ… Agent ID exists in configuration
  • βœ… Agent ID is registered (if manually edited)
  • βœ… Entry point file exists
  • βœ… Entrypoints are properly defined
  • βœ… Framework is supported
  • βœ… No syntax errors in configuration
Example Valid Configuration:

Duplicate Detection

RunAgent uses fingerprinting to detect duplicate agents:

How It Works

  1. Fingerprint Generation: Creates a unique hash of your agent’s content
  2. Duplicate Check: Compares with existing agents in your account
  3. User Prompt: If duplicate found, asks whether to overwrite or create new
Example Scenarios: Scenario 1: Identical Content
Scenario 2: Modified Content

Running Cloud Agents

Execute your deployed agents:

Basic Execution

Using Input Files

Example input.json:

Streaming Execution

For streaming entrypoints (must end with _stream):
Important: Use runagent run-stream (not runagent run) for streaming execution. The run-stream command uses WebSocket connections for real-time streaming.

Cloud vs Local Deployment

Deployment Workflow

Complete Example

CI/CD Integration

GitHub Actions

GitLab CI

Monitoring and Management

View Agent Status

Local Deployment Info

Deployment information is saved locally in .deployments/:

Troubleshooting

Authentication Errors

Error: Not authenticated. Run 'runagent setup --api-key <key>' first Solution:

Upload Failures

Error: Agent validation failed Solution:
  1. Check that runagent.config.json exists and is valid
  2. Verify entry point file exists (main.py or agent.py)
  3. Ensure all required dependencies are in requirements.txt
  4. Run runagent serve locally to test first
Error: Failed to upload agent: HTTP 413 Solution: Your agent folder is too large. Remove unnecessary files:
  • Remove __pycache__ directories
  • Remove .pyc files
  • Remove large data files (use cloud storage instead)
  • Add .gitignore patterns to exclude files

Deployment Fails But Upload Succeeds

Error: Upload succeeded but start failed Solution:

Connection Issues

Error: Cannot connect to middleware server Solution:
  1. Check your internet connection
  2. Verify the base URL is correct
  3. Check if middleware server is accessible
  4. Try with explicit base URL: runagent setup --api-key <key> --base-url https://api.run-agent.ai

Best Practices

1. Test Locally First

Always test your agent locally before deploying:

2. Version Control

Include deployment info in version control:

3. Environment Variables

Use environment variables for sensitive data:
Set them before deploying:

4. Incremental Updates

For agent updates:

5. Monitor Performance

After deployment:
  • Test all entrypoints
  • Check response times
  • Verify outputs are correct
  • Monitor error rates

Security

API Key Management

Best Practices:
  • βœ… Store API keys in environment variables
  • βœ… Use different keys for development and production
  • βœ… Rotate keys regularly
  • βœ… Never commit API keys to version control
  • ❌ Don’t share API keys
  • ❌ Don’t hardcode keys in agent code

Secure Deployment

Limits and Quotas

Free Tier

  • 5 local agents
  • Cloud deployment available
  • Standard execution limits

Enhanced Limits

Contact sales for:
  • Unlimited local agents
  • Higher execution limits
  • Priority support
  • Custom SLAs
Check your current limits:

Next Steps

Support

Need help with cloud deployment?