Deploy an agent with Blaxel CLI
This section assumes you have developed an agent locally, as presented in this documentation, and are ready to deploy it. Blaxel SDK provides methods to programmatically access and integrate various resources hosted on Blaxel into your agent’s code, such as: model APIs, tool servers, sandboxes, batch jobs, or other agents. The SDK handles authentication, secure connection management and telemetry automatically. This packaging makes Blaxel fully agnostic of the framework used to develop your agent and doesn’t prevent you from deploying your software on another platform.Read this guide first on how to leverage the Blaxel SDK when developing a custom agent to deploy.
Serve locally
You can serve the agent locally in order to make the entrypoint function (by default:main.py
/ main.ts
) available on a local endpoint.
Run the following command to serve the agent:
--hotreload
to get live changes.
Deploy on production
You can deploy the agent in order to make the entrypoint function (by default:main.py
/ main.ts
) callable on a global endpoint. When deploying to Blaxel, your workloads are served optimally to dramatically accelerate cold-start and latency while enforcing your deployment policies.
Run the following command to build and deploy a local agent on Blaxel:
When making a deployment using Blaxel CLI (
bl deploy
), the new traffic routing depends on the --traffic
option. Without this option specified, Blaxel will automatically deploy the new revision with full traffic (100%) if the previous deployment was the latest revision. Otherwise, it will create the revision without deploying it (0% traffic).--directory
(-d
) option:
Customize an agent deployment
You can set custom parameters for an agent deployment (e.g. specify the agent name, etc.) in theblaxel.toml
file at the root of your directory.
For more information on agent deployment settings, refer to the reference section down at the bottom of this guide.
Deploy with a Dockerfile
While Blaxel uses predefined, optimized container images to build and deploy your code, you can also deploy your workload using your own Dockerfile.Deploy using Dockerfile
Deploy resources using a custom Dockerfile.
Deploy from GitHub
You can connect a GitHub repository to Blaxel to automatically deploy updates whenever changes are pushed to the main branch.Deploy from GitHub
Learn how to synchronize your GitHub repository to automatically deploy updates.
Reference for deployment life-cycle
Deploying an agent
Deploying an agent will create the associated agent deployment. At this time:- it is reachable through a specific endpoint
- it does not consume resources until it is actively being invoked and processing inferences
- its status can be monitored either on the console or using the CLI/APIs
Choosing the infrastructure generation
Blaxel offers two infrastructure generations. When deploying a workload, you can select between Mk 2 infrastructure—which provides stable, globally distributed container-based workloads—and Mk 3 (in Alpha), which delivers ultra-fast cold starts. Choose the generation that best fits your specific requirements.Maximum runtime
- Deployed agents have a runtime limit after which executions time out. This timeout duration is determined by your chosen infrastructure generation. For Mk 2 generation, the maximum timeout is 10 minutes.
Managing revisions
As you iterate on software development, you will need to update the version of an agent that is currently deployed and used by your consumers. Every time you build a new version of your agent, this creates a revision. Blaxel stores the 10 latest revisions for each object.
- rollback a deployment to its exact state from an earlier date
- create a revision without immediate deployment to prepare for a future release
- implement progressive rollout strategies, such as canary deployments

When making a deployment using Blaxel CLI (
bl deploy
), the new traffic routing depends on the --traffic
option. Without this option specified, Blaxel will automatically deploy the new revision with full traffic (100%) if the previous deployment was the latest revision. Otherwise, it will create the revision without deploying it (0% traffic).Executions and inference requests
Executions (a.k.a inference executions) are ephemeral invocations of agent deployments by a consumer. Because Blaxel is serverless, an agent deployment is only materialized onto one of the execution locations when it actively receives and processes requests. Workload placement and request routing is fully managed by the Global Agentics Network, as defined by your environment policies. Read more about querying agents in this documentation.Deactivating an agent deployment
Any agent deployment can be deactivated at any time. When deactivated, it will no longer be reachable through the inference endpoint and will stop consuming resources. Agents can be deactivated and activated at any time from the Blaxel console, or via API or CLI.Agent deployment reference
The agent deployment can be configured via the blaxel.toml file in your agent directory. This file is used to configure the deployment of the agent on Blaxel. The only mandatory parameter is thetype
so Blaxel knows which kind of entity to deploy. Others are not mandatory but allow you to customize the deployment.
name
,workspace
, andtype
fields are optional and serve as default values. Any bl command run in the folder will use these defaults rather than prompting you for input.agents
,functions
, andmodels
fields are also optional. They specify which resources to deploy with the agent. These resources are preloaded during build, eliminating runtime dependencies on the Blaxel control plane and dramatically improving performance.[env]
section defines environment variables that the agent can access via the SDK. Note that these are NOT secrets.[runtime]
section allows to override agent deployment parameters: timeout (in s) or memory (in MB) to allocate.[[triggers]]
and[triggers.configuration]
sections defines ways to send requests to the agent. You can create both synchronous and asynchronous trigger endpoints (respectivelytype = "http"
ortype = "http-async"
). You can also make them either private (default) or public (authenticationType = "public"
). A private synchronous HTTP endpoint is always created by default, even if you don’t define any trigger here.
Deployment manifests (advanced usage)
Whenbl deploy
runs, it generates a YAML configuration manifest automatically and deploys it to Blaxel’s hosting infrastructure. You can also create custom manifest files in the .blaxel
folder and deploy them using the following command:
Troubleshooting
Wrong port or host
BL_SERVER_HOST
& BL_SERVER_PORT
. Blaxel automatically injects these variables during deployment.
Query agents
Learn how to run consumers’ inference requests on your agent.