feat: add model catalog cache pricing toggle - #48
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
pjb157
marked this pull request as ready for review
August 3, 2026 11:22
There was a problem hiding this comment.
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
ModelCatalogTableUI (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. | ||
| ::: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
npm run test:run -- src/components/ModelCatalogTable.test.tsx src/lib/model-artifacts.test.ts(11 passed)npm run buildgit diff --checksrc/lib/search.test.tsassertion failure