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
1 change: 1 addition & 0 deletions apps/ui/src/components/models/detail-provider-cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export function DetailProviderCards({ model }: { model: ModelWithProviders }) {
copyToClipboard={copyToClipboard}
copiedModel={copiedModel}
isImageGen={isImageGen}
detailed
/>
<ModelCtaButton
modelId={`${providerId}/${model.id}`}
Expand Down
47 changes: 46 additions & 1 deletion apps/ui/src/components/models/model-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ export function ProviderSection({
copyToClipboard,
copiedModel,
isImageGen = false,
detailed = false,
}: {
modelId: string;
providerInfo: ApiProvider;
Expand All @@ -515,6 +516,7 @@ export function ProviderSection({
copyToClipboard: (text: string) => void;
copiedModel: string | null;
isImageGen?: boolean;
detailed?: boolean;
}) {
const [activeRegionIdx, setActiveRegionIdx] = useState(0);
const [showTokenPricing, setShowTokenPricing] = useState(false);
Expand Down Expand Up @@ -911,7 +913,7 @@ export function ProviderSection({
</div>
<div className="bg-background p-2">
<PriceCell
label="Cached"
label={detailed ? "Cache Read" : "Cached"}
price={activeMapping.cachedInputPrice}
discount={activeMapping.discount}
unit="/M tokens"
Expand Down Expand Up @@ -946,6 +948,49 @@ export function ProviderSection({
</span>
</div>
)}
{detailed &&
(activeMapping.cacheWriteInputPrice ||
activeMapping.cacheWriteInputPrice1h) && (
<div className="grid grid-cols-2 gap-px rounded-md bg-border/30 border border-border/30 overflow-hidden">
<div className="bg-background p-2">
<PriceCell
label="Cache Write 5m"
price={activeMapping.cacheWriteInputPrice}
discount={activeMapping.discount}
unit="/M tokens"
formatPrice={formatPrice}
multiplier={serviceTierMultiplier}
/>
</div>
<div className="bg-background p-2">
<PriceCell
label="Cache Write 1h"
price={
activeMapping.cacheWriteInputPrice1h ??
activeMapping.cacheWriteInputPrice
}
discount={activeMapping.discount}
unit="/M tokens"
formatPrice={formatPrice}
multiplier={serviceTierMultiplier}
/>
</div>
</div>
)}
{detailed &&
activeMapping.outputAudioPrice !== null &&
activeMapping.outputAudioPrice !== undefined && (
<div className="rounded-md bg-background border border-border/30 p-2">
<PriceCell
label="Audio Output"
price={activeMapping.outputAudioPrice}
discount={activeMapping.discount}
unit="/M tokens"
formatPrice={formatPrice}
multiplier={serviceTierMultiplier}
/>
</div>
)}
</div>
)}

Expand Down
Loading