From 62337de7ec48edc24c567c6761b9c26b0f04666a Mon Sep 17 00:00:00 2001 From: Hurshal Patel Date: Mon, 16 Jun 2025 13:32:40 -0700 Subject: [PATCH 1/8] claude attempts sync workflow --- .github/workflows/sync-models.yaml | 60 ++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/sync-models.yaml diff --git a/.github/workflows/sync-models.yaml b/.github/workflows/sync-models.yaml new file mode 100644 index 00000000..358d7963 --- /dev/null +++ b/.github/workflows/sync-models.yaml @@ -0,0 +1,60 @@ +name: Sync Models Daily + +on: + schedule: + # Run daily at 8 AM PST (4 PM UTC in standard time, 3 PM UTC in daylight time) + # Using 4 PM UTC to cover PST year-round + - cron: "0 16 * * *" + workflow_dispatch: # Allow manual triggering + +jobs: + sync-models: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Install dependencies + run: pnpm install + + - name: Run model sync + id: sync-models + run: | + pnpm tsx packages/proxy/scripts/sync_models.ts update-models --write > sync_output.txt 2>&1 + echo "sync_output<> $GITHUB_OUTPUT + cat sync_output.txt >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + - name: Check for changes + id: git-check + run: | + git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT + + - name: Create Pull Request + if: steps.git-check.outputs.changes == 'true' + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: | + [BOT] Synchronize model pricing and configurations + title: "chore[BOT]: Synchronize model pricing and configurations" + body: | + ## sync-models.ts output + ``` + ${{ steps.sync-models.outputs.sync_output }} + ``` + branch: sync-models-${{ github.run_id }} + delete-branch: true + reviewers: | + choochootrain From c900df051415a173e574c07e8ff8b6af94137ade Mon Sep 17 00:00:00 2001 From: Hurshal Patel Date: Mon, 16 Jun 2025 13:35:27 -0700 Subject: [PATCH 2/8] test --- .github/workflows/sync-models.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/sync-models.yaml b/.github/workflows/sync-models.yaml index 358d7963..9f6129fb 100644 --- a/.github/workflows/sync-models.yaml +++ b/.github/workflows/sync-models.yaml @@ -6,6 +6,7 @@ on: # Using 4 PM UTC to cover PST year-round - cron: "0 16 * * *" workflow_dispatch: # Allow manual triggering + pull_request: # TODO: removeme jobs: sync-models: From ce2dfd27c04d1522eaf8d56d3e5c98d404b57fcc Mon Sep 17 00:00:00 2001 From: Hurshal Patel Date: Mon, 16 Jun 2025 13:42:22 -0700 Subject: [PATCH 3/8] claude attempts fix --- .github/workflows/sync-models.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-models.yaml b/.github/workflows/sync-models.yaml index 9f6129fb..fb257768 100644 --- a/.github/workflows/sync-models.yaml +++ b/.github/workflows/sync-models.yaml @@ -32,7 +32,7 @@ jobs: - name: Run model sync id: sync-models run: | - pnpm tsx packages/proxy/scripts/sync_models.ts update-models --write > sync_output.txt 2>&1 + npx tsx packages/proxy/scripts/sync_models.ts update-models --write | tee sync_output.txt echo "sync_output<> $GITHUB_OUTPUT cat sync_output.txt >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT From 6b1b9ffc1f6a9bcac96e5f6352335fd6e698b2e4 Mon Sep 17 00:00:00 2001 From: Hurshal Patel Date: Mon, 16 Jun 2025 13:44:10 -0700 Subject: [PATCH 4/8] human tweaks --- .github/workflows/sync-models.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync-models.yaml b/.github/workflows/sync-models.yaml index fb257768..278bb943 100644 --- a/.github/workflows/sync-models.yaml +++ b/.github/workflows/sync-models.yaml @@ -1,4 +1,4 @@ -name: Sync Models Daily +name: Sync Models on: schedule: @@ -58,4 +58,6 @@ jobs: branch: sync-models-${{ github.run_id }} delete-branch: true reviewers: | + ankrgyl + ibolmo choochootrain From f13ec544996e0bee0060214bce90184aa64500cb Mon Sep 17 00:00:00 2001 From: Hurshal Patel Date: Mon, 16 Jun 2025 13:44:59 -0700 Subject: [PATCH 5/8] temp modify model_list.json --- packages/proxy/schema/model_list.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/proxy/schema/model_list.json b/packages/proxy/schema/model_list.json index 6dfe5f6d..76b38523 100644 --- a/packages/proxy/schema/model_list.json +++ b/packages/proxy/schema/model_list.json @@ -180,7 +180,7 @@ "format": "openai", "flavor": "chat", "multimodal": true, - "input_cost_per_mil_tokens": 2, + "input_cost_per_mil_tokens": 10, "output_cost_per_mil_tokens": 8, "input_cache_read_cost_per_mil_tokens": 0.5, "reasoning": true, From 55660154fa16b8aace1f30a808156d5811be53c6 Mon Sep 17 00:00:00 2001 From: Hurshal Patel Date: Mon, 16 Jun 2025 13:56:56 -0700 Subject: [PATCH 6/8] Add branch detection to sync-models workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extract current branch name and use as base branch for pull requests. Falls back to commit hash when in detached HEAD state. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/sync-models.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/sync-models.yaml b/.github/workflows/sync-models.yaml index 278bb943..4d831dad 100644 --- a/.github/workflows/sync-models.yaml +++ b/.github/workflows/sync-models.yaml @@ -37,6 +37,12 @@ jobs: cat sync_output.txt >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT + - name: Get current branch name + id: branch-name + run: | + BRANCH_NAME=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD) + echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT + - name: Check for changes id: git-check run: | @@ -56,6 +62,7 @@ jobs: ${{ steps.sync-models.outputs.sync_output }} ``` branch: sync-models-${{ github.run_id }} + base: ${{ steps.branch-name.outputs.branch_name }} delete-branch: true reviewers: | ankrgyl From c456fadafa1a40893a038b2a01aa9dce65bcecd7 Mon Sep 17 00:00:00 2001 From: Hurshal Patel Date: Mon, 16 Jun 2025 14:05:46 -0700 Subject: [PATCH 7/8] no short --- .github/workflows/sync-models.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-models.yaml b/.github/workflows/sync-models.yaml index 4d831dad..b3e35de0 100644 --- a/.github/workflows/sync-models.yaml +++ b/.github/workflows/sync-models.yaml @@ -40,7 +40,7 @@ jobs: - name: Get current branch name id: branch-name run: | - BRANCH_NAME=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD) + BRANCH_NAME=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse HEAD) echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT - name: Check for changes From ef8569ba13b515edb3dde81a11e1b30c043fd1db Mon Sep 17 00:00:00 2001 From: Hurshal Patel Date: Mon, 16 Jun 2025 14:47:08 -0700 Subject: [PATCH 8/8] asdf --- .github/workflows/sync-models.yaml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-models.yaml b/.github/workflows/sync-models.yaml index b3e35de0..8131205d 100644 --- a/.github/workflows/sync-models.yaml +++ b/.github/workflows/sync-models.yaml @@ -13,10 +13,14 @@ jobs: runs-on: ubuntu-latest steps: + - uses: actions/create-github-app-token@v1 + id: bot-token + with: + app-id: ${{ secrets.GH_BOT_APP_ID }} + private-key: ${{ secrets.GH_BOT_APP_PRIVATE_KEY }} + - name: Checkout repository uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Node.js uses: actions/setup-node@v4 @@ -48,6 +52,21 @@ jobs: run: | git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT + - name: Create release branch and update VERSION file + if: steps.git-check.outputs.changes == 'true' + id: create_branch + run: | + set -e # Exit on any error + + git checkout -b "sync-models-${{ github.run_id }}" + echo "${{ steps.new_version.outputs.new_version }}" > VERSION + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add VERSION + git commit -m "Propose release ${{ steps.new_version.outputs.new_version }}" + git push -f origin "$NEW_BRANCH" + echo "BRANCH_NAME=$NEW_BRANCH" >> "$GITHUB_ENV" + - name: Create Pull Request if: steps.git-check.outputs.changes == 'true' uses: peter-evans/create-pull-request@v5