Skip to content

Migrate from @airegistry/vercel-gateway package to runtime model fetching - #8

Merged
FranciscoMoretti merged 2 commits into
mainfrom
claude/revamp-model-registry-o7viZ
Apr 11, 2026
Merged

Migrate from @airegistry/vercel-gateway package to runtime model fetching#8
FranciscoMoretti merged 2 commits into
mainfrom
claude/revamp-model-registry-o7viZ

Conversation

@FranciscoMoretti

@FranciscoMoretti FranciscoMoretti commented Apr 6, 2026

Copy link
Copy Markdown
Owner

Summary

This PR removes the @airegistry/vercel-gateway package dependency and replaces it with runtime model fetching from the Vercel AI Gateway API. Instead of maintaining a static, pre-generated list of models, the application now dynamically fetches and caches model data at runtime.

Key Changes

  • Removed static model registry: Deleted the entire packages/vercel-gateway package including:

    • Pre-generated model lists (models.generated.ts, model-extra.generated.ts, model-features.generated.ts)
    • Static endpoint JSON files for each model
    • Model definition and type exports
    • Build scripts for syncing models
  • Added runtime model fetching: Created new gateway abstraction layer:

    • lib/ai/gateways/gateway-provider.ts - Interface for gateway implementations
    • lib/ai/gateways/vercel-gateway.ts - Vercel AI Gateway implementation with HTTP fetching
    • lib/ai/gateways/fallback-models.ts - Fallback models for offline/error scenarios
    • lib/ai/models.ts - Cached model fetching with Next.js unstable_cache
  • Updated model data handling:

    • Created lib/ai/ai-gateway-models-schemas.ts with Zod schemas for API response validation
    • Added lib/ai/model-data.ts type definition for internal model representation
    • Added lib/ai/to-model-data.ts for converting API responses to internal format
    • Created lib/ai/active-gateway.ts for gateway selection logic
  • Updated model constants: Modified models-constants.ts to compute range limits dynamically from fetched models instead of using pre-generated constants

  • Updated all model references: Changed imports throughout the app from @airegistry/vercel-gateway to use the new local gateway implementations

  • Added model sync script: Created scripts/fetch-models.ts for manual model data fetching and caching

  • Removed build infrastructure: Deleted changesets configuration, release workflows, and model sync scripts that are no longer needed

Implementation Details

  • Models are fetched from the Vercel AI Gateway API endpoint and cached using Next.js unstable_cache for performance
  • Fallback models are provided for scenarios where the API is unavailable
  • The gateway abstraction allows for future support of additional AI gateway providers
  • Model data is validated against Zod schemas before use to ensure type safety
  • Range limits (context window, pricing, etc.) are computed dynamically from the fetched models

https://claude.ai/code/session_01EorGcQU6Zoe1UQkx5mnqkh


Summary by cubic

Migrates the website from the static @airegistry/vercel-gateway package to runtime model fetching from the Vercel AI Gateway with caching and a fallback snapshot, and switches provider logos to a CDN so new providers appear automatically.

  • New Features

    • Fetch models at runtime via a gateway abstraction; responses are Zod-validated and cached (1h) with tag revalidation.
    • Fallback snapshot in lib/ai/models.generated.ts with pnpm --filter website fetch:models to pre-generate it.
    • New APIs: fetchModels(), getModelById(), getProviders(), plus a per-request ModelsProvider store; filter ranges computed from live data.
    • Pages and OG routes now load models server-side and use a unified ModelData type.
    • Provider logos load from the models.dev CDN via next/image, removing the hard-coded icon switch and local SVGs.
  • Migration

    • Replace all @airegistry/vercel-gateway imports with fetchModels()/getModelById() and wrap pages with ModelsProvider.
    • Configure AI_GATEWAY_API_KEY (or VERCEL_OIDC_TOKEN); optionally set AI_GATEWAY=vercel. Use pnpm --filter website fetch:models to generate a build-time fallback when offline.
    • Provider icons now come from models.dev; remove local /public/providers/*.svg and @lobehub/icons, and allow models.dev in next.config.ts images.remotePatterns.
    • Repo cleanup: removed the old package and changesets/release workflows; Node 22 is now required.

Written for commit 49f127b. Summary will update on new commits.

Replace the @airegistry/vercel-gateway package with runtime model
fetching from Vercel AI Gateway, following the chat-js auto-updating
models pattern. Models are now fetched server-side via unstable_cache
(1h TTL, tag-based revalidation) and passed through a per-instance
Zustand store via React context. Adds a gateway provider abstraction
so additional gateways can be plugged in, plus a generated snapshot
fallback and a fetch:models script. Removes the published package,
changesets, and release workflow.

https://claude.ai/code/session_01EorGcQU6Zoe1UQkx5mnqkh

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry, we are unable to review this pull request

The GitHub API does not allow us to fetch diffs exceeding 20000 lines

@vercel

vercel Bot commented Apr 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-registry-website Ready Ready Preview, Comment Apr 8, 2026 7:46pm

@coderabbitai

coderabbitai Bot commented Apr 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 209 files, which is 59 over the limit of 150.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 09bc04bd-8c73-4753-b79b-ffe1edda5b28

📥 Commits

Reviewing files that changed from the base of the PR and between 5e5a063 and 49f127b.

⛔ Files ignored due to path filters (17)
  • apps/website/public/providers/alibaba.svg is excluded by !**/*.svg
  • apps/website/public/providers/amazon.svg is excluded by !**/*.svg
  • apps/website/public/providers/anthropic.svg is excluded by !**/*.svg
  • apps/website/public/providers/cohere.svg is excluded by !**/*.svg
  • apps/website/public/providers/deepseek.svg is excluded by !**/*.svg
  • apps/website/public/providers/google.svg is excluded by !**/*.svg
  • apps/website/public/providers/meta.svg is excluded by !**/*.svg
  • apps/website/public/providers/minimax.svg is excluded by !**/*.svg
  • apps/website/public/providers/mistral.svg is excluded by !**/*.svg
  • apps/website/public/providers/moonshotai.svg is excluded by !**/*.svg
  • apps/website/public/providers/openai.svg is excluded by !**/*.svg
  • apps/website/public/providers/perplexity.svg is excluded by !**/*.svg
  • apps/website/public/providers/stealth.svg is excluded by !**/*.svg
  • apps/website/public/providers/vercel.svg is excluded by !**/*.svg
  • apps/website/public/providers/xai.svg is excluded by !**/*.svg
  • apps/website/public/providers/zai.svg is excluded by !**/*.svg
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (209)
  • .changeset/README.md
  • .changeset/config.json
  • .github/workflows/release.yml
  • .github/workflows/verify-changesets.yml
  • README.md
  • UPDATE_MODELS.md
  • apps/website/app/(models)/compare/[[...slug]]/page.tsx
  • apps/website/app/(models)/compare/compare-page.tsx
  • apps/website/app/(models)/compare/model-details-card.tsx
  • apps/website/app/(models)/layout.tsx
  • apps/website/app/(models)/models/[provider]/[id]/opengraph-image.tsx
  • apps/website/app/(models)/models/[provider]/[id]/page.tsx
  • apps/website/app/(models)/models/gateway-model-card.tsx
  • apps/website/app/(models)/models/model-details.tsx
  • apps/website/app/(models)/models/model-filters.tsx
  • apps/website/app/(models)/models/model-query-parsers.ts
  • apps/website/app/(models)/models/models-constants.ts
  • apps/website/app/(models)/models/models-store-context.tsx
  • apps/website/app/(models)/models/use-models-nuqs-sync.ts
  • apps/website/app/(models)/models/wide-model-details.tsx
  • apps/website/app/(models)/opengraph-image.tsx
  • apps/website/app/(models)/page.tsx
  • apps/website/app/api/og/compare/route.tsx
  • apps/website/components/icons.tsx
  • apps/website/components/model-action-buttons.tsx
  • apps/website/components/model-selector-base.tsx
  • apps/website/lib/ai/active-gateway.ts
  • apps/website/lib/ai/ai-gateway-models-schemas.ts
  • apps/website/lib/ai/gateways/fallback-models.ts
  • apps/website/lib/ai/gateways/gateway-provider.ts
  • apps/website/lib/ai/gateways/registry.ts
  • apps/website/lib/ai/gateways/vercel-gateway.ts
  • apps/website/lib/ai/model-data.ts
  • apps/website/lib/ai/models.generated.ts
  • apps/website/lib/ai/models.ts
  • apps/website/lib/ai/to-model-data.ts
  • apps/website/lib/get-provider-icon-url.tsx
  • apps/website/lib/get-provider-icon.tsx
  • apps/website/lib/og/shared.ts
  • apps/website/next.config.ts
  • apps/website/package.json
  • apps/website/scripts/fetch-models.ts
  • package.json
  • packages/vercel-gateway/CHANGELOG.md
  • packages/vercel-gateway/FETCH_CUSTOM_MODEL_FEATURES.md
  • packages/vercel-gateway/README.md
  • packages/vercel-gateway/__test__/basic.test.ts
  • packages/vercel-gateway/ai-sdk-models-schemas.ts
  • packages/vercel-gateway/index.ts
  • packages/vercel-gateway/model-definition.ts
  • packages/vercel-gateway/model-extra.generated.ts
  • packages/vercel-gateway/model-extra.manual.ts
  • packages/vercel-gateway/model-extra.ts
  • packages/vercel-gateway/model-features.generated.ts
  • packages/vercel-gateway/model-id.ts
  • packages/vercel-gateway/models-dev-schemas.ts
  • packages/vercel-gateway/models.generated.ts
  • packages/vercel-gateway/outputs/missing-model-extra.json
  • packages/vercel-gateway/outputs/missing-model-features.json
  • packages/vercel-gateway/outputs/models-list.json
  • packages/vercel-gateway/outputs/providers-list.json
  • packages/vercel-gateway/package.json
  • packages/vercel-gateway/responses/gateway/alibaba/qwen-3-14b/endpoints.json
  • packages/vercel-gateway/responses/gateway/alibaba/qwen-3-235b/endpoints.json
  • packages/vercel-gateway/responses/gateway/alibaba/qwen-3-30b/endpoints.json
  • packages/vercel-gateway/responses/gateway/alibaba/qwen-3-32b/endpoints.json
  • packages/vercel-gateway/responses/gateway/alibaba/qwen3-235b-a22b-thinking/endpoints.json
  • packages/vercel-gateway/responses/gateway/alibaba/qwen3-coder-30b-a3b/endpoints.json
  • packages/vercel-gateway/responses/gateway/alibaba/qwen3-coder-plus/endpoints.json
  • packages/vercel-gateway/responses/gateway/alibaba/qwen3-coder/endpoints.json
  • packages/vercel-gateway/responses/gateway/alibaba/qwen3-max-preview/endpoints.json
  • packages/vercel-gateway/responses/gateway/alibaba/qwen3-max/endpoints.json
  • packages/vercel-gateway/responses/gateway/alibaba/qwen3-next-80b-a3b-instruct/endpoints.json
  • packages/vercel-gateway/responses/gateway/alibaba/qwen3-next-80b-a3b-thinking/endpoints.json
  • packages/vercel-gateway/responses/gateway/alibaba/qwen3-vl-instruct/endpoints.json
  • packages/vercel-gateway/responses/gateway/alibaba/qwen3-vl-thinking/endpoints.json
  • packages/vercel-gateway/responses/gateway/amazon/nova-lite/endpoints.json
  • packages/vercel-gateway/responses/gateway/amazon/nova-micro/endpoints.json
  • packages/vercel-gateway/responses/gateway/amazon/nova-pro/endpoints.json
  • packages/vercel-gateway/responses/gateway/anthropic/claude-3-haiku/endpoints.json
  • packages/vercel-gateway/responses/gateway/anthropic/claude-3-opus/endpoints.json
  • packages/vercel-gateway/responses/gateway/anthropic/claude-3.5-haiku/endpoints.json
  • packages/vercel-gateway/responses/gateway/anthropic/claude-3.5-sonnet-20240620/endpoints.json
  • packages/vercel-gateway/responses/gateway/anthropic/claude-3.5-sonnet/endpoints.json
  • packages/vercel-gateway/responses/gateway/anthropic/claude-3.7-sonnet/endpoints.json
  • packages/vercel-gateway/responses/gateway/anthropic/claude-haiku-4.5/endpoints.json
  • packages/vercel-gateway/responses/gateway/anthropic/claude-opus-4.1/endpoints.json
  • packages/vercel-gateway/responses/gateway/anthropic/claude-opus-4/endpoints.json
  • packages/vercel-gateway/responses/gateway/anthropic/claude-sonnet-4.5/endpoints.json
  • packages/vercel-gateway/responses/gateway/anthropic/claude-sonnet-4/endpoints.json
  • packages/vercel-gateway/responses/gateway/cohere/command-a/endpoints.json
  • packages/vercel-gateway/responses/gateway/cohere/command-r-plus/endpoints.json
  • packages/vercel-gateway/responses/gateway/cohere/command-r/endpoints.json
  • packages/vercel-gateway/responses/gateway/deepseek/deepseek-r1-distill-llama-70b/endpoints.json
  • packages/vercel-gateway/responses/gateway/deepseek/deepseek-r1/endpoints.json
  • packages/vercel-gateway/responses/gateway/deepseek/deepseek-v3.1-base/endpoints.json
  • packages/vercel-gateway/responses/gateway/deepseek/deepseek-v3.1-terminus/endpoints.json
  • packages/vercel-gateway/responses/gateway/deepseek/deepseek-v3.1/endpoints.json
  • packages/vercel-gateway/responses/gateway/deepseek/deepseek-v3.2-exp-thinking/endpoints.json
  • packages/vercel-gateway/responses/gateway/deepseek/deepseek-v3.2-exp/endpoints.json
  • packages/vercel-gateway/responses/gateway/deepseek/deepseek-v3/endpoints.json
  • packages/vercel-gateway/responses/gateway/google/gemini-2.0-flash-lite/endpoints.json
  • packages/vercel-gateway/responses/gateway/google/gemini-2.0-flash/endpoints.json
  • packages/vercel-gateway/responses/gateway/google/gemini-2.5-flash-image-preview/endpoints.json
  • packages/vercel-gateway/responses/gateway/google/gemini-2.5-flash-image/endpoints.json
  • packages/vercel-gateway/responses/gateway/google/gemini-2.5-flash-lite-preview-09-2025/endpoints.json
  • packages/vercel-gateway/responses/gateway/google/gemini-2.5-flash-lite/endpoints.json
  • packages/vercel-gateway/responses/gateway/google/gemini-2.5-flash-preview-09-2025/endpoints.json
  • packages/vercel-gateway/responses/gateway/google/gemini-2.5-flash/endpoints.json
  • packages/vercel-gateway/responses/gateway/google/gemini-2.5-pro/endpoints.json
  • packages/vercel-gateway/responses/gateway/google/gemini-3-pro-preview/endpoints.json
  • packages/vercel-gateway/responses/gateway/google/gemma-2-9b/endpoints.json
  • packages/vercel-gateway/responses/gateway/inception/mercury-coder-small/endpoints.json
  • packages/vercel-gateway/responses/gateway/meituan/longcat-flash-chat/endpoints.json
  • packages/vercel-gateway/responses/gateway/meituan/longcat-flash-thinking/endpoints.json
  • packages/vercel-gateway/responses/gateway/meta/llama-3-70b/endpoints.json
  • packages/vercel-gateway/responses/gateway/meta/llama-3-8b/endpoints.json
  • packages/vercel-gateway/responses/gateway/meta/llama-3.1-70b/endpoints.json
  • packages/vercel-gateway/responses/gateway/meta/llama-3.1-8b/endpoints.json
  • packages/vercel-gateway/responses/gateway/meta/llama-3.2-11b/endpoints.json
  • packages/vercel-gateway/responses/gateway/meta/llama-3.2-1b/endpoints.json
  • packages/vercel-gateway/responses/gateway/meta/llama-3.2-3b/endpoints.json
  • packages/vercel-gateway/responses/gateway/meta/llama-3.2-90b/endpoints.json
  • packages/vercel-gateway/responses/gateway/meta/llama-3.3-70b/endpoints.json
  • packages/vercel-gateway/responses/gateway/meta/llama-4-maverick/endpoints.json
  • packages/vercel-gateway/responses/gateway/meta/llama-4-scout/endpoints.json
  • packages/vercel-gateway/responses/gateway/minimax/minimax-m2/endpoints.json
  • packages/vercel-gateway/responses/gateway/mistral/codestral/endpoints.json
  • packages/vercel-gateway/responses/gateway/mistral/devstral-small/endpoints.json
  • packages/vercel-gateway/responses/gateway/mistral/magistral-medium-2506/endpoints.json
  • packages/vercel-gateway/responses/gateway/mistral/magistral-medium/endpoints.json
  • packages/vercel-gateway/responses/gateway/mistral/magistral-small-2506/endpoints.json
  • packages/vercel-gateway/responses/gateway/mistral/magistral-small/endpoints.json
  • packages/vercel-gateway/responses/gateway/mistral/ministral-3b/endpoints.json
  • packages/vercel-gateway/responses/gateway/mistral/ministral-8b/endpoints.json
  • packages/vercel-gateway/responses/gateway/mistral/mistral-large/endpoints.json
  • packages/vercel-gateway/responses/gateway/mistral/mistral-medium/endpoints.json
  • packages/vercel-gateway/responses/gateway/mistral/mistral-small/endpoints.json
  • packages/vercel-gateway/responses/gateway/mistral/mixtral-8x22b-instruct/endpoints.json
  • packages/vercel-gateway/responses/gateway/mistral/pixtral-12b/endpoints.json
  • packages/vercel-gateway/responses/gateway/mistral/pixtral-large/endpoints.json
  • packages/vercel-gateway/responses/gateway/models.json
  • packages/vercel-gateway/responses/gateway/moonshotai/kimi-k2-0905/endpoints.json
  • packages/vercel-gateway/responses/gateway/moonshotai/kimi-k2-thinking-turbo/endpoints.json
  • packages/vercel-gateway/responses/gateway/moonshotai/kimi-k2-thinking/endpoints.json
  • packages/vercel-gateway/responses/gateway/moonshotai/kimi-k2-turbo/endpoints.json
  • packages/vercel-gateway/responses/gateway/moonshotai/kimi-k2/endpoints.json
  • packages/vercel-gateway/responses/gateway/morph/morph-v3-fast/endpoints.json
  • packages/vercel-gateway/responses/gateway/morph/morph-v3-large/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-3.5-turbo-instruct/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-3.5-turbo/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-4-turbo/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-4.1-mini/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-4.1-nano/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-4.1/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-4o-mini/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-4o/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-5-chat/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-5-codex/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-5-mini/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-5-nano/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-5-pro/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-5.1-codex-mini/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-5.1-codex/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-5.1-instant/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-5.1-thinking/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-5/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-oss-120b/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-oss-20b/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/gpt-oss-safeguard-20b/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/o1/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/o3-deep-research/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/o3-mini/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/o3/endpoints.json
  • packages/vercel-gateway/responses/gateway/openai/o4-mini/endpoints.json
  • packages/vercel-gateway/responses/gateway/perplexity/sonar-pro/endpoints.json
  • packages/vercel-gateway/responses/gateway/perplexity/sonar-reasoning-pro/endpoints.json
  • packages/vercel-gateway/responses/gateway/perplexity/sonar-reasoning/endpoints.json
  • packages/vercel-gateway/responses/gateway/perplexity/sonar/endpoints.json
  • packages/vercel-gateway/responses/gateway/stealth/sonoma-dusk-alpha/endpoints.json
  • packages/vercel-gateway/responses/gateway/stealth/sonoma-sky-alpha/endpoints.json
  • packages/vercel-gateway/responses/gateway/vercel/v0-1.0-md/endpoints.json
  • packages/vercel-gateway/responses/gateway/vercel/v0-1.5-md/endpoints.json
  • packages/vercel-gateway/responses/gateway/xai/grok-2-vision/endpoints.json
  • packages/vercel-gateway/responses/gateway/xai/grok-2/endpoints.json
  • packages/vercel-gateway/responses/gateway/xai/grok-3-fast/endpoints.json
  • packages/vercel-gateway/responses/gateway/xai/grok-3-mini-fast/endpoints.json
  • packages/vercel-gateway/responses/gateway/xai/grok-3-mini/endpoints.json
  • packages/vercel-gateway/responses/gateway/xai/grok-3/endpoints.json
  • packages/vercel-gateway/responses/gateway/xai/grok-4-fast-non-reasoning/endpoints.json
  • packages/vercel-gateway/responses/gateway/xai/grok-4-fast-reasoning/endpoints.json
  • packages/vercel-gateway/responses/gateway/xai/grok-4/endpoints.json
  • packages/vercel-gateway/responses/gateway/xai/grok-code-fast-1/endpoints.json
  • packages/vercel-gateway/responses/gateway/zai/glm-4.5-air/endpoints.json
  • packages/vercel-gateway/responses/gateway/zai/glm-4.5/endpoints.json
  • packages/vercel-gateway/responses/gateway/zai/glm-4.5v/endpoints.json
  • packages/vercel-gateway/responses/gateway/zai/glm-4.6/endpoints.json
  • packages/vercel-gateway/responses/models-dev/models.json
  • packages/vercel-gateway/tsconfig.json
  • packages/vercel-gateway/tsup.config.ts
  • packages/vercel-gateway/utils.ts
  • pnpm-workspace.yaml
  • scripts/models/README.md
  • scripts/models/fetch-base.ts
  • scripts/models/fetch-endpoints.ts
  • scripts/models/fetch-extra.ts
  • scripts/models/sync.ts
  • scripts/package.json
  • scripts/tsconfig.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/revamp-model-registry-o7viZ

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

7 issues found across 208 files

Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/website/app/(models)/models/models-store-context.tsx">

<violation number="1" location="apps/website/app/(models)/models/models-store-context.tsx:238">
P2: `temperatureControl` filters are ignored in `computeResults`, so toggling that filter won’t change the results even though the UI counts it as active. Add the missing filter check (or remove the feature from state if it’s no longer supported).</violation>
</file>

<file name="apps/website/app/(models)/models/models-constants.ts">

<violation number="1" location="apps/website/app/(models)/models/models-constants.ts:20">
P2: Avoid defaulting missing input pricing to 0; it incorrectly forces the min range to 0 when pricing is absent.</violation>

<violation number="2" location="apps/website/app/(models)/models/models-constants.ts:23">
P2: Avoid defaulting missing output pricing to 0; it will skew the output pricing range to 0 when pricing is absent.</violation>
</file>

<file name="apps/website/lib/ai/to-model-data.ts">

<violation number="1" location="apps/website/lib/ai/to-model-data.ts:13">
P2: Embedding models will be marked as not accepting text input because input.text only checks for "language". If UI or filtering logic relies on input.text, embedding models could be incorrectly excluded. Consider treating embedding models as text input.</violation>
</file>

<file name="apps/website/app/(models)/models/wide-model-details.tsx">

<violation number="1" location="apps/website/app/(models)/models/wide-model-details.tsx:94">
P2: Don’t default missing input pricing to $0; show "--" (or another explicit unknown marker) when pricing.input is absent to avoid misrepresenting the model as free.</violation>

<violation number="2" location="apps/website/app/(models)/models/wide-model-details.tsx:102">
P2: Don’t default missing output pricing to $0; display an explicit unknown value when pricing.output is absent to avoid misleading pricing data.</violation>
</file>

<file name="apps/website/app/(models)/models/gateway-model-card.tsx">

<violation number="1" location="apps/website/app/(models)/models/gateway-model-card.tsx:200">
P2: Don’t coerce missing input pricing to "0". It causes unknown prices to be displayed as free instead of the "--" placeholder returned for undefined values.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

}
if (f.features.reasoning && !m.reasoning) return false;
if (f.features.toolCall && !m.toolCall) return false;
return true;

@cubic-dev-ai cubic-dev-ai Bot Apr 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: temperatureControl filters are ignored in computeResults, so toggling that filter won’t change the results even though the UI counts it as active. Add the missing filter check (or remove the feature from state if it’s no longer supported).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/website/app/(models)/models/models-store-context.tsx, line 238:

<comment>`temperatureControl` filters are ignored in `computeResults`, so toggling that filter won’t change the results even though the UI counts it as active. Add the missing filter check (or remove the feature from state if it’s no longer supported).</comment>

<file context>
@@ -173,363 +157,371 @@ const computeActiveFiltersCount = (f: FilterState): number => {
+    }
+    if (f.features.reasoning && !m.reasoning) return false;
+    if (f.features.toolCall && !m.toolCall) return false;
+    return true;
   });
 
</file context>
Fix with Cubic

.map((m) => Number.parseFloat(m.pricing.input ?? "0") * 1_000_000)
.filter((n) => Number.isFinite(n));
const outputPrices = allModels
.map((m) => Number.parseFloat(m.pricing.output ?? "0") * 1_000_000)

@cubic-dev-ai cubic-dev-ai Bot Apr 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Avoid defaulting missing output pricing to 0; it will skew the output pricing range to 0 when pricing is absent.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/website/app/(models)/models/models-constants.ts, line 23:

<comment>Avoid defaulting missing output pricing to 0; it will skew the output pricing range to 0 when pricing is absent.</comment>

<file context>
@@ -1,35 +1,47 @@
+    .map((m) => Number.parseFloat(m.pricing.input ?? "0") * 1_000_000)
+    .filter((n) => Number.isFinite(n));
+  const outputPrices = allModels
+    .map((m) => Number.parseFloat(m.pricing.output ?? "0") * 1_000_000)
+    .filter((n) => Number.isFinite(n));
+
</file context>
Fix with Cubic

.map((m) => m.max_tokens)
.filter((n): n is number => typeof n === "number" && Number.isFinite(n));
const inputPrices = allModels
.map((m) => Number.parseFloat(m.pricing.input ?? "0") * 1_000_000)

@cubic-dev-ai cubic-dev-ai Bot Apr 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Avoid defaulting missing input pricing to 0; it incorrectly forces the min range to 0 when pricing is absent.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/website/app/(models)/models/models-constants.ts, line 20:

<comment>Avoid defaulting missing input pricing to 0; it incorrectly forces the min range to 0 when pricing is absent.</comment>

<file context>
@@ -1,35 +1,47 @@
+    .map((m) => m.max_tokens)
+    .filter((n): n is number => typeof n === "number" && Number.isFinite(n));
+  const inputPrices = allModels
+    .map((m) => Number.parseFloat(m.pricing.input ?? "0") * 1_000_000)
+    .filter((n) => Number.isFinite(n));
+  const outputPrices = allModels
</file context>
Fix with Cubic

toolCall: tags.includes("tool-use"),
input: {
image: tags.includes("vision") || model.type === "image",
text: model.type === "language",

@cubic-dev-ai cubic-dev-ai Bot Apr 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Embedding models will be marked as not accepting text input because input.text only checks for "language". If UI or filtering logic relies on input.text, embedding models could be incorrectly excluded. Consider treating embedding models as text input.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/website/lib/ai/to-model-data.ts, line 13:

<comment>Embedding models will be marked as not accepting text input because input.text only checks for "language". If UI or filtering logic relies on input.text, embedding models could be incorrectly excluded. Consider treating embedding models as text input.</comment>

<file context>
@@ -0,0 +1,25 @@
+    toolCall: tags.includes("tool-use"),
+    input: {
+      image: tags.includes("vision") || model.type === "image",
+      text: model.type === "language",
+      pdf: tags.includes("file-input"),
+      audio: false,
</file context>
Fix with Cubic

Comment on lines +102 to 103
? `$${(Number.parseFloat(model.pricing.output ?? "0") * 1_000_000).toFixed(2)}/M tokens`
: "--"

@cubic-dev-ai cubic-dev-ai Bot Apr 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Don’t default missing output pricing to $0; display an explicit unknown value when pricing.output is absent to avoid misleading pricing data.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/website/app/(models)/models/wide-model-details.tsx, line 102:

<comment>Don’t default missing output pricing to $0; display an explicit unknown value when pricing.output is absent to avoid misleading pricing data.</comment>

<file context>
@@ -100,15 +91,15 @@ export function WideModelDetails({
             value={
               model
-                ? `$${(Number.parseFloat(model.pricing.output) * 1_000_000).toFixed(2)}/M tokens`
+                ? `$${(Number.parseFloat(model.pricing.output ?? "0") * 1_000_000).toFixed(2)}/M tokens`
                 : "--"
             }
</file context>
Suggested change
? `$${(Number.parseFloat(model.pricing.output ?? "0") * 1_000_000).toFixed(2)}/M tokens`
: "--"
? model.pricing.output
? `$${(Number.parseFloat(model.pricing.output) * 1_000_000).toFixed(2)}/M tokens`
: "--"
: "--"
Fix with Cubic

Comment on lines +94 to 95
? `$${(Number.parseFloat(model.pricing.input ?? "0") * 1_000_000).toFixed(2)}/M tokens`
: "--"

@cubic-dev-ai cubic-dev-ai Bot Apr 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Don’t default missing input pricing to $0; show "--" (or another explicit unknown marker) when pricing.input is absent to avoid misrepresenting the model as free.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/website/app/(models)/models/wide-model-details.tsx, line 94:

<comment>Don’t default missing input pricing to $0; show "--" (or another explicit unknown marker) when pricing.input is absent to avoid misrepresenting the model as free.</comment>

<file context>
@@ -100,15 +91,15 @@ export function WideModelDetails({
             value={
               model
-                ? `$${(Number.parseFloat(model.pricing.input) * 1_000_000).toFixed(2)}/M tokens`
+                ? `$${(Number.parseFloat(model.pricing.input ?? "0") * 1_000_000).toFixed(2)}/M tokens`
                 : "--"
             }
</file context>
Suggested change
? `$${(Number.parseFloat(model.pricing.input ?? "0") * 1_000_000).toFixed(2)}/M tokens`
: "--"
? model.pricing.input
? `$${(Number.parseFloat(model.pricing.input) * 1_000_000).toFixed(2)}/M tokens`
: "--"
: "--"
Fix with Cubic

Input{" "}
<span className="font-medium text-foreground">
{formatUsdPerMTokens(model.pricing.input)}
{formatUsdPerMTokens(model.pricing.input ?? "0")}

@cubic-dev-ai cubic-dev-ai Bot Apr 6, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Don’t coerce missing input pricing to "0". It causes unknown prices to be displayed as free instead of the "--" placeholder returned for undefined values.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/website/app/(models)/models/gateway-model-card.tsx, line 200:

<comment>Don’t coerce missing input pricing to "0". It causes unknown prices to be displayed as free instead of the "--" placeholder returned for undefined values.</comment>

<file context>
@@ -205,33 +197,22 @@ function ModelMetaRow({ model }: { model: ModelDefinition }) {
         Input{" "}
         <span className="font-medium text-foreground">
-          {formatUsdPerMTokens(model.pricing.input)}
+          {formatUsdPerMTokens(model.pricing.input ?? "0")}
         </span>
       </span>
</file context>
Suggested change
{formatUsdPerMTokens(model.pricing.input ?? "0")}
{formatUsdPerMTokens(model.pricing.input)}
Fix with Cubic

Match the chat-js pattern: render provider icons via a next/image
pointing at https://models.dev/logos/{owned_by}.svg instead of the
@lobehub/icons component library and the local /public/providers SVGs.
This drops the hard-coded provider switch so icons automatically appear
for any new gateway model. @lobehub/icons is removed from dependencies
and models.dev is whitelisted in next.config image remotePatterns.

https://claude.ai/code/session_01EorGcQU6Zoe1UQkx5mnqkh
@FranciscoMoretti
FranciscoMoretti merged commit 564646c into main Apr 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants