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:

  1. Go to your repository Settings → Secrets and variables → Actions
  2. Click New repository secret
  3. 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

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: 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: 120

badgr-run inputs

api_keyrequiredBadgr API key — use secrets.BADGR_API_KEY
gpuRTX_4090GPU type (RTX_4090, L40S, A6000, A100, H100)
commandCommand to run, e.g. python train.py
imagepython:3.11-slimDocker image
gpu_count1Number of GPUs (1–8)
regionOptional region preference. If omitted, Badgr chooses best available capacity.
max_price_per_hourHard price cap in USD/hr
waittrueWait for completion and stream logs
timeout_minutes60Max minutes to wait

badgr-serve inputs

api_keyrequiredBadgr API key — use secrets.BADGR_API_KEY
modelrequiredHugging Face model ID
gpuL40SGPU type (RTX_4090, L40S, A6000, A100, H100)
gpu_count1Number of GPUs (1–8)
regionOptional region preference. If omitted, Badgr chooses best available capacity.
max_price_per_hourHard price cap in USD/hr
teardowntrueTear down endpoint when workflow finishes