1. Create configuration files
At the root of your project repository, create ablaxel.toml
file and a .env
file for your sensitive environment variables.
Example blaxel.toml
:
2. Update host and port in your code
Ensure your app listens on the host and port provided by Blaxel. Update your code accordingly:3. Deploy your agent
When deploying, there are two possible scenarios:Option A: You already have a Dockerfile
Blaxel will automatically use it to build your agent. Just run:
Option B: No Dockerfile
If you don’t want to create one, add the following scripts to your package.json
:
Depending on your setup, not all scripts are required. For TypeScript projects, all four are commonly used.
start
: Runs the server locally via TypeScript without needing a build step (useful for dev).build
: Builds the project (triggered automatically during deployment).prod
: Starts the server in production from thedist
folder (requires a build first).dev
: Same asstart
, but with hot-reload for instant updates while developing.
4. (Optional) Enable telemetry
If you need telemetry, just import it in your app’s entrypoint:5. (Optional) Run locally with Blaxel CLI
If you want to run your agent locally and start using the SDK, make sure thestart
and dev
scripts are defined, then run:
Resources
Want the complete guide on developing and deploying agents on Blaxel? Check out the following resources:Give compute to your agent with the TypeScript SDK
Complete guide for using the TypeScript SDK to develop an agent using Blaxel services.
Give compute to your agent with the Python SDK
Complete guide for using the Python SDK to develop an agent using Blaxel services.
Deploy your agent code to Blaxel
Complete guide for deploying AI agents on Blaxel.
Manage environment variables
Complete guide for managing variables and secrets when deploying on Blaxel.