Skip to content

armgit / uzu

Public Imported from GitHub
0

A high-performance inference engine for AI models

529 B
Raw Blame
import type { SessionOutputStats } from "@/types/llm-stream";

export type RunMetrics = {
  ttftSec?: number;
  totalSec?: number;
  tps?: number;
  tokensOut: number;
  tokensPerForwardPass?: number;
};

export function getRunMetrics(stats: SessionOutputStats): RunMetrics {
  return {
    ttftSec: stats.prefillStats.duration,
    totalSec: stats.totalStats.duration,
    tps: stats.generateStats?.tokensPerSecond,
    tokensOut: stats.totalStats.tokensCountOutput,
    tokensPerForwardPass: stats.tokensPerForwardPass,
  };
}