Table of Contents
- Overview
- Prerequisites
- Step 1: Integrate SDK into Your Agent
- Step 2: Generate Configuration Files with CLI
- Step 3: Deploy to Novita with One-Click
- Step 4: 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 CLI
- ✅ Deploy Agent - One-click deployment to the cloud
- ✅ Invoke Agent - Call your Agent using 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
Step 1: Integrate SDK into Your Agent
1.1 Create Agent Code
Createapp.py in your project directory:
1.2 Prepare Dependencies File
Ensure your project root has arequirements.txt file with the required dependencies:
1.3 Local Testing
Test locally before deployment:Step 2: Generate Configuration Files with CLI
Use CLI to interactively configure your Agent:novita.Dockerfile- Docker build file.dockerignore- Docker ignore file.novita-agent.yaml- Agent configuration file
Step 3: Deploy to Novita AI with One-click
⚠️ Important: After successful deployment, an agent_id will be generated. This is the unique identifier for invoking your Agent—make sure to save it.
3.1 Deploy Command
Deploy with one-click using CLI:3.2 View Deployment Results
After successful deployment, the.novita-agent.yaml file will update the status field:
agent_id—you’ll need it for subsequent invocations.
Step 4: Invoke Agent via CLI or SDK
Option 1: Quick Test with CLI
Quickly test your Agent using 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 sandbox instance
- Dependency package version inconsistencies
- File path issues
envVars parameter: