RepoBasetenBasetenpublished Mar 12, 2026seen 5d

basetenlabs/action-truss-push

Python

Open original ↗

Captured source

source ↗
published Mar 12, 2026seen 5dcaptured 16hhttp 200method plain

basetenlabs/action-truss-push

Description: GitHub Action for deploying trusses

Language: Python

License: MIT

Stars: 1

Forks: 1

Open issues: 1

Created: 2026-03-12T05:17:10Z

Pushed: 2026-04-15T21:39:44Z

Default branch: main

Fork: no

Archived: no

README:

Truss Push Action

This action deploys a Truss model or chain to Baseten. It pushes the deployment, waits for it to become active, and optionally validates it with a predict request.

Models are detected when truss-directory points to a directory containing config.yaml. Chains are detected when truss-directory points to a .py file containing a @chains.mark_entrypoint class.

Usage

Model

- uses: basetenlabs/action-truss-push@v0.1
with:
truss-directory: "./my-model"
baseten-api-key: ${{ secrets.BASETEN_API_KEY }}

Chain

- uses: basetenlabs/action-truss-push@v0.1
with:
truss-directory: "./my_chain.py"
baseten-api-key: ${{ secrets.BASETEN_API_KEY }}
predict-payload: '{"max_value": 5}'

Inputs

- uses: basetenlabs/action-truss-push@v0.1
with:
# Path to a model directory containing config.yaml,
# or a .py file for chain deployments
# Required
truss-directory: ""

# Baseten API key
# Required
baseten-api-key: ""

# Override the model/chain name
# For models: maps to truss push --model-name
# For chains: sets the chain_name
# Default: '' (uses model_name from config.yaml, or entrypoint class name for chains)
model-name: ""

# Deploy to a specific environment (implies publish)
# Default: '' (no environment)
environment: ""

# Attach git versioning info (sha, branch, tag) to the deployment
# Default: true
include-git-info: ""

# JSON string of labels as key-value pairs
# Default: ''
labels: ""

# Name of the deployment. Defaults to 'PR-_' on pull
# requests or '' otherwise
# Default: '' (auto-generated)
deployment-name: ""

# Whether to deactivate the deployment after validation
# Default: true
cleanup: ""

# JSON predict payload. For models, defaults to
# model_metadata.example_model_input from config.yaml.
# For chains, must be provided explicitly.
# Default: ''
predict-payload: ""

# Max minutes to wait for deployment to become active
# Default: 45
deploy-timeout-minutes: ""

# Timeout in seconds for predict request
# Default: 300
predict-timeout: ""

# Use regional endpoint format for predict requests. Set to true when
# deploying to a regional environment that requires regional routing.
# Requires `environment` to also be set.
# Default: false
regional-environment: ""

# Baseten team name to deploy to. Required when the API key has access to
# multiple teams.
# Default: '' (uses the default team)
team: ""

Scenarios

  • [Deploy a chain](#deploy-a-chain)
  • [Deploy a model without cleanup](#deploy-a-model-without-cleanup)
  • [Deploy with a custom predict payload](#deploy-with-a-custom-predict-payload)
  • [Deploy to a specific environment](#deploy-to-a-specific-environment)
  • [Deploy to a regional environment](#deploy-to-a-regional-environment)
  • [Deploy with labels](#deploy-with-labels)
  • [Run in CI on pull requests](#run-in-ci-on-pull-requests)
  • [Deploy multiple models](#deploy-multiple-models)

Deploy a chain

Deploy a Baseten chain from a Python source file. The action auto-detects chains when the path ends in .py.

- uses: basetenlabs/action-truss-push@v0.1
with:
truss-directory: "./chains/my_chain.py"
baseten-api-key: ${{ secrets.BASETEN_API_KEY }}
model-name: "my-rag-chain"
cleanup: false
predict-payload: '{"query": "What is Baseten?"}'

Deploy a model without cleanup

Keep the deployment running after validation for further inspection or manual promotion.

- uses: basetenlabs/action-truss-push@v0.1
with:
truss-directory: "./my-model"
baseten-api-key: ${{ secrets.BASETEN_API_KEY }}
cleanup: false

Deploy with a custom predict payload

Override the example input defined in config.yaml with an inline JSON payload.

- uses: basetenlabs/action-truss-push@v0.1
with:
truss-directory: "./my-model"
baseten-api-key: ${{ secrets.BASETEN_API_KEY }}
predict-payload: '{"prompt": "Hello, world!", "max_new_tokens": 128}'
predict-timeout: 60

Deploy to a specific environment

Push to a named environment (e.g., staging).

- uses: basetenlabs/action-truss-push@v0.1
with:
truss-directory: "./my-model"
baseten-api-key: ${{ secrets.BASETEN_API_KEY }}
environment: "staging"
cleanup: false

Deploy to a regional environment

If your environment is a regional environment that requires regional routing, set regional-environment: true so the predict validation request uses the regional endpoint format (model-{id}-{env}.api.baseten.co/predict) instead of the deployment endpoint.

- uses: basetenlabs/action-truss-push@v0.1
with:
truss-directory: "./my-model"
baseten-api-key: ${{ secrets.BASETEN_API_KEY }}
environment: "prod-us"
regional-environment: true

Deploy with labels

Attach metadata labels to track deployments in your CI pipeline.

- uses: basetenlabs/action-truss-push@v0.1
with:
truss-directory: "./my-model"
baseten-api-key: ${{ secrets.BASETEN_API_KEY }}
labels: '{"team": "ml-platform", "triggered-by": "ci"}'

Run in CI on pull requests

Validate model changes on every pull request without promoting to production.

name: Validate model

on:
pull_request:
branches: [main]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: basetenlabs/action-truss-push@v0.1
with:
truss-directory: "./my-model"
baseten-api-key: ${{ secrets.BASETEN_API_KEY }}
cleanup: true

Deploy multiple models

Deploy several models in parallel using a matrix strategy.

name: Deploy models

on:
push:
branches: [main]

jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
model:
- path: llm/gpt-oss-20b/latency
- path: video/stable-diffusion/quality
steps:
- uses: actions/checkout@v4

- uses: basetenlabs/action-truss-push@v0.1
with:
truss-directory: ${{ matrix.model.path }}
baseten-api-key: ${{ secrets.BASETEN_API_KEY }}
cleanup: false

Recommended secrets configuration

Store your Baseten API key as an encrypted secret in your repository or organization. Never hardcode it in your workflow…

Excerpt shown — open the source for the full document.

Notability

notability 2.0/10

New repo, only 1 star, low impact.