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 — plus a smaller Remote Execution Adapter that maps a workflow command onto the existing POST /v1/run primitive with hard cost/runtime limits (see below).

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
    max_price_per_hour: "3.00"

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_price_per_hour: "3.00"
          timeout_minutes: 120

Badgr 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_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 hourly cap — job won't start if no GPU is under this price. There is no total-spend cap input; use timeout_minutes to bound runtime.
waittrueWait for completion and stream logs
timeout_minutes60Max minutes to wait before the action fails

Remote Execution Adapter

A smaller, purpose-built adapter for running a single workflow command remotely instead of on the GitHub runner. It translates GitHub's trigger context (repository, commit, run/job IDs) into the same POST /v1/run execution primitive used by badgr run — it does not implement execution, routing, billing, or teardown itself.

- uses: aibadgr/badgr-run@v1
  with:
    command: npx playwright test
    max-cost: 2
    max-runtime: 30
    github-token: ${{ github.token }}
  env:
    BADGR_API_KEY: ${{ secrets.BADGR_API_KEY }}
commandrequiredCommand to execute remotely.
max-costrequiredHard maximum job cost in USD.
max-runtime60Hard maximum runtime in minutes.
sourcetriggering repoGitHub repository URL.
reftriggering commitExact commit SHA or ref to check out.
github-tokenGITHUB_TOKENOptional token for private repository checkout.
waittrueWait for completion and stream logs.

Outputs: BADGR_JOB_ID, BADGR_STATUS, BADGR_COST, BADGR_RUN_URL. Source: packages/badgr-run-action/.

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 hourly cap — endpoint won't start if no GPU is under this price. There is no total-spend cap input.
teardowntrueTear down endpoint when workflow finishes