Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/lib/model-artifacts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,17 @@ describe("buildModelArtifacts", () => {
});

describe("renderModelsIndexMarkdown", () => {
it("shows model-specific cache-read prices and unsupported fallbacks", () => {
it("shows model-specific cache-read multipliers and unsupported fallbacks", () => {
const markdown = renderModelsIndexMarkdown([
{ name: "Enabled", slug: "enabled", id: "enabled", rawName: "Enabled", type: "Generation", capabilities: [], playgroundUrl: "https://example.com/enabled", pricing: [], cacheReadPricePer1M: "\\$0.10", cacheReadMultiplier: 0.1 },
{ name: "Unsupported", slug: "unsupported", id: "unsupported", rawName: "Unsupported", type: "Generation", capabilities: [], playgroundUrl: "https://example.com/unsupported", pricing: [] },
]);

expect(markdown).toContain("| Model | Provider | Type | Realtime | Async | Batch (24h) | Cache read |");
expect(markdown).toContain("| [Enabled](/inference-api/models/enabled) | — | Generation | — | — | — | \\$0.10 / 1M |");
expect(markdown).toContain("| [Unsupported](/inference-api/models/unsupported) | — | Generation | — | — | — | — |");
expect(markdown).toContain("| Model | Provider | Type | Realtime | Async | Batch (24h) | Cache read |");
expect(markdown).toContain("|-------|----------|------|----------|-------|-------------|:----------:|");
expect(markdown).toContain("| [Enabled](/inference-api/models/enabled) | — | Generation | — | — | — | 0.1× |");
expect(markdown).toContain("| [Unsupported](/inference-api/models/unsupported) | — | Generation | — | — | — | ❌ |");
expect(markdown).not.toContain("❌ Prompt caching is not supported for this model.");
expect(markdown).not.toContain("90% discount");
});
});
Expand Down
12 changes: 6 additions & 6 deletions src/lib/model-artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,12 @@ export function renderModelsIndexMarkdown(artifacts: ModelArtifact[]): string {
};

const overviewTable = [
"| Model | Provider | Type | Realtime | Async | Batch (24h) | Cache read |",
"|-------|----------|------|----------|-------|-------------|------------|",
"| Model | Provider | Type | Realtime | Async | Batch (24h) | Cache read |",
"|-------|----------|------|----------|-------|-------------|:----------:|",
...artifacts.map((artifact) => {
const cacheRead = artifact.cacheReadPricePer1M
? `${artifact.cacheReadPricePer1M} / 1M`
: "";
const cacheRead = artifact.cacheReadMultiplier !== undefined
? `${artifact.cacheReadMultiplier}×`
: "";
return `| [${artifact.name}](${getModelArtifactPath(artifact.slug)}) | ${renderProvider(artifact.providerName)} | ${artifact.type} | ${formatTierCell(artifact, "Realtime")} | ${formatTierCell(artifact, "Async")} | ${formatTierCell(artifact, "Batch (24h)")} | ${cacheRead} |`;
}),
].join("\n");
Expand All @@ -226,7 +226,7 @@ export function renderModelsIndexMarkdown(artifacts: ModelArtifact[]): string {
The table below outlines the models we have available and their pricing per 1M tokens. If you are interested in understanding pricing for a model not listed below or if you'd like to request a new model - please reach out to support@doubleword.ai.

:::info{title="Prompt caching"}
Prompt-caching availability and rates are model-specific. The **Cache read** column shows the current cache-read price for supported models. See the [prompt caching guide](/inference-api/prompt-caching) for setup, TTLs, and write pricing.
Prompt-caching availability and rates are model-specific. The **Cache read** column shows the current multiplier on the model's standard input price. See the [prompt caching guide](/inference-api/prompt-caching) for setup, TTLs, and write pricing.
Comment on lines 226 to +229
:::

## Model Catalog
Expand Down