name: Weekly Model Update 'on': schedule: - cron: '0 2 * * 1' workflow_dispatch: concurrency: group: weekly-model-update cancel-in-progress: false permissions: contents: write pull-requests: write jobs: update-models: runs-on: ubuntu-latest timeout-minutes: 90 steps: - name: Checkout uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - name: Set up Python uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: '3.12' # HF_TOKEN raises HuggingFace API rate limits and unlocks gated-model # metadata (the scraper warns-and-skips gated repos without it). - name: Refresh model database env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: python3 scripts/scrape_hf_models.py -n 5000 # Refresh the community leaderboard cache alongside the catalog. The # measured tok/s rows also feed the estimate-calibration test below, # so this doubles as a weekly accuracy audit of estimate_tps. - name: Refresh benchmark cache env: LOCALMAXXING_API_KEY: ${{ secrets.LOCALMAXXING_API_KEY }} run: python3 scripts/scrape_benchmarks.py --limit 200 - name: Validate generated JSON run: | python3 -m json.tool llmfit-core/data/hf_models.json > /dev/null python3 -m json.tool llmfit-core/data/benchmark_cache.json > /dev/null - name: Set up Rust uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable - name: Validate against JSON Schema run: cargo test -p llmfit-core hf_models_match_schema # Weekly accuracy audit: replay the refreshed measurements through # estimate_tps; fails on systematic estimator bias (see fit.rs). - name: Calibrate estimates against measured benchmarks run: cargo test -p llmfit-core test_estimate_tps_calibration -- --nocapture - name: Check for changes id: changes run: | if git diff --quiet; then echo "changed=false" >> "$GITHUB_OUTPUT" else echo "changed=true" >> "$GITHUB_OUTPUT" fi - name: Create or update pull request if: steps.changes.outputs.changed == 'true' uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7 with: token: ${{ github.token }} commit-message: "chore(models): Weekly model and benchmark data refresh" title: "[Automated] Weekly model and benchmark data refresh" body: | Automated weekly refresh of model metadata (`scripts/scrape_hf_models.py`) and the localmaxxing benchmark cache (`scripts/scrape_benchmarks.py`). **Note:** CI checks may not automatically trigger with the default `github.token`. If checks don't run, please close and reopen the PR or manually trigger them. branch: automated/weekly-model-update delete-branch: true labels: | automated data-update