Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/monitor_databricks_pricing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Monitor Databricks Pricing

# Runs on the leecoder/litellm fork on a daily schedule. When the official
# Databricks pricing pages drift from the registry, the monitor opens a PR
# against the upstream repo (BerriAI/litellm) from a fork branch.
on:
schedule:
- cron: "0 2 * * *" # daily 02:00 UTC
workflow_dispatch:

permissions:
contents: write

env:
FORK_REPO: leecoder/litellm
UPSTREAM_REPO: BerriAI/litellm
UPSTREAM_BASE: litellm_internal_staging

jobs:
monitor-db-pricing:
# Upstream runs the same checkout on schedule; skip there so only the
# fork drives the monitor. Manual dispatch still works on upstream.
if: github.repository == 'leecoder/litellm' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
persist-credentials: false
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
fetch-depth: 0
repository: ${{ env.UPSTREAM_REPO }}
ref: ${{ env.UPSTREAM_BASE }}

- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: "3.12"

- name: Run monitor
id: monitor
shell: bash
Comment thread
leecoder marked this conversation as resolved.
Resolved
run: |
set -o pipefail
python scripts/monitor_databricks_pricing.py | tee /tmp/monitor_out.txt
if grep -q '^NO_CHANGE' /tmp/monitor_out.txt; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi

- name: Open PR on upstream if changed
if: steps.monitor.outputs.changed == 'true'
env:
GH_TOKEN: ${{ secrets.DBX_MONITOR_TOKEN }} # leecoder PAT with repo + workflow scopes
Comment thread
veria-ai[bot] marked this conversation as resolved.
Resolved
GITHUB_TOKEN_FOR_PUSH: ${{ secrets.DBX_MONITOR_TOKEN }}
run: |
BRANCH="monitor-dbx-pricing-$(date +'%Y-%m-%d')"
git config user.name "leecoder"
git config user.email "leecoder@aol.com"
git checkout -b "$BRANCH"
git add model_prices_and_context_window.json litellm/model_prices_and_context_window_backup.json
git commit -m "chore(model_prices): refresh Databricks Foundation Model Serving rates - automated monitor detected changed DBU rates on the Databricks pricing pages; refreshed the mapped databricks/* entries."
git remote add fork "https://x-access-token:${GITHUB_TOKEN_FOR_PUSH}@github.com/${FORK_REPO}.git"
git push fork "HEAD:refs/heads/$BRANCH"
{
cat /tmp/dbx_monitor_pr_body.md
echo
echo "---"
echo "Auto-generated by the Databricks pricing monitor running on the ${FORK_REPO} fork. \`PROMO_SKIPPED\`/\`REVIEW\`/\`MISSING_FROM_PAGE\` lines need human attention; \`UPDATED\` lines were applied automatically."
} > /tmp/dbx_pr_body_final.md
gh pr create --repo "$UPSTREAM_REPO" \
--base "$UPSTREAM_BASE" \
--head "leecoder:$BRANCH" \
--title "chore(model_prices): refresh Databricks Foundation Model Serving rates" \
--body-file /tmp/dbx_pr_body_final.md
Loading
Loading