Prerequisites
Before deploying to the cloud, you need:- RunAgent Account - Sign up at run-agent.ai
- API Key - Get your API key from the dashboard
- Configured CLI - Authenticate your CLI with your API key
Authentication Setup
Configure your CLI with your API key:- 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:- Validate your agent configuration
- Upload agent code and metadata to the cloud
- Start the agent automatically
- Return the deployment endpoint
Method 2: Two-Step Deploy (Upload Then Start)
For more control, upload and start separately:Step 1: Upload Agent
- Agent validation (checks for required files)
- Fingerprint generation (for duplicate detection)
- Metadata upload (config + entrypoints)
- Source code packaging and upload
- Local database tracking
Step 2: Start Agent
Agent Validation
Before upload, RunAgent validates your agent:Required Files
runagent.config.json- Agent configurationmain.pyoragent.py- Entry point filerequirements.txt- Python dependencies (optional)
Validation Checks
- ✅ Configuration file exists and is valid JSON
- ✅ Entry point file exists
- ✅ Entrypoints are properly defined
- ✅ Framework is supported
- ✅ No syntax errors in configuration
Duplicate Detection
RunAgent uses fingerprinting to detect duplicate agents:How It Works
- Fingerprint Generation: Creates a unique hash of your agent’s content
- Duplicate Check: Compares with existing agents in your account
- User Prompt: If duplicate found, asks whether to overwrite or create new
Running Cloud Agents
Execute your deployed agents:Basic Execution
Using Input Files
Streaming Execution
For streaming entrypoints (must end with_stream):
Cloud vs Local Deployment
| Feature | Local | Cloud |
|---|---|---|
| Setup | runagent serve | runagent deploy |
| Infrastructure | Your machine | RunAgent cloud |
| Scaling | Manual | Automatic |
| Uptime | While running | 24/7 |
| Monitoring | Local logs only | Full monitoring dashboard |
| URL | localhost:port | Global endpoint |
| Authentication | None | API key required |
| Cost | Free | Usage-based pricing |
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:
- Check that
runagent.config.jsonexists and is valid - Verify entry point file exists (
main.pyoragent.py) - Ensure all required dependencies are in
requirements.txt - Run
runagent servelocally to test first
Failed to upload agent: HTTP 413
Solution: Your agent folder is too large. Remove unnecessary files:
- Remove
__pycache__directories - Remove
.pycfiles - Remove large data files (use cloud storage instead)
- Add
.gitignorepatterns to exclude files
Deployment Fails But Upload Succeeds
Error:Upload succeeded but start failed
Solution:
Connection Issues
Error:Cannot connect to middleware server
Solution:
- Check your internet connection
- Verify the base URL is correct
- Check if middleware server is accessible
- 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: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
Next Steps
- Local Development - Test agents locally
- SDK Overview - Use Python SDK for deployment
- API Reference - Direct API access
- Monitoring Guide - Track agent performance