okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
18bce49fe
main
1# bench_battery.ps1 — house-protocol battery on the live serve (stock 0.1.39) 2# 4K/32K/104K/130K prompts, greedy, 256-token cap, unique nonce per run. 3$ErrorActionPreference ="Continue" 4$h =Invoke-RestMethod -Uri http://127.0.0.1:8080/health -TimeoutSec5 5$model =$h .model 6"battery start $( Get-Date -Format 'HH:mm:ss') model= $model " |Out-File -Append -Encoding ascii C:\Strata\bench-battery.log 7$base ="Explain what this function does, name its edge cases, and describe how you would test it. " 8$sizes = @{"4K" =270 ;"32K" =2175 ;"104K" =6900 ;"130K" =8630 } 9foreach ($name in @("4K" ,"32K" ,"104K" ,"130K" )) { 10$rep =$sizes [$name ] 11foreach ($i in1..3 ) { 12$prompt = ("Run marker " + [guid ]::NewGuid ().ToString ()+ ". " )+ ($base * $rep ) 13$body = @{ model =$model ; messages = @(@{ role ="user" ; content =$prompt }); max_tokens =256 ; temperature =0 } |ConvertTo-Json -Depth5 14$sw = [System.Diagnostics.Stopwatch ]::StartNew () 15try { 16$r =Invoke-RestMethod -Uri http://127.0.0.1:8080/v1/chat/completions -Method Post -Body$body -ContentType"application/json" -TimeoutSec600 17$sw .Stop () 18 ("{0} run{1}: wall {2:N2}s ptok {3} gen {4}" -f$name ,$i ,$sw .Elapsed .TotalSeconds ,$r .usage .prompt_tokens ,$r .usage .completion_tokens ) |Out-File -Append -Encoding ascii C:\Strata\bench-battery.log 19 }catch { 20 ("{0} run{1}: ERROR {2}" -f$name ,$i ,$_ .Exception .Message ) |Out-File -Append -Encoding ascii C:\Strata\bench-battery.log 21 } 22 } 23} 24"battery done $( Get-Date -Format 'HH:mm:ss')" |Out-File -Append -Encoding ascii C:\Strata\bench-battery.log