evals-lab 0.1.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,10 +5,10 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <meta name="color-scheme" content="dark light">
7
7
  <title>Components</title>
8
- <script type="module" crossorigin src="/assets/gallery-DipkRvqJ.js"></script>
9
- <link rel="modulepreload" crossorigin href="/assets/tokens-B9intIuT.js">
10
- <link rel="stylesheet" crossorigin href="/assets/tokens-s6I-RMVq.css">
11
- <link rel="stylesheet" crossorigin href="/assets/gallery-o7c4lfpn.css">
8
+ <script type="module" crossorigin src="/assets/gallery-DRBlZ8mP.js"></script>
9
+ <link rel="modulepreload" crossorigin href="/assets/tokens-iGpvbD5R.js">
10
+ <link rel="stylesheet" crossorigin href="/assets/tokens-BEn6_hVz.css">
11
+ <link rel="stylesheet" crossorigin href="/assets/gallery-DFeJkfUw.css">
12
12
  </head>
13
13
  <body>
14
14
  <!-- The fixtures gallery: every component in every state, for the eye and
@@ -5,10 +5,10 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <meta name="color-scheme" content="dark light">
7
7
  <title>Evals Lab</title>
8
- <script type="module" crossorigin src="/assets/main-61NS6C4m.js"></script>
9
- <link rel="modulepreload" crossorigin href="/assets/tokens-B9intIuT.js">
10
- <link rel="stylesheet" crossorigin href="/assets/tokens-s6I-RMVq.css">
11
- <link rel="stylesheet" crossorigin href="/assets/main-DjQQums6.css">
8
+ <script type="module" crossorigin src="/assets/main-DMpQmW8l.js"></script>
9
+ <link rel="modulepreload" crossorigin href="/assets/tokens-iGpvbD5R.js">
10
+ <link rel="stylesheet" crossorigin href="/assets/tokens-BEn6_hVz.css">
11
+ <link rel="stylesheet" crossorigin href="/assets/main-wfqC6HcM.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evals-lab",
3
- "version": "0.1.4",
3
+ "version": "0.3.0",
4
4
  "description": "A browser bench for grading what a model answers: two wordings side by side over a set of files, scored against answers fixed in advance.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "Grainbox Limited",
@@ -9,7 +9,8 @@
9
9
  },
10
10
  "files": [
11
11
  "bin/",
12
- "lab/"
12
+ "lab/",
13
+ "CHANGELOG.md"
13
14
  ],
14
15
  "engines": {
15
16
  "node": ">=22.18"
@@ -1,3 +0,0 @@
1
- import{R as e,T as t,X as n,Y as r,_ as i,c as a,d as o,f as s,g as c,h as l,m as u,n as d,r as f,v as p}from"./tokens-B9intIuT.js";var m=n(),h=r(),g=[{id:`text`,label:`Plain text`,settings:[]},{id:`list`,label:`List`,settings:[{key:`parse`,label:`Parse as`,type:`select`,choices:[{value:`csv`,label:`CSV`},{value:`lines`,label:`One a line`},{value:`json`,label:`JSON array`}]},{key:`preamble`,label:`Ignore preamble`,type:`checkbox`}]}],_=[{id:`case`,label:`Case`,accepts:[`list`],options:[{key:`mode`,label:`Mode`,type:`select`,choices:[{value:`LOWER`,label:`lower`},{value:`SENTENCE`,label:`Sentence`},{value:`TITLE`,label:`Title`},{value:`UPPER`,label:`UPPER`},{value:`NONE`,label:`As replied`}]}],defaults:()=>({type:`case`,mode:`LOWER`})},{id:`join`,label:`Join`,accepts:[`list`],options:[{key:`with`,label:`Separator`,type:`text`}],defaults:()=>({type:`join`,with:`, `})}],v=[{name:`language`,type:`value`,value:`English UK`},{name:`geo-location`,type:`value`,value:`Hamilton, Waikato, New Zealand`},{name:`geo`,type:`block`,enabled:!1}],y=[{path:`group/open`,title:`Group, open`},{path:`group/closed`,title:`Group, closed with a note`},{path:`group/no-menu`,title:`Group without actions`},{path:`group/sub`,title:`Sub-group, level 3`},{path:`group/depth`,title:`Group, three levels deep`},{path:`group/renaming`,title:`Group, renaming`},{path:`menu/disabled`,title:`Menu with a disabled item`},{path:`repeater/empty`,title:`Repeater, empty`},{path:`repeater/min`,title:`Repeater at min 1`},{path:`repeater/between`,title:`Repeater, two of four`},{path:`repeater/max`,title:`Repeater at max`},{path:`props/controls`,title:`Property table, every control`},{path:`props/required`,title:`Property table, required only`},{path:`props/long`,title:`Property table, long values`},{path:`props/widths`,title:`Property table, a width per value`},{path:`props/secret`,title:`Property table, a key held and not held`},{path:`props/code`,title:`Property table, an endpoint and a payload`},{path:`table/sortable`,title:`Table, sortable headers and a row menu`},{path:`table/paged`,title:`Table, paged ten at a time`},{path:`table/filter`,title:`Table with a filter bar`},{path:`table/filter-on`,title:`Table, filtered, with a scope`},{path:`edit/form`,title:`Edit modal, a profile`},{path:`edit/plain`,title:`Edit modal, one section and no menu`},{path:`edit/long`,title:`Edit modal, a form that scrolls`},{path:`edit/status`,title:`Edit modal, a status that is a refusal`},{path:`view/tokens`,title:`Token mappings`},{path:`view/output`,title:`Output with Case`},{path:`view/output-text`,title:`Output, plain text`},{path:`view/output-two`,title:`Output with two modifiers`},{path:`view/output-twice`,title:`Output with the same modifier twice`}],b=e(),x=()=>{},S=(...e)=>e.map(e=>({label:e,icon:e===`Remove`?p.remove:e===`Clone`?p.clone:p.rename,onSelect:x,destructive:e===`Remove`}));function C({start:e,min:t,max:n}){let[r,i]=(0,m.useState)(e);return(0,b.jsx)(l,{noun:`scenario`,items:r,...t===void 0?{}:{min:t},...n===void 0?{}:{max:n},onAdd:()=>i([...r,`Scenario ${r.length+1}`]),onRemove:e=>i(r.filter((t,n)=>n!==e)),onClone:e=>i([...r.slice(0,e+1),`${r[e]} copy`,...r.slice(e+1)]),onRename:x,empty:`No scenarios yet.`,renderItem:(e,t,n)=>(0,b.jsx)(c,{id:`scenario-${t}`,title:e,level:3,actions:n,children:(0,b.jsx)(`p`,{className:`note`,children:`A Setup profile and a prompt for each job.`})},`${e}-${t}`)})}function w(){let[e,t]=(0,m.useState)(v),n=(n,r)=>t(e.map(e=>e.name===n?{...e,...r}:e));return(0,b.jsx)(d,{mappings:e,onValue:(e,t)=>n(e,{value:t}),onEnabled:(e,t)=>n(e,{enabled:t}),onEdit:x,onRemove:n=>t(e.filter(e=>e.name!==n)),onAdd:()=>t([...e,{name:`token${e.length+1}`,type:`value`,value:``}])})}function T({start:e}){let[t,n]=(0,m.useState)(e);return(0,b.jsx)(f,{id:`output`,out:t,outputKinds:g,modifiers:_,onKind:e=>n({kind:e,modifiers:t.modifiers.filter(t=>_.find(e=>e.id===t.type)?.accepts.includes(e))}),onModifier:(e,r)=>n({...t,modifiers:t.modifiers.map((t,n)=>n===e?r:t)}),onAddModifier:e=>n({...t,modifiers:[...t.modifiers,e]}),onRemoveModifier:e=>n({...t,modifiers:t.modifiers.filter((t,n)=>n!==e)})})}function E(){let[e,t]=(0,m.useState)(`Job 1`),[n,r]=(0,m.useState)(!0);return(0,b.jsx)(c,{id:`renaming`,title:e,actions:[{label:`Rename`,icon:p.rename,onSelect:()=>r(!0)}],...n?{rename:{value:e,onCommit:n=>{t(n||e),r(!1)},onCancel:()=>r(!1)}}:{},children:(0,b.jsx)(`p`,{className:`note`,children:`Enter or leaving keeps the name; Escape cancels.`})})}function D({sections:e,menu:n,status:r,statusBad:i,outcome:a}){return(0,b.jsx)(o,{title:`Lab Ollama`,...r?{status:r}:{},...i?{statusBad:!0}:{},...n?{menu:n}:{},sections:e,actions:[{label:`Test connection`,icon:t,onSelect:x,outcome:a?{label:a,onOpen:x}:void 0}],onClose:x})}var O=()=>[{key:`name`,label:`Name`,required:!0,control:{type:`text`,value:`Lab Ollama`,onChange:x}},{key:`type`,label:`Type`,required:!0,control:{type:`select`,value:`ollama`,onChange:x,options:[{value:`ollama`,label:`Ollama (Local)`},{value:`anthropic`,label:`Anthropic`}]}},{key:`url`,label:`Address`,control:{type:`text`,value:``,placeholder:`the lab's Ollama`,onChange:x}},{key:`key`,label:`Key`,control:{type:`secret`,value:``,onChange:x}},{key:`model`,label:`Model`,control:{type:`text`,value:`minicpm-v4.6:latest`,onChange:x}}],k=()=>[{key:`seed`,label:`Seed`,control:{type:`text`,value:``,placeholder:`1234`,marker:`default`,onChange:x}},{key:`nPredict`,label:`Reply tokens`,control:{type:`text`,value:``,size:`num`,marker:`server`,onChange:x}},{key:`temperature`,label:`Temperature`,control:{type:`text`,value:`0.3`,onChange:x}},{key:`repeatPenalty`,label:`Repeat penalty`,control:{type:`text`,value:``,size:`num`,marker:`server`,onChange:x}}],A=()=>[{key:`endpoint`,label:`Endpoint`,required:!0,control:{type:`code`,text:`http://127.0.0.1:11434/api/chat`}},{key:`prompt`,label:`Prompt`,required:!0,control:{type:`static`,text:`(prompt)`}},{key:`model`,label:`model`,control:{type:`code`,text:`minicpm-v4.6:latest`}},{key:`options`,label:`options`,control:{type:`code`,text:`{"seed":1234,"temperature":0.3}`}}],j={key:`kind`,label:`Kind`,required:!0,control:{type:`select`,value:`list`,onChange:x,options:g.map(e=>({value:e.id,label:e.label}))}},M={"group/open":()=>(0,b.jsx)(c,{id:`g`,title:`Tests`,actions:S(`Change`,`Remove`),children:(0,b.jsx)(`p`,{className:`note`,children:`The graded set.`})}),"group/closed":()=>(0,b.jsx)(c,{id:`g`,title:`Content`,open:!1,note:`Sample library, 63 files`,actions:S(`Change`,`Remove`)}),"group/no-menu":()=>(0,b.jsx)(c,{id:`g`,title:`Mapping`,children:(0,b.jsx)(`p`,{className:`note`,children:`Nothing to do to it.`})}),"group/sub":()=>(0,b.jsx)(c,{id:`g`,title:`Job 1`,actions:S(`Rename`,`Remove`),children:(0,b.jsx)(c,{id:`g-sub`,title:`Scenarios`,level:3,actions:S(`Clear`),children:(0,b.jsx)(`p`,{className:`note`,children:`Inside a pane.`})})}),"group/depth":()=>(0,b.jsxs)(c,{id:`g`,title:`Job 1`,actions:S(`Rename`,`Remove`),children:[(0,b.jsxs)(c,{id:`g-scenarios`,title:`Scenarios`,level:3,children:[(0,b.jsx)(c,{id:`g-plain`,title:`Plain`,level:3,actions:S(`Rename`,`Remove`),children:(0,b.jsx)(`p`,{className:`note`,children:`A pane, a section of it, and a thing with a name inside that section.`})}),(0,b.jsx)(c,{id:`g-strict`,title:`Strict`,level:3,actions:S(`Rename`,`Remove`)})]}),(0,b.jsx)(c,{id:`g-output`,title:`Output`,level:3,children:(0,b.jsx)(`p`,{className:`note`,children:`The next section of the same pane.`})})]}),"group/renaming":()=>(0,b.jsx)(E,{}),"menu/disabled":()=>(0,b.jsx)(c,{id:`g`,title:`Scenario 4`,actions:[{label:`Rename`,icon:p.rename,onSelect:x},{label:`Clone`,icon:p.clone,onSelect:x,disabled:!0},{label:`Remove`,icon:p.remove,onSelect:x,destructive:!0}]}),"repeater/empty":()=>(0,b.jsx)(C,{start:[]}),"repeater/min":()=>(0,b.jsx)(C,{start:[`Scenario 1`],min:1}),"repeater/between":()=>(0,b.jsx)(C,{start:[`Scenario 1`,`Scenario 2`],min:1,max:4}),"repeater/max":()=>(0,b.jsx)(C,{start:[`Scenario 1`,`Scenario 2`,`Scenario 3`,`Scenario 4`],min:1,max:4}),"props/controls":()=>(0,b.jsx)(s,{label:`Controls`,onRename:x,onRemove:x,onAdd:x,addLabel:`Add row`,rows:[j,{key:`language`,label:`{language}`,code:!0,control:{type:`text`,value:`English UK`,onChange:x}},{key:`geo`,label:`{geo}…{/geo}`,code:!0,control:{type:`static`,text:`Block`},enabled:{checked:!0,onChange:x}},{key:`image`,label:`Image`,control:{type:`checkbox`,checked:!0,label:`Send`,onChange:x}}]}),"props/required":()=>(0,b.jsx)(s,{label:`Output`,onRemove:x,rows:[j]}),"props/long":()=>(0,b.jsx)(s,{label:`Long`,onRemove:x,rows:[{key:`geo-location`,label:`{geo-location}`,code:!0,control:{type:`text`,value:`Hamilton, Waikato, New Zealand, Southern Hemisphere, Earth`,onChange:x}},{key:`averylongtokennamethatdoesnotbreak`,label:`{averylongtokennamethatdoesnotbreak}`,code:!0,control:{type:`text`,value:``,onChange:x}}]}),"props/widths":()=>(0,b.jsx)(s,{label:`Widths`,rows:[{key:`type`,label:`Type`,required:!0,control:{type:`select`,value:`ollama`,onChange:x,options:[{value:`ollama`,label:`Ollama (Local)`},{value:`anthropic`,label:`Anthropic`}]}},{key:`url`,label:`Address`,control:{type:`text`,value:``,placeholder:`the lab's Ollama`,onChange:x}},{key:`model`,label:`Model`,control:{type:`text`,value:`minicpm-v4.6:latest`,onChange:x}},{key:`seed`,label:`Seed`,control:{type:`text`,value:``,placeholder:`1234`,marker:`default`,onChange:x}},{key:`nPredict`,label:`Reply tokens`,control:{type:`text`,value:``,size:`num`,marker:`server`,onChange:x}},{key:`temperature`,label:`Temperature`,control:{type:`text`,value:`0.2`,onChange:x}},{key:`grammar`,label:`Grammar`,control:{type:`textarea`,value:`root ::= item (", " item)*
2
- item ::= [a-z ]+`,onChange:x}}]}),"props/secret":()=>(0,b.jsx)(s,{label:`Keys`,rows:[{key:`held`,label:`Key`,control:{type:`secret`,value:`sk-not-a-real-key-0000`,onChange:x}},{key:`empty`,label:`Key`,control:{type:`secret`,value:``,onChange:x}}]}),"props/code":()=>(0,b.jsx)(s,{label:`Debug`,rows:[{key:`endpoint`,label:`Endpoint`,required:!0,control:{type:`code`,text:`https://api.anthropic.com/v1/messages`}},{key:`prompt`,label:`Prompt`,required:!0,control:{type:`static`,text:`(prompt)`}},{key:`model`,label:`model`,control:{type:`code`,text:`claude-sonnet-4-5-20250929`}},{key:`options`,label:`options`,control:{type:`code`,text:`{"seed":1234,"temperature":0}`}},{key:`stream`,label:`stream`,control:{type:`code`,text:`false`}}]}),"table/sortable":()=>(0,b.jsx)(I,{count:4}),"table/paged":()=>(0,b.jsx)(I,{count:35,pageSize:10}),"table/filter":()=>(0,b.jsx)(F,{}),"table/filter-on":()=>(0,b.jsx)(F,{search:`IMG_40`,size:`large`}),"edit/form":()=>(0,b.jsx)(D,{outcome:`Connected`,menu:[{label:`Restore…`,icon:p.restore,onSelect:x},{label:`Apply preset: repeat 1.3`,icon:p.preset,onSelect:x}],sections:[{key:`identity`,rows:O()},{key:`settings`,title:`Settings`,rows:k()},{key:`debug`,title:`Debug`,rows:A(),folded:!0}]}),"edit/plain":()=>(0,b.jsx)(o,{title:`A mapping`,sections:[{key:`one`,rows:[j,{key:`with`,label:`Separator`,control:{type:`text`,value:`, `,onChange:x}}]}],onClose:x}),"edit/long":()=>(0,b.jsx)(D,{menu:[{label:`Restore…`,icon:p.restore,onSelect:x,disabled:!0}],sections:[{key:`identity`,rows:O()},{key:`settings`,title:`Settings`,rows:[...k(),{key:`grammar`,label:`Grammar`,control:{type:`textarea`,value:`root ::= item (", " item)*
3
- item ::= [a-z ]+`,onChange:x}},{key:`imagePosition`,label:`Image position`,control:{type:`select`,value:`after`,onChange:x,options:[{value:`before`,label:`before the prompt`},{value:`after`,label:`after the prompt`}]}},{key:`cachePrompt`,label:`Cache prompt`,control:{type:`select`,value:`off`,onChange:x,options:[{value:`on`,label:`on`},{value:`off`,label:`off`}]}}]},{key:`debug`,title:`Debug`,rows:A(),folded:!0}]}),"edit/status":()=>(0,b.jsx)(D,{status:`the relay could not reach http://127.0.0.1:11434`,statusBad:!0,sections:[{key:`identity`,rows:O()}]}),"view/tokens":()=>(0,b.jsx)(c,{id:`g`,title:`Token mappings`,level:3,children:(0,b.jsx)(w,{})}),"view/output":()=>(0,b.jsx)(T,{start:{kind:`list`,parse:`csv`,modifiers:[{type:`case`,mode:`LOWER`}]}}),"view/output-text":()=>(0,b.jsx)(T,{start:{kind:`text`,modifiers:[]}}),"view/output-two":()=>(0,b.jsx)(T,{start:{kind:`list`,parse:`csv`,modifiers:[{type:`case`,mode:`TITLE`},{type:`join`,with:` | `}]}}),"view/output-twice":()=>(0,b.jsx)(T,{start:{kind:`list`,parse:`csv`,modifiers:[{type:`case`,mode:`TITLE`},{type:`case`,mode:`LOWER`}]}})},N=y.map(e=>({...e,render:M[e.path]})),P=e=>Array.from({length:e},(e,t)=>({name:`IMG_${String(4e3+t*7919%97).padStart(4,`0`)}.jpg`,kb:t*37%900+40}));function F({search:e=``,size:t=`all`}){let[n,r]=(0,m.useState)(e),[i,o]=(0,m.useState)(t),[s,l]=(0,m.useState)(`shoot`),d=P(12),f=d.filter(e=>e.name.toLowerCase().includes(n.trim().toLowerCase())&&(i===`all`||i===`large`==e.kb>=400));return(0,b.jsxs)(c,{id:`files`,title:`Files`,children:[(0,b.jsx)(u,{noun:`files`,search:{label:`Name`,placeholder:`Search names`,value:n,onChange:r},count:{shown:f.length,total:d.length},filters:[{key:`source`,label:`Source`,value:s,neutral:null,onChange:l,options:[{value:`shoot`,label:`Tuesday shoot`},{value:`samples`,label:`Sample library`}]},{key:`size`,label:`Size`,value:i,onChange:o,options:[{value:`all`,label:`All`},{value:`small`,label:`Small`},{value:`large`,label:`Large`}]}]}),f.length?(0,b.jsx)(a,{label:`Files`,rows:f,rowKey:e=>e.name,columns:[{key:`name`,header:`Name`,cell:e=>e.name},{key:`size`,header:`Size`,sort:e=>e.kb,cell:e=>`${e.kb} KB`}]}):(0,b.jsx)(`p`,{className:`note`,children:`No files match these filters.`})]})}function I({count:e,pageSize:t}){let n=P(e);return(0,b.jsx)(c,{id:`files`,title:`Files`,children:(0,b.jsx)(a,{label:`Files`,rows:n,rowKey:e=>e.name,pageSize:t??null,columns:[{key:`name`,header:`Name`,cell:e=>e.name},{key:`size`,header:`Size`,sort:e=>e.kb,cell:e=>`${e.kb} KB`},{key:`menu`,header:``,sort:null,cell:e=>(0,b.jsx)(i,{label:`${e.name} actions`,actions:[{label:`Rename`,icon:p.rename,onSelect:x},{label:`Remove`,icon:p.remove,destructive:!0,onSelect:x}]})}]})})}var L=()=>decodeURIComponent(location.hash.replace(/^#\/?/,``));function R(){let[e,t]=(0,m.useState)(L);(0,m.useEffect)(()=>{let e=()=>t(L());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let n=N.find(t=>t.path===e);return n?(0,b.jsxs)(`main`,{className:`gallery-one`,"data-route":n.path,children:[(0,b.jsxs)(`nav`,{className:`gallery-nav`,children:[(0,b.jsx)(`a`,{href:`#/`,children:`All`}),(0,b.jsx)(`span`,{children:n.title})]}),n.render()]}):(0,b.jsxs)(`main`,{className:`gallery-index`,"data-route":``,children:[(0,b.jsx)(`h1`,{children:`Components`}),(0,b.jsx)(`ul`,{children:N.map(e=>(0,b.jsxs)(`li`,{children:[(0,b.jsx)(`a`,{href:`#/${e.path}`,children:e.title}),` `,(0,b.jsx)(`code`,{children:e.path})]},e.path))})]})}(0,h.createRoot)(document.getElementById(`root`)).render((0,b.jsx)(m.StrictMode,{children:(0,b.jsx)(R,{})}));