Skip to content

feat: add model catalog cache pricing toggle - #48

Merged
pjb157 merged 4 commits into
mainfrom
peter/refine-model-catalog-columns
Aug 3, 2026
Merged

feat: add model catalog cache pricing toggle#48
pjb157 merged 4 commits into
mainfrom
peter/refine-model-catalog-columns

Conversation

@pjb157

@pjb157 pjb157 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove the Provider and Type columns from the model catalog
  • add a Standard / Cache read segmented control above the pricing table
  • strike through supported standard input prices and show reduced cache-read prices in green
  • preserve output prices and standard pricing for unsupported models
  • retain a four-column static markdown catalog with both standard and cached input amounts

Validation

  • npm run test:run -- src/components/ModelCatalogTable.test.tsx src/lib/model-artifacts.test.ts (11 passed)
  • scoped ESLint for all changed source and test files
  • npm run build
  • git diff --check
  • full suite: 69 passed, with the existing unrelated src/lib/search.test.ts assertion failure

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
documentation Ready Ready Preview Jul 31, 2026 4:33pm

Request Review

@pjb157 pjb157 changed the title fix: simplify model catalog pricing columns fix: show cache prices by modality Jul 31, 2026
@pjb157 pjb157 changed the title fix: show cache prices by modality feat: add model catalog cache pricing toggle Jul 31, 2026
@pjb157
pjb157 marked this pull request as ready for review August 3, 2026 11:22
Copilot AI review requested due to automatic review settings August 3, 2026 11:22
@pjb157
pjb157 merged commit d45b757 into main Aug 3, 2026
3 checks passed

Copilot AI 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.

Pull request overview

Adds a cache-read pricing view to the inference-api model catalog, shifting the web catalog from a fully static markdown table to an interactive client-rendered table while keeping markdown generation helpers in model-artifacts.

Changes:

  • Extend model pricing artifacts to include optional per-tier cache-read input pricing.
  • Replace the models overview page’s embedded markdown catalog with a ModelCatalogTable UI (Standard vs Cache read toggle).
  • Update/expand tests to cover cache-read tier pricing and the new table behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/lib/model-artifacts.ts Adds cache-read price fields to pricing rows, introduces a reusable intro markdown block, and adjusts the static markdown catalog formatting.
src/lib/model-artifacts.test.ts Updates fixtures/assertions to validate cache-read pricing rows and the new intro helper behavior.
src/components/ModelCatalogTable.tsx New client component rendering the interactive pricing table with a Standard/Cache read toggle and per-tier display rules.
src/components/ModelCatalogTable.test.tsx New tests validating default vs cache-read display behavior and fallback behavior for unsupported models.
src/app/[product]/[...slug]/page.tsx Switches /inference-api/models to render intro markdown plus the interactive catalog table.

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

Comment on lines +5 to +9
import {
getModelArtifactPath,
type ModelArtifact,
type ModelArtifactPricingRow,
} from "@/lib/model-artifacts";
Comment on lines +249 to 251
if (isModelsOverview) {
content = renderModelsIndexIntroMarkdown();
}
Comment on lines +212 to +214
:::info{title="Prompt caching"}
Prompt-caching availability and rates are model-specific. Use **Cache read** to compare each supported model's reduced cached-input price with its standard input price. See the [prompt caching guide](/inference-api/prompt-caching) for setup, TTLs, and write pricing.
:::
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