okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
2cf6f8a6d
main
1#!/usr/bin/env python3 2"""Live check (0.1.39 rerun of 2026-10-03/strata-512k-live) of the running Strata 512K server (127.0.0.1:8080): long-prompt speed and recall at 332K/120K/240K/480K, then short follow-ups for stability (upstream #606), with RAM sampled. Reuses 4scripts/strata/ctx_sweep.py's haystack and chat helpers against the live port.""" 5import json ,sys ,threading ,time 6sys .path .insert (0 ,"~/bench-scripts" ) 7import ctx_sweep as cs 8cs .PORT = 8080 9out = "./results.jsonl" 10mem = {"min_avail" :99.0 ,"max_swap" :0.0 } 11def sample (): 12while True : 13m = dict (l .split (":" )[0 :2 ]for l in open ("/proc/meminfo" )) 14a = int (m ["MemAvailable" ].split ()[0 ])/ 1048576 15sw = (int (m ["SwapTotal" ].split ()[0 ])- int (m ["SwapFree" ].split ()[0 ]))/ 1048576 16mem ["min_avail" ]= min (mem ["min_avail" ],a );mem ["max_swap" ]= max (mem ["max_swap" ],sw ) 17time .sleep (1 ) 18threading .Thread (target = sample ,daemon = True ).start () 19def log (rec ): 20rec .update ({k :round (v ,2 )for k ,v in mem .items ()}) 21json .dumps (rec ),flush = True ) 22open (out ,"a" ).write (json .dumps (rec )+ "\n" ) 23for n in (32000 ,120000 ,240000 ,480000 ): 24text ,secret = cs .haystack (n ,seed = 11 ) 25q = "\n\nWhat is the vault rotation code? Answer with the number only." 26t0 = time .time ();r = cs .chat (text + q ,48 ) 27r2 = cs .chat (text + q + "\n\nThen write a 200-word summary of what these logs show." ,300 ) 28log ({"target" :n ,"prompt_tokens" :r ["prompt_tokens" ],"read_secs" :r ["secs" ],"prefill_tps" :r ["prefill_tps" ], 29"recall" :secret in r ["text" ],"answer" :r ["text" ][:40 ],"decode_at_depth" :r2 ["decode_tps" ], 30"summary_head" :r2 ["text" ][:120 ]}) 31for i ,p in enumerate (["What is 17 * 23? Answer with the number only." , 32"Name the capital of France in one word." , 33"Write a Python one-liner that reverses a string s." ]): 34r = cs .chat (p ,80 ) 35log ({"followup" :i ,"text" :r ["text" ][:100 ],"decode_tps" :r ["decode_tps" ]}) 36log ({"done" :True })