@@ -9,6 +9,7 @@ import { ProductHero } from '@/components/product'
99import type { Locale } from '@/i18n/config'
1010import { BENCHMARK_KEYS , formatBenchmarkValue , hasBenchmarks } from '@/lib/benchmarks'
1111import { getModel } from '@/lib/data/fetchers'
12+ import { formatTokenCount } from '@/lib/format'
1213import { modelsData as models } from '@/lib/generated'
1314import { generateModelDetailMetadata } from '@/lib/metadata'
1415
@@ -40,16 +41,8 @@ export async function generateMetadata({
4041 description : model . description || '' ,
4142 vendor : model . vendor ,
4243 size : model . size ?? undefined ,
43- totalContext :
44- typeof model . totalContext === 'string'
45- ? parseInt ( model . totalContext . replace ( / [ K M ] / g, '' ) , 10 ) *
46- ( model . totalContext . includes ( 'K' ) ? 1000 : 1 )
47- : ( model . totalContext ?? undefined ) ,
48- maxOutput :
49- typeof model . maxOutput === 'string'
50- ? parseInt ( model . maxOutput . replace ( / [ K M ] / g, '' ) , 10 ) *
51- ( model . maxOutput . includes ( 'K' ) ? 1000 : 1 )
52- : ( model . maxOutput ?? undefined ) ,
44+ contextWindow : model . contextWindow ,
45+ maxOutput : model . maxOutput ,
5346 tokenPricing : model . tokenPricing
5447 ? {
5548 input : model . tokenPricing . input ?? undefined ,
@@ -124,8 +117,14 @@ export default async function ModelPage({
124117 additionalInfo = {
125118 [
126119 model . size && { label : t ( 'labels.size' ) , value : model . size } ,
127- model . totalContext && { label : t ( 'labels.context' ) , value : model . totalContext } ,
128- model . maxOutput && { label : t ( 'labels.maxOutput' ) , value : model . maxOutput } ,
120+ {
121+ label : t ( 'labels.context' ) ,
122+ value : formatTokenCount ( model . contextWindow ) ,
123+ } ,
124+ {
125+ label : t ( 'labels.maxOutput' ) ,
126+ value : formatTokenCount ( model . maxOutput ) ,
127+ } ,
129128 ] . filter ( Boolean ) as { label : string ; value : string } [ ]
130129 }
131130 pricing = {
@@ -185,23 +184,23 @@ export default async function ModelPage({
185184 </ div >
186185 ) }
187186
188- { model . totalContext && (
189- < div className = "border border -[var(--color-border )] p- [var(--spacing-md )]" >
190- < h3 className = "text-xs text-[var(--color-text-muted)] uppercase tracking-wider font-medium mb-[var(--spacing-xs)]" >
191- { t ( 'totalContext' ) }
192- </ h3 >
193- < p className = "text-lg font-semibold tracking-tight" > { model . totalContext } </ p >
194- </ div >
195- ) }
187+ < div className = "border border-[var(--color-border)] p-[var(--spacing-md)]" >
188+ < h3 className = "text-xs text -[var(--color-text-muted )] uppercase tracking-wider font-medium mb- [var(--spacing-xs )]" >
189+ { t ( 'contextWindow' ) }
190+ </ h3 >
191+ < p className = "text-lg font-semibold tracking-tight" >
192+ { formatTokenCount ( model . contextWindow ) }
193+ </ p >
194+ </ div >
196195
197- { model . maxOutput && (
198- < div className = "border border -[var(--color-border )] p- [var(--spacing-md )]" >
199- < h3 className = "text-xs text-[var(--color-text-muted)] uppercase tracking-wider font-medium mb-[var(--spacing-xs)]" >
200- { t ( 'maxOutput' ) }
201- </ h3 >
202- < p className = "text-lg font-semibold tracking-tight" > { model . maxOutput } </ p >
203- </ div >
204- ) }
196+ < div className = "border border-[var(--color-border)] p-[var(--spacing-md)]" >
197+ < h3 className = "text-xs text -[var(--color-text-muted )] uppercase tracking-wider font-medium mb- [var(--spacing-xs )]" >
198+ { t ( 'maxOutput' ) }
199+ </ h3 >
200+ < p className = "text-lg font-semibold tracking-tight" >
201+ { formatTokenCount ( model . maxOutput ) }
202+ </ p >
203+ </ div >
205204
206205 { model . tokenPricing && (
207206 < div className = "border border-[var(--color-border)] p-[var(--spacing-md)]" >
0 commit comments