@@ -159,6 +159,16 @@ function generateStats(baseMultiplier: number, periodMultiplier: number, applica
159159 const avgOutputCost = ( 0.7 * 0.6 + 0.2 * 10 + 0.1 * 4.4 ) / 1000 ;
160160 const avgCachedCost = ( 0.7 * 0.075 + 0.2 * 1.25 + 0.1 * 0.55 ) / 1000 ;
161161
162+ cost = ( inputTokensNum / 1000 ) * avgInputCost +
163+ ( outputTokensNum / 1000 ) * avgOutputCost +
164+ ( Number ( cachedTokens ) / 1000 ) * avgCachedCost ;
165+ } else if ( application === "kilo_cli" ) {
166+ // Kilo CLI — mix of free and paid models via OpenRouter; weighted average
167+ // ~40% glm-5 (paid), ~30% aurora-alpha (free), ~30% trinity (free)
168+ const avgInputCost = ( 0.4 * 0.6 ) / 1000 ;
169+ const avgOutputCost = ( 0.4 * 0.6 ) / 1000 ;
170+ const avgCachedCost = ( 0.4 * 0.06 ) / 1000 ;
171+
162172 cost = ( inputTokensNum / 1000 ) * avgInputCost +
163173 ( outputTokensNum / 1000 ) * avgOutputCost +
164174 ( Number ( cachedTokens ) / 1000 ) * avgCachedCost ;
@@ -256,7 +266,7 @@ async function clearDatabase() {
256266}
257267
258268// Helpers to generate realistic message_stats rows for the stats API
259- const APPLICATIONS = [ "claude_code" , "gemini_cli" , "codex_cli" , "copilot" ] as const ;
269+ const APPLICATIONS = [ "claude_code" , "gemini_cli" , "codex_cli" , "copilot" , "kilo_cli" ] as const ;
260270const MODELS_BY_APP : Record < ( typeof APPLICATIONS ) [ number ] , string [ ] > = {
261271 claude_code : [
262272 "claude-3.7-sonnet" ,
@@ -267,6 +277,7 @@ const MODELS_BY_APP: Record<(typeof APPLICATIONS)[number], string[]> = {
267277 gemini_cli : [ "gemini-1.5-pro" , "gemini-1.5-flash" , "gemini-2.0-flash" ] ,
268278 codex_cli : [ "gpt-4o-mini" , "gpt-4o" , "o3-mini" ] ,
269279 copilot : [ "gpt-4o" , "gpt-4o-mini" ] ,
280+ kilo_cli : [ "claude-3.5-sonnet" , "gpt-4o-mini" , "gemini-2.0-flash" ] ,
270281} ;
271282
272283function randInt ( min : number , max : number ) {
@@ -308,10 +319,11 @@ async function createMessageStats(users: Array<{ id: string; multiplier: number
308319
309320 // Per-application usage distribution (sum to 1.0)
310321 const appWeights : Record < ( typeof APPLICATIONS ) [ number ] , number > = {
311- claude_code : 0.5 ,
312- gemini_cli : 0.25 ,
322+ claude_code : 0.45 ,
323+ gemini_cli : 0.22 ,
313324 codex_cli : 0.1 ,
314- copilot : 0.15 ,
325+ copilot : 0.13 ,
326+ kilo_cli : 0.1 ,
315327 } ;
316328
317329 // Simulate up to this many days of history
@@ -484,6 +496,23 @@ async function createMessageStats(users: Array<{ id: string; multiplier: number
484496 outputCostPerK = 10 / 1000 ;
485497 cachedCostPerK = 1.25 / 1000 ;
486498 }
499+ } else if ( app === "kilo_cli" ) {
500+ // Kilo CLI models (free-tier OpenRouter models via Kilo gateway)
501+ if ( model === "z-ai/glm-5:free" ) {
502+ inputCostPerK = 0.6 / 1000 ;
503+ outputCostPerK = 0.6 / 1000 ;
504+ cachedCostPerK = 0.06 / 1000 ;
505+ } else if ( model === "openrouter/aurora-alpha" ) {
506+ // Free model — zero cost
507+ inputCostPerK = 0 ;
508+ outputCostPerK = 0 ;
509+ cachedCostPerK = 0 ;
510+ } else if ( model === "arcee-ai/trinity-large-preview:free" ) {
511+ // Free model — zero cost
512+ inputCostPerK = 0 ;
513+ outputCostPerK = 0 ;
514+ cachedCostPerK = 0 ;
515+ }
487516 }
488517
489518 // Calculate total cost
@@ -599,7 +628,7 @@ async function createPeriodStats(users: Array<{ id: string; multiplier: number }
599628 console . log ( "📊 Creating period statistics..." ) ;
600629
601630 const periods = getPeriodDates ( ) ;
602- const applications = [ "claude_code" , "gemini_cli" , "codex_cli" ] as const ;
631+ const applications = [ "claude_code" , "gemini_cli" , "codex_cli" , "kilo_cli" ] as const ;
603632
604633 // Period multipliers (how much activity in each period)
605634 const periodMultipliers = {
@@ -612,9 +641,10 @@ async function createPeriodStats(users: Array<{ id: string; multiplier: number }
612641
613642 // Application usage distribution for each user
614643 const applicationWeights = {
615- claude_code : 0.6 , // 60 % usage
616- gemini_cli : 0.3 , // 30 % usage
644+ claude_code : 0.55 , // 55 % usage
645+ gemini_cli : 0.25 , // 25 % usage
617646 codex_cli : 0.1 , // 10% usage
647+ kilo_cli : 0.1 , // 10% usage
618648 } ;
619649
620650 let processedUsers = 0 ;
@@ -662,7 +692,7 @@ async function createPeriodStats(users: Array<{ id: string; multiplier: number }
662692 }
663693 }
664694
665- const totalStats = users . length * 5 * applications . length ; // 5 periods, 3 applications
695+ const totalStats = users . length * 5 * applications . length ; // 5 periods × ${applications.length} applications
666696 console . log ( `✅ Created ${ totalStats . toLocaleString ( ) } period statistics for ${ users . length } users` ) ;
667697}
668698
@@ -702,9 +732,9 @@ async function main() {
702732 console . log ( "" ) ;
703733 console . log ( "📊 Summary:" ) ;
704734 console . log ( ` • ${ users . length } users created` ) ;
705- console . log ( ` • ${ ( users . length * 5 * 3 ) . toLocaleString ( ) } total UserStats records` ) ;
735+ console . log ( ` • ${ ( users . length * 5 * 4 ) . toLocaleString ( ) } total UserStats records (5 periods × 4 apps) ` ) ;
706736 console . log ( ` • ${ users . length } API tokens created` ) ;
707- console . log ( " • MessageStats generated for up to 120 days, 3 applications, multiple conversations/day" ) ;
737+ console . log ( " • MessageStats generated for up to 120 days, 5 applications, multiple conversations/day" ) ;
708738 console . log ( "" ) ;
709739 console . log ( "📈 Generated data for all time periods:" ) ;
710740 console . log ( " • Hourly (current hour)" ) ;
@@ -714,9 +744,10 @@ async function main() {
714744 console . log ( " • Yearly (current year)" ) ;
715745 console . log ( "" ) ;
716746 console . log ( "🚀 Generated data for all applications:" ) ;
717- console . log ( " • Claude Code (60 % usage)" ) ;
718- console . log ( " • Gemini CLI (30 % usage)" ) ;
747+ console . log ( " • Claude Code (55 % usage)" ) ;
748+ console . log ( " • Gemini CLI (25 % usage)" ) ;
719749 console . log ( " • Codex CLI (10% usage)" ) ;
750+ console . log ( " • Kilo CLI (10% usage)" ) ;
720751 console . log ( "" ) ;
721752 console . log ( "📈 User distribution:" ) ;
722753 console . log ( " • Most users have multipliers around 1.0 (normal distribution)" ) ;
0 commit comments