Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
31 changes: 19 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,51 @@ permissions:
id-token: write

concurrency:
group: "pages"
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
build:
name: Build website
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Node
uses: actions/setup-node@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
node-version: '24.x'
cache: npm
cache-dependency-path: website/package-lock.json

- name: Install dependencies
run: cd website && npm ci
run: npm ci --prefix website

- name: Validate generated model data
run: npm --prefix website run check:data

- name: Build website
run: cd website && npm run build
run: npm --prefix website run build

- name: Setup Pages
uses: actions/configure-pages@v4
uses: actions/configure-pages@v6

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v5
with:
path: './website/dist'
path: website/dist

deploy:
name: Deploy GitHub Pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
timeout-minutes: 10
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v5
45 changes: 29 additions & 16 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,56 @@ name: PR Checks

on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
push:
branches:
- main
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref == 'refs/heads/main' }}

jobs:
lint-and-test:
name: Lint, test, and build website
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
node-version: '24.x'
cache: npm
cache-dependency-path: website/package-lock.json

- name: Install dependencies
run: cd website && npm ci
run: npm ci --prefix website

- name: Validate generated model data
run: npm --prefix website run check:data

- name: Run ESLint
run: cd website && npm run lint
run: npm --prefix website run lint

- name: Run tests
run: cd website && npm run test
run: npm --prefix website run test

- name: Build website
run: cd website && npm run build

- name: Check build output
run: |
if [ ! -d "website/dist" ]; then
echo "Build failed: dist directory not found"
exit 1
fi
echo "Build successful: dist directory exists"
run: npm --prefix website run build

- name: Upload website build
uses: actions/upload-artifact@v7
with:
name: website-dist
path: website/dist
if-no-files-found: error
85 changes: 85 additions & 0 deletions .github/workflows/update-models.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Update models.dev data

on:
schedule:
- cron: '17 3 * * 1'
workflow_dispatch:

permissions:
contents: write
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
update-models:
name: Refresh catalog and open PR
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24.x'
cache: npm
cache-dependency-path: website/package-lock.json

- name: Install dependencies
run: npm ci --prefix website

- name: Update model data
run: npm --prefix website run update:data

- name: Validate generated model data
run: npm --prefix website run check:data

- name: Run tests
run: npm --prefix website run test

- name: Build website
run: npm --prefix website run build

- name: Open update pull request
env:
GH_TOKEN: ${{ github.token }}
UPDATE_BRANCH: automation/update-models-dev-data
run: |
if git diff --quiet && [ -z "$(git status --short)" ]; then
echo "No models.dev data changes detected."
exit 0
fi

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -B "$UPDATE_BRANCH"
git add providers website/public/models.json
git commit -m "Update models.dev catalog data"
git push --force-with-lease origin "$UPDATE_BRANCH"

existing_pr="$(gh pr list --head "$UPDATE_BRANCH" --base main --state open --json number --jq '.[0].number')"
body="$(cat <<'BODY'
Updates the generated Links Notation model files and website catalog from https://models.dev/api.json.

Verification:
- npm --prefix website run check:data
- npm --prefix website run test
- npm --prefix website run build
BODY
)"

if [ -n "$existing_pr" ]; then
gh pr edit "$existing_pr" --title "Update models.dev catalog data" --body "$body"
else
gh pr create \
--base main \
--head "$UPDATE_BRANCH" \
--title "Update models.dev catalog data" \
--body "$body"
fi
66 changes: 64 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@
# models
# Models

AI models database and website based on [Links Notation](https://github.com/link-foundation/links-notation)
Models is a generated AI model catalog backed by
[models.dev](https://models.dev/api.json). The repository keeps the model data
as Links Notation files under `providers/` and publishes a searchable React
website from `website/`.

## What Is Included

- `providers/<provider>/models/*.lino`: canonical generated Links Notation
records for each provider model.
- `website/public/models.json`: normalized catalog consumed by the browser UI.
- `website/`: Vite and React app with the searchable table and model detail
pages.
- `.github/workflows/update-models.yml`: manual and weekly refresh workflow for
pulling the latest data from models.dev.

## Local Development

Install dependencies and run the website:

```sh
npm ci --prefix website
npm --prefix website run dev
```

Run the same checks used by CI:

```sh
npm --prefix website run check:data
npm --prefix website run lint
npm --prefix website run test
npm --prefix website run build
```

## Updating Model Data

Refresh the generated catalog from models.dev:

```sh
npm --prefix website run update:data
```

The update script downloads `https://models.dev/api.json`, writes normalized
browser data to `website/public/models.json`, and regenerates the Links Notation
files under `providers/`. The GitHub Actions workflow `Update models.dev data`
runs the same command manually through `workflow_dispatch` and automatically
once per week, then opens or updates a pull request when data changes.

## Website Behavior

The default page shows a table of every model in the catalog. Search filters in
the browser across model name, model id, provider, family, modality, status, and
capability fields. Selecting a model opens a dedicated hash route that works on
GitHub Pages without server-side routing, for example:

```text
#/models/anthropic/claude-sonnet-4-5
```

## Data Source

The upstream source is the public models.dev API. Generated files are committed
so the website can deploy as a static site and reviewers can inspect the exact
Links Notation records that back the UI.
Loading