diff --git a/.github/workflows/sync-models.yaml b/.github/workflows/sync-models.yaml new file mode 100644 index 00000000..b3e35de0 --- /dev/null +++ b/.github/workflows/sync-models.yaml @@ -0,0 +1,70 @@ +name: Sync Models + +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 + pull_request: # TODO: removeme + +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: | + 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 + + - name: Get current branch name + id: branch-name + run: | + 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 + 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 }} + base: ${{ steps.branch-name.outputs.branch_name }} + delete-branch: true + reviewers: | + ankrgyl + ibolmo + choochootrain 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,