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 10Serve 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: meta-llama/Llama-3.1-8B-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
image: pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime
command: python train.py --epochs 10
timeout_minutes: 120badgr-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 price cap in USD/hrwaittrueWait for completion and stream logstimeout_minutes60Max minutes to waitbadgr-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 price cap in USD/hrteardowntrueTear down endpoint when workflow finishes