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
Blaxel will detect or read configuration to define an entrypoint when building the agent.
- TypeScript
- Python
In TypeScript, entrypoints are managed in the
scripts in the package.json file at the root of the directory.start: start the agent 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 agent 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.
package.json follow standard JavaScript/TypeScript project conventions. Feel free to add any dependencies you need, but keep in mind that devDependencies are only used during the build process and are removed afterwards.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.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.
