[Workers AI] Add Hosted vs Proxied filter to AI model catalog#31176
[Workers AI] Add Hosted vs Proxied filter to AI model catalog#31176superhighfives wants to merge 8 commits into
Conversation
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.
Review⏸️ Automatic reviews for this PR are paused. This PR has already received 2 automatic reviews. To run another review, a codeowner can comment
✅ No style-guide issues found in commit CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
There was a problem hiding this comment.
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
hostingmulti-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
modelslist is uniform byhosting.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
✅ 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
There was a problem hiding this comment.
✅ 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.hostingis typed as"proxied" | "hosted"insrc/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
|
Review completed for PR #31176.
What changed: A single-file change to Checks performed:
The PR requires CODEOWNER review from |
|
Preview URL: https://8cb25d5f.preview.developers.cloudflare.com |
What
Adds a "Hosting" filter to the unified AI model catalog at https://developers.cloudflare.com/ai/models/. Users can narrow to:
/ai/models/search)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.hostingfield ("hosted" | "proxied", assigned insrc/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 byModelInfoon every card. State persists to thehostingquery 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 viagetLegacyModels). 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 warningspnpm run test:prebuild✅ 40/40Known nit (non-blocking)
Deep-linking
/workers-ai/models/?hosting=proxiedapplies the filter silently (auto-hide hides the dropdown) and shows the empty-state. Recoverable via the "Clear filters" button. Matches existing behavior for?tasks=garbageetc. Worth a follow-up if product wants URL validation across all facets.