Scheduled jobs of batch processing tasks for your AI workflows.
bl create-job
.
index.ts
.
Set up authentication to Blaxel
.env
file (BL_WORKSPACE
and BL_API_KEY
, or see this page for other authentication options).index.py
/ index.ts
) available on a local endpoint.
Run the following command to serve the job:
--hotreload
to get live changes.
index.ts
/ server.py
) callable on a global endpoint. When deploying to Blaxel, you get a dedicated endpoint that enforces your deployment policies.
Run the following command to build and deploy a local job on Blaxel:
Example of using this API in TypeScript
blaxel.toml
configuration file down below.
bl serve
and bl deploy
commands.
scripts
are not required. With TypeScript, all 4 of them are used.
start
: start the job locally through the TypeScript command, to avoid having to build the project when developing.prod
: start the job remotely from the dist folder, the project needs to be have been built before.build
: build the project. It is done automatically when deploying.type
so Blaxel knows which kind of entity to deploy. Others are not mandatory but allow you to customize the deployment.
name
, workspace
, and type
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.policies
fields is also optional. It allow you to specify a Blaxel policy to customize the deployment. For example, deploy it only in a specific region of the world.[env]
section defines environment variables that the job can access via the SDK. Note that these are NOT secrets.[runtime]
section allows to override job execution parameters: maximum number of concurrent tasks, maximum number of retries for each task, timeout (in s), or memory (in MB) to allocate.