Skip to content

Update LLM Benchmark Data #51

Update LLM Benchmark Data

Update LLM Benchmark Data #51

Workflow file for this run

name: Update LLM Benchmark Data
on:
schedule:
# Runs at 08:00 UTC every day
- cron: "0 8 * * *"
workflow_dispatch:
jobs:
run-benchmarks:
runs-on: ubuntu-latest
steps:
- name: Send Benchmark Requests
run: |
regions=("sea" "iad" "cdg")
for region in "${regions[@]}"
do
curl -X POST 'https://ai-benchmarks.fly.dev/bench?mode=text&max_tokens=20&store=true' -H "fly-prefer-region: $region"
done
generate-latest-data:
needs: run-benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "20"
- name: Get data and update file
run: |
OUTPUT=$(node ./utils/GenerateLatestData.js) || { echo "Failed to generate latest data."; exit 1; }
if [ -n "$OUTPUT" ]; then
echo "$OUTPUT" > ./website/public/data/latest.json
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add ./website/public/data/latest.json
git commit -m "Update latest data"
git push
else
echo "No data generated, skipping Git operations."
exit 1
fi
- name: Get commit hash
id: commit_hash
run: echo "::set-output name=hash::$(git rev-parse HEAD)"
build-and-deploy-site:
needs: generate-latest-data
uses: ./.github/workflows/astro.yml
with:
commit-sha: ${{ needs.generate-latest-data.outputs.commit_hash.hash }}