Skip to content

[Workers AI] Add Hosted vs Proxied filter to AI model catalog#31176

Open
superhighfives wants to merge 8 commits into
productionfrom
cgleason/ai-models-hosting-filter
Open

[Workers AI] Add Hosted vs Proxied filter to AI model catalog#31176
superhighfives wants to merge 8 commits into
productionfrom
cgleason/ai-models-hosting-filter

Conversation

@superhighfives
Copy link
Copy Markdown
Contributor

What

Adds a "Hosting" filter to the unified AI model catalog at https://developers.cloudflare.com/ai/models/. Users can narrow to:

  • Hosted — Workers AI models running on Cloudflare GPUs (legacy /ai/models/search)
  • Proxied — third-party providers (Anthropic, OpenAI, Google, ByteDance, Alibaba, etc.) served via the unified catalog / AI Gateway

Why

User-requested. A parallel filter is being added to the dashboard's AI Models page in stratus!38465.

How it works

Surfaces the existing ModelCardData.hosting field ("hosted" | "proxied", assigned in src/util/model-resolver.ts) as a new multi-select facet on /ai/models/, slotting in between Capabilities and Authors. Items are "Hosted" and "Proxied" to match the subtitle text already rendered by ModelInfo on every card. State persists to the hosting query parameter alongside the other filters.

The dropdown auto-hides when the incoming model list is uniform on the hosting axis (e.g. /workers-ai/models/, which today is 100% hosted via getLegacyModels). It will reappear automatically if/when that data source becomes mixed.

Scope

Single-file change to src/components/ModelCatalog.tsx (+41 / −1). No schema, resolver, page, or styling changes.

Validation

  • pnpm run format:core:check
  • pnpm run lint
  • pnpm run check ✅ 362 files, 0 errors, 0 warnings
  • pnpm run test:prebuild ✅ 40/40

Known nit (non-blocking)

Deep-linking /workers-ai/models/?hosting=proxied applies the filter silently (auto-hide hides the dropdown) and shows the empty-state. Recoverable via the "Clear filters" button. Matches existing behavior for ?tasks=garbage etc. Worth a follow-up if product wants URL validation across all facets.

Surfaces the existing ModelCardData.hosting field as a new multi-select
facet on /ai/models/, slotting in between Capabilities and Authors.
Items are 'Hosted' and 'Proxied' to match the subtitle text already
rendered by ModelInfo on every card. State persists to the 'hosting'
query parameter alongside the other filters.

The dropdown auto-hides when the incoming model list is uniform on
the hosting axis (e.g. /workers-ai/models/, which today is 100%
hosted via getLegacyModels), and will reappear automatically if the
data source becomes mixed.

Single-file change. No schema, resolver, page, or styling changes.
@superhighfives superhighfives requested a review from kodster28 as a code owner June 1, 2026 21:53
Copilot AI review requested due to automatic review settings June 1, 2026 21:53
@superhighfives superhighfives requested a review from a team as a code owner June 1, 2026 21:53
@cloudflare-docs-bot
Copy link
Copy Markdown

cloudflare-docs-bot Bot commented Jun 1, 2026

Review

⏸️ Automatic reviews for this PR are paused.

This PR has already received 2 automatic reviews. To run another review, a codeowner can comment /review or /full-review.

Tip: Keep PRs in draft mode until they are ready for review — the bot skips draft PRs automatically.


✅ No style-guide issues found in commit d1d2ea3.

Commands

Only codeowners can run commands. Post a comment with the command to trigger it.

Command Description
/review Runs a review now. Incremental if a prior review exists, full if not.
/full-review Re-reviews the entire PR diff from scratch, ignoring incremental history. Useful after a rebase, when you want a fresh review, or if the bot gets out of sync and reports issues that no longer exist.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/components/ @cloudflare/content-engineering, @kodster28

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Hosting facet to the AI model catalog filtering UI, exposing the existing ModelCardData.hosting field so users can narrow the catalog to Hosted vs Proxied models.

Changes:

  • Extend catalog filter state + URL sync to include a hosting multi-select query parameter.
  • Add a new “Hosting” filter dropdown (Hosted/Proxied) and apply it to the model list filtering logic.
  • Auto-hide the Hosting dropdown when the provided models list is uniform by hosting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ask-bonk ask-bonk Bot added the product:workers-ai Workers AI: https://developers.cloudflare.com/workers-ai/ label Jun 1, 2026
Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues found.

Summary
Adds a "Hosting" multi-select filter to the AI model catalog (), surfacing the existing field. Users can filter by Hosted (Cloudflare GPUs) or Proxied (third-party providers via AI Gateway). The filter state persists to the query parameter, participates in the active-filters count, and auto-hides when the incoming model list is uniform on the hosting axis (e.g., ).

Verified

  • is typed as in .
  • State management, URL synchronization, and clear-filters reset are consistent with existing filter patterns.
  • Auto-hide logic correctly computes .

Labels applied

Copy link
Copy Markdown
Contributor

@ask-bonk ask-bonk Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues found.

Summary
Adds a "Hosting" multi-select filter to the AI model catalog (ModelCatalog.tsx), surfacing the existing ModelCardData.hosting field. Users can filter by Hosted (Cloudflare GPUs) or Proxied (third-party providers via AI Gateway). The filter state persists to the hosting query parameter, participates in the active-filters count, and auto-hides when the incoming model list is uniform on the hosting axis (e.g., /workers-ai/models/).

Verified

  • ModelCardData.hosting is typed as "proxied" | "hosted" in src/util/model-types.ts.
  • State management, URL synchronization, and clear-filters reset are consistent with existing filter patterns.
  • Auto-hide logic correctly computes new Set(models.map((m) => m.hosting)).size > 1.

Labels applied

  • product:workers-ai

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented Jun 1, 2026

Review completed for PR #31176.

  • Label applied: product:workers-ai
  • Verdict: ✅ No issues found — the PR is clean and ready for CODEOWNER review.

What changed: A single-file change to src/components/ModelCatalog.tsx that adds a Hosting multi-select filter (Hosted / Proxied) to the AI model catalog. The filter state is synced to the hosting query parameter, included in the active-filters count, and automatically hidden when the incoming model list is uniform on the hosting axis.

Checks performed:

  • ModelCardData.hosting type verified as "proxied" | "hosted" in src/util/model-types.ts
  • State hooks, URL sync, clear-filters reset, and filtering logic are all consistent with existing patterns in the file
  • Auto-hide logic (new Set(models.map((m) => m.hosting)).size > 1) is correct
  • No style guide violations, frontmatter issues, or broken links (not applicable for this component-only change)

The PR requires CODEOWNER review from @cloudflare/content-engineering or @kodster28 before merge.

github run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:workers-ai Workers AI: https://developers.cloudflare.com/workers-ai/ size/s

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants