Table of Contents
- Overview
- Prerequisites
- Integrate SDK into Your Agent
- Generate Configuration Files with CLI
- Deploy to Novita AI with One-click
- Invoke Agent via CLI or SDK
- FAQ
Overview
The complete workflow consists of 4 steps:- ✅ Integrate SDK - Add decorators to your Agent code
- ✅ Configure Agent - Generate configuration files using the CLI
- ✅ Deploy Agent - One-click deployment to the cloud
- ✅ Invoke Agent - Call your Agent using the SDK or CLI
Prerequisites
Ensure you have the following prerequisites:- ✅ Python 3.9+ and Node.js 20+ installed
- ✅ Beta version Python SDK and Node.js CLI installed (see Installation Guide)
- ✅ Novita AI API Key obtained (from the Console)
- ✅ Docker installed
Integrate SDK into Your Agent
1
Create Agent Code
Create
app.py in your project directory:2
Prepare Dependencies File
Ensure your project root has a
requirements.txt file with the required dependencies:3
Local Testing
Test locally before deployment:In another terminal, test the endpoints:Expected output:Health check should return:Agent invocation should return:
Generate Configuration Files with CLI
Use the CLI to interactively configure your Agent:novita.Dockerfile- Docker build file.dockerignore- Docker ignore file.novita-agent.yaml- Agent configuration file
Deploy to Novita AI with One-click
⚠️ Important: After successful deployment, an agent_id is generated. This is the unique identifier for invoking your Agent—make sure to save it.
1
Deploy Command
Deploy with one click using the CLI:
2
View Deployment Results
After successful deployment, the Record the
.novita-agent.yaml file updates the status field:agent_id—you’ll need it for subsequent invocations.Invoke Agent via CLI or SDK
Option 1: Quick Test with CLI
Quickly test your Agent using the CLI:status.agent_id field in .novita-agent.yaml.
Expected output:
Option 2: SDK Invocation (Recommended for Production)
Use the SDK to invoke your Agent in backend services:Example Code
FAQ
Q1: How do I get the Agent ID?
After successful deployment, the Agent ID is saved in thestatus.agent_id field of the .novita-agent.yaml file:
Q2: What if deployment fails?
- Check dependencies file: Ensure
requirements.txtcontains all dependencies - View detailed logs: Use the
--verboseflag - Check network connection: Ensure you can access the Novita AI Sandbox domain (e.g.,
sandbox.novita.ai) - Verify API Key: Confirm
NOVITA_API_KEYis correct
Q3: How do I update a deployed Agent?
Modify your code and redeploy:Q4: Works locally but fails after deployment?
Possible causes:- Environment variables not passed to the sandbox instance
- Dependency package version inconsistencies
- File path issues
envVars parameter: