GPU Compute / Integrations
GitHub Actions
Run GPU jobs and serve model endpoints directly from your CI/CD pipeline. Badgr provides two composite actions: badgr-run for one-off jobs and badgr-serve for persistent endpoints.
Prerequisites
Add your Badgr API key as a repository secret named BADGR_API_KEY:
- Go to your repository Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
BADGR_API_KEY, Value: your Badgr API key
Run a GPU job
Use badgr-run to run any container command on a GPU. The action waits for completion and streams logs to the workflow output.
- name: Run training job
uses: badgr/badgr-run@v1
with:
api_key: ${{ secrets.BADGR_API_KEY }}
gpu: A100
command: python train.py --epochs 10
max_cost: "10"The action uses the checked-out repo as the source (equivalent to badgr run . --cmd "..."). No Docker build required.
Serve a model endpoint
Use badgr-serve to provision an OpenAI-compatible endpoint for the duration of your workflow. The endpoint tears down automatically when the job finishes.
- name: Serve model
id: serve
uses: badgr/badgr-serve@v1
with:
api_key: ${{ secrets.BADGR_API_KEY }}
model: Qwen/Qwen2.5-7B-Instruct
gpu: L40S
- name: Run evals
run: python eval.py --base-url ${{ steps.serve.outputs.endpoint_url }}Full workflow example
name: GPU Training
on:
push:
branches: [main]
jobs:
train:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run training job
uses: badgr/badgr-run@v1
with:
api_key: ${{ secrets.BADGR_API_KEY }}
gpu: A100
command: python train.py --epochs 10
max_cost: "20"
timeout_minutes: 120Badgr uploads the checked-out repo, installs deps, runs the command, and streams logs to the workflow. No Docker build step needed.
badgr-run inputs
api_keyrequiredBadgr API key — use secrets.BADGR_API_KEYgpuRTX_4090GPU type (RTX_4090, L40S, A6000, A100, H100)command—Command to run, e.g. python train.pyimagepython:3.11-slimDocker imagegpu_count1Number of GPUs (1–8)region—Optional region preference. If omitted, Badgr chooses best available capacity.max_price_per_hour—Hard hourly cap — job won't start if no GPU is under this pricemax_cost—Auto-stop when total spend reaches this amount (USD)waittrueWait for completion and stream logstimeout_minutes60Max minutes to wait before the action failsbadgr-serve inputs
api_keyrequiredBadgr API key — use secrets.BADGR_API_KEYmodelrequiredHugging Face model IDgpuL40SGPU type (RTX_4090, L40S, A6000, A100, H100)gpu_count1Number of GPUs (1–8)region—Optional region preference. If omitted, Badgr chooses best available capacity.max_price_per_hour—Hard hourly cap — endpoint won't start if no GPU is under this pricemax_cost—Auto-stop endpoint when total spend reaches this amount (USD)teardowntrueTear down endpoint when workflow finishes