1. Create configuration files
At the root of your project repository, create ablaxel.toml file for configuration, 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 of what you do, all of the scripts are not required. With TypeScript, all 4 of them are used.
start: start the server locally through the TypeScript command, to avoid having to build the project when developing.build: build the project. It is done automatically when deploying.prod: start the server remotely from the dist folder, the project needs to be have been built before.dev: same as start, but with hotreload. It’s useful when developing locally, each file change is reflected immediately.
4. (Optional) Enable telemetry
Instrumentation happens automatically when workloads run on Blaxel. To enable telemetry, simply import the SDK in your project’s entry point. For TypeScript: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.
