okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
c64702b72
main
1<!doctype html > 2< html lang ="en "data-theme ="dark "> 3< head > 4< meta charset ="utf-8 ">< meta name ="viewport "content ="width=device-width, initial-scale=1 "> 5< title > Strata API Monitor</ title > 6< link rel ="icon "href ="/web/favicon.svg "type ="image/svg+xml "> 7< link rel ="stylesheet "href ="/web/tokens.css "> 8< style > 9* { box-sizing : border-box} body { margin : 0 ; background : var ( --st-bg ); color : var ( --st-ink ); font : 15 px/1.5var ( --st-font )} 10button , input , select { font : inherit} button { cursor : pointer; color : inherit; background : var ( --st-surface-2 ); border : 1 px solidvar ( --st-line ); border-radius : 9 px ; padding : 8 px 13 px } button : hover { border-color : var ( --st-accent )} button : disabled { opacity : .4 ; cursor : default} button : focus-visible , input : focus-visible , select : focus-visible { outline : 2 px solidvar ( --st-focus ); outline-offset : 3 px } [hidden ]{ display : none!important } 11header { height : 70 px ; padding : 0 32 px ; display : flex; align-items : center; justify-content : space-between; border-bottom : 1 px solidvar ( --st-line ); background : var ( --st-surface )}. brand { font-size : 23 px ; font-weight : 700 ; letter-spacing : -.5 px }. brand span { font-size : 13 px ; font-weight : 400 ; margin-left : 14 px ; color : var ( --st-ink-muted )} main { max-width : 1560 px ; margin : auto; padding : 28 px 32 px }. top { display : flex; align-items : center; justify-content : space-between; gap : 24 px } h1 { margin : 0 ; font-size : 29 px ; letter-spacing : -.7 px } h2 { font-size : 17 px ; margin : 0 }. sub ,. muted { color : var ( --st-ink-muted )}. sub { margin : 4 px 0 0 }. controls { display : flex; gap : 8 px ; flex-wrap : wrap}. primary { background : var ( --st-accent ); color : var ( --st-accent-ink ); border-color : transparent}. notice { margin-top : 16 px ; padding : 10 px 14 px ; background : var ( --st-danger-tint ); color : var ( --st-danger-text ); border-radius : 9 px }. cards { display : grid; grid-template-columns : 2 fr repeat ( 3 , 1 fr ); gap : 14 px ; margin : 24 px 0 }. card { padding : 18 px 20 px ; border : 1 px solidvar ( --st-line ); border-radius : 13 px ; background : var ( --st-surface )}. label { font-size : 12 px ; color : var ( --st-ink-muted ); text-transform : uppercase; letter-spacing : .8 px }. value { font-size : 28 px ; font-weight : 500 ; line-height : 1.4 ; margin-top : 3 px }. model { font : 12 px var ( --st-font-mono ); overflow-wrap : anywhere; margin-top : 4 px ; color : var ( --st-ink-muted )}. dot { display : inline-block; width : 9 px ; height : 9 px ; border-radius : 100 % ; background : var ( --st-ink-muted ); margin-right : 9 px }. loaded . dot { background : var ( --st-accent )}. busy . dot { background : var ( --st-warn )}. panel { border : 1 px solidvar ( --st-line ); border-radius : 14 px ; background : var ( --st-surface ); overflow : hidden}. panel-bar { padding : 15 px 20 px ; border-bottom : 1 px solidvar ( --st-line ); display : flex; align-items : center; justify-content : space-between; gap : 12 px }. filters { display : flex; gap : 8 px } input , select { color : inherit; border : 1 px solidvar ( --st-line ); background : var ( --st-bg ); padding : 7 px 10 px ; border-radius : 8 px }# search { width : 190 px }. workspace { display : grid; grid-template-columns : minmax ( 340 px , 38 % ) minmax ( 0 , 1 fr ); min-height : 480 px }. requests { border-right : 1 px solidvar ( --st-line ); max-height : 650 px ; overflow : auto}. request { display : block; width : 100 % ; border : 0 ; border-bottom : 1 px solidvar ( --st-line-soft ); border-radius : 0 ; padding : 15 px 20 px ; text-align : left; background : transparent}. request . selected { background : var ( --st-accent-tint ); box-shadow : inset3 px 0 var ( --st-accent )}. request : hover { background : var ( --st-surface-2 )}. row { display : flex; justify-content : space-between; gap : 12 px }. endpoint { font : 12 px var ( --st-font-mono ); margin : 8 px 0 5 px ; overflow-wrap : anywhere}. tag { font-size : 11 px ; border-radius : 5 px ; padding : 2 px 6 px ; background : var ( --st-surface-2 ); color : var ( --st-ink-muted )}. tag . completed { color : var ( --st-accent-text ); background : var ( --st-accent-tint )}. tag . error { color : var ( --st-danger-text ); background : var ( --st-danger-tint )}. tag . loading ,. tag . generating ,. tag . queued { color : var ( --st-warn-text ); background : var ( --st-warn-tint )}. small { font-size : 12 px ; color : var ( --st-ink-muted )}. detail { min-width : 0 ; padding : 20 px }. empty { padding : 70 px 24 px ; text-align : center; color : var ( --st-ink-muted )}. empty strong { display : block; color : var ( --st-ink ); font-size : 18 px ; margin-bottom : 6 px }. detail-title { font : 13 px var ( --st-font-mono )}. facts { display : grid; grid-template-columns : repeat ( 4 , 1 fr ); gap : 10 px ; margin : 18 px 0 }. fact { background : var ( --st-bg ); border-radius : 8 px ; padding : 9 px 11 px }. fact span { font-size : 11 px ; color : var ( --st-ink-muted ); display : block}. fact b { font-weight : 500 ; font-size : 16 px }. tabs { display : flex; align-items : center; gap : 5 px ; border-bottom : 1 px solidvar ( --st-line ); padding-bottom : 10 px }. tabs button { padding : 6 px 10 px ; border-color : transparent; background : transparent; font-size : 13 px }. tabs button [aria-selected = true ]{ background : var ( --st-surface-2 ); color : var ( --st-accent-text )}. tabs # copy { margin-left : auto; border-color : var ( --st-line )} pre { margin : 14 px 0 0 ; padding : 15 px ; background : var ( --st-bg ); border : 1 px solidvar ( --st-line-soft ); border-radius : 9 px ; font : 12 px/1.6var ( --st-font-mono ); white-space : pre-wrap; overflow-wrap : anywhere; max-height : 400 px ; overflow : auto; min-height : 180 px }. detail-error { margin : 12 px 0 ; padding : 10 px 12 px ; border-radius : 8 px ; background : var ( --st-danger-tint ); color : var ( --st-danger-text ); font-size : 12 px ; overflow-wrap : anywhere} footer { margin-top : 14 px ; font-size : 12 px ; color : var ( --st-ink-muted ); display : flex; justify-content : space-between; gap : 20 px }# auth { margin-top : 16 px ; padding : 14 px ; display : flex; gap : 10 px ; align-items : center}# auth input { flex : 1 ; max-width : 400 px } 12@media ( max-width : 950 px ){. cards { grid-template-columns : repeat ( 2 , 1 fr )}. workspace { grid-template-columns : 1 fr }. requests { border-right : 0 ; border-bottom : 1 px solidvar ( --st-line ); max-height : 260 px }. top { align-items : flex-start}. brand span { display : none}} @media ( max-width : 600 px ){ main { padding : 20 px 14 px } header { padding : 0 16 px }. top { flex-direction : column; gap : 14 px }. cards { gap : 8 px }. card { padding : 12 px }. value { font-size : 23 px }. panel-bar { align-items : flex-start; flex-direction : column}# search { width : 160 px }. facts { grid-template-columns : repeat ( 2 , 1 fr )} footer { flex-direction : column; gap : 4 px }} 13</ style > 14< script defer src ="/web/monitor.js "></ script > 15</ head > 16< body > 17< header >< div class ="brand "> Strata< span > Local inference</ span ></ div >< div class ="controls ">< button id ="key "> API key</ button >< button id ="theme "aria-label ="Switch color theme "> Light / dark</ button ></ div ></ header > 18< main > 19< div class ="top ">< div >< h1 > API Monitor</ h1 >< p class ="sub "> Model status and every request, in one place.</ p ></ div >< div class ="controls ">< button id ="load "class ="primary "disabled > Load model</ button >< button id ="unload "disabled > Unload model</ button ></ div ></ div > 20< div id ="error "class ="notice "role ="status "hidden ></ div > 21< form id ="auth "class ="panel "hidden >< label for ="api-key "> API key</ label >< input id ="api-key "type ="password "autocomplete ="off "placeholder ="Only needed if the server has a key ">< button class ="primary "> Connect</ button ></ form > 22< div class ="cards "> 23< div class ="card ">< div class ="label "> Model</ div >< div id ="model-state "class ="value ">< span class ="dot "></ span >< span id ="loaded "> Connecting…</ span ></ div >< div id ="model "class ="model "> 127.0.0.1:5001/v1</ div ></ div > 24< div class ="card ">< div class ="label "> Requests retained</ div >< div id ="count "class ="value "> —</ div >< div id ="active "class ="small "> Waiting for server</ div ></ div > 25< div class ="card ">< div class ="label "> Last wall-clock</ div >< div id ="wall "class ="value "> —</ div >< div class ="small "> Includes queue and model loading</ div ></ div > 26< div class ="card ">< div class ="label "> Average decode speed</ div >< div id ="speed "class ="value "> —</ div >< div class ="small "> Run average · tokens / second</ div ></ div > 27</ div > 28< section class ="panel ">< div class ="panel-bar ">< h2 > Requests</ h2 >< div class ="filters ">< input id ="search "aria-label ="Filter requests "placeholder ="Search ID or endpoint ">< select id ="filter "aria-label ="Request status ">< option value ="all "> All statuses</ option >< option value ="active "> Active</ option >< option value ="completed "> Completed</ option >< option value ="error "> Errors</ option ></ select ></ div ></ div > 29< div class ="workspace ">< div id ="requests "class ="requests "aria-label ="Request list "></ div >< div class ="detail "> 30< div id ="no-selection "class ="empty ">< strong > Inspect a request</ strong > Select a request to see its input, output, and timings.</ div > 31< div id ="selection "hidden >< div class ="row ">< div id ="detail-title "class ="detail-title "></ div >< span id ="detail-status "class ="tag "></ span ></ div >< div id ="detail-time "class ="small "></ div > 32< div class ="facts ">< div class ="fact ">< span > Wall-clock</ span >< b id ="detail-wall "> —</ b ></ div >< div class ="fact ">< span > Model load</ span >< b id ="detail-load "> —</ b ></ div >< div class ="fact ">< span > Queue wait</ span >< b id ="detail-queue "> —</ b ></ div >< div class ="fact ">< span > First token</ span >< b id ="detail-first "> —</ b ></ div >< div class ="fact ">< span > Prompt tokens</ span >< b id ="detail-prompt "> —</ b ></ div >< div class ="fact ">< span > Output tokens</ span >< b id ="detail-tokens "> —</ b ></ div >< div class ="fact ">< span > Decode speed</ span >< b id ="detail-speed "> —</ b ></ div >< div class ="fact ">< span > Response format</ span >< b id ="detail-format "> —</ b ></ div ></ div > 33< div id ="detail-error "class ="detail-error "hidden ></ div >< div class ="tabs "role ="tablist "aria-label ="Request content ">< button role ="tab "data-pane ="input "aria-selected ="true "> Input</ button >< button role ="tab "data-pane ="output "aria-selected ="false "> Output</ button >< button role ="tab "data-pane ="reasoning "aria-selected ="false "> Reasoning</ button >< button role ="tab "data-pane ="response "aria-selected ="false "> API response</ button >< button id ="copy "> Copy</ button ></ div > 34< div id ="content-note "class ="small "style ="margin-top:10px "></ div >< pre id ="content "role ="tabpanel "aria-label ="Request content "></ pre ></ div > 35</ div ></ div ></ section > 36< footer >< span > Last 100 requests kept in memory until restart. Inputs and outputs stay on this machine.</ span >< span id ="updated "> Connecting…</ span ></ footer > 37</ main > 38</ body ></ html >