@@ -34,18 +34,20 @@ import { record, formatHistory, formatCollapsedLine, latestFor, type History, ty
3434import { emptyPanels , lineFor , keyFor , setLine , LatestPerKey , type Panels } from "./panels"
3535
3636import { fetchMtplxLatest , formatMtplxLine , combineMtplxSteps , type MtplxLatest } from "./adapters/mtplx"
37- import { fetchOmlxSample , formatOmlxLine , type OmlxSample } from "./adapters/omlx"
37+ import { fetchOmlxSample , formatOmlxLine , omlxIsThisTurn , type OmlxSample } from "./adapters/omlx"
3838import {
3939 fetchLlamaCppCounters ,
4040 diffLlamaCppCounters ,
4141 formatLlamaCppLine ,
42+ llamaCppIsThisTurn ,
4243 type LlamaCppCounters ,
4344} from "./adapters/llamacpp"
4445import { fetchMlxServeRequests , mlxServeTurn , formatMlxServeLine , combineMlxServeSteps , type MlxServeRequest } from "./adapters/mlxserve"
4546import {
4647 fetchSplashSample ,
4748 diffSplashSamples ,
4849 formatSplashLine ,
50+ splashIsThisTurn ,
4951 type SplashSample ,
5052} from "./adapters/splash"
5153import { fetchKoboldPerf , koboldTurn , formatKoboldLine , combineKoboldSteps , type KoboldPerf } from "./adapters/koboldcpp"
@@ -376,8 +378,20 @@ export default Plugin.define({
376378 setBase ( ( d ) => {
377379 d . omlx = now
378380 } )
379- if ( prev ) match ( now . completion - prev . completion , `; requests ${ now . requests - prev . requests } ` )
380- return formatOmlxLine ( now , prev , hostTtft )
381+ if ( prev ) {
382+ match ( now . completion - prev . completion , `; requests ${ now . requests - prev . requests } , steps ${ steps . length } ` )
383+ // A window that isn't this turn's -- a spare request, or tokens
384+ // that don't match -- is declined. The no-baseline render below
385+ // is labelled as the server's averages and needs no check.
386+ if ( now . requests > prev . requests && ! omlxIsThisTurn ( prev , now , { tokens : hostTokens , steps : steps . length } ) ) {
387+ tier2 . sharedWindow = true
388+ return null
389+ }
390+ }
391+ return formatOmlxLine ( now , prev , hostTtft , {
392+ ...hostFigures ,
393+ decodeTokS : turnRate ( hostTokens , info , turn ) . decodeTokS ,
394+ } )
381395 }
382396
383397 // llamafile is llama.cpp-derived and publishes identical metric names,
@@ -398,8 +412,13 @@ export default Plugin.define({
398412 return null
399413 }
400414 const t = diffLlamaCppCounters ( prev , now )
401- if ( t ) match ( t . completionTokens )
402- return t ? formatLlamaCppLine ( t , label , model , hostTtft ) : null
415+ if ( ! t ) return null
416+ match ( t . completionTokens , `; steps ${ steps . length } ` )
417+ if ( ! llamaCppIsThisTurn ( t , hostTokens ) ) {
418+ tier2 . sharedWindow = true
419+ return null
420+ }
421+ return formatLlamaCppLine ( t , label , model , hostTtft , hostFigures )
403422 }
404423
405424 case "splash" : {
@@ -414,8 +433,13 @@ export default Plugin.define({
414433 return null
415434 }
416435 const t = diffSplashSamples ( prev , now )
417- if ( t ) match ( t . completionTokens , `; requests ${ t . requests } ` )
418- return t ? formatSplashLine ( t , model , hostTtft ) : null
436+ if ( ! t ) return null
437+ match ( t . completionTokens , `; requests ${ t . requests } , steps ${ steps . length } ` )
438+ if ( ! splashIsThisTurn ( t , { tokens : hostTokens , steps : steps . length } ) ) {
439+ tier2 . sharedWindow = true
440+ return null
441+ }
442+ return formatSplashLine ( t , model , hostTtft , { ...hostFigures , steps : steps . length } )
419443 }
420444
421445 case "koboldcpp" :
0 commit comments