%22%22%22Live%20LLM%20judge%20runner.%0A%0ADrop%20a%20piece%20in%2C%20see%20all%205%20judges%20score%20it%20in%20real-time%3A%0A-%20Gemini%20Aesthetic%20(vision)%0A-%20Gemini%20Adversarial%20(vision)%0A-%20Qwen%20Structural%20(text%2FSVG)%0A-%20Cerebras%20Fast%20(text%2FSVG)%0A-%20Claude%20Art-Historical%20(subagent%20%E2%80%94%20manual%20paste%20from%20CLI%20for%20now)%0A%0ACompare%20how%20the%20judges%20agree%2Fdisagree%20to%20understand%20which%20is%20dominating.%0A%22%22%22%0A%0Aimport%20marimo%0A%0A__generated_with%20%3D%20%220.22.5%22%0Aapp%20%3D%20marimo.App(width%3D%22full%22%2C%20app_title%3D%22Live%20LLM%20Judges%22)%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20import%20sys%0A%20%20%20%20import%20subprocess%0A%20%20%20%20import%20json%0A%20%20%20%20from%20pathlib%20import%20Path%0A%20%20%20%20sys.path.insert(0%2C%20str(Path(__file__).parent))%0A%20%20%20%20import%20_lib%20as%20lib%0A%0A%20%20%20%20return%20json%2C%20lib%2C%20mo%2C%20subprocess%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%22%22%22%0A%20%20%20%20%23%20Live%20LLM%20Judges%0A%0A%20%20%20%20Pick%20a%20piece%2C%20click%20'Run%20judges'%20to%20score%20it%20with%20all%20available%20LLM%20judges%20in%20parallel.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(lib%2C%20mo)%3A%0A%20%20%20%20factory%20%3D%20mo.ui.dropdown(%0A%20%20%20%20%20%20%20%20options%3Dlib.FACTORIES%2C%0A%20%20%20%20%20%20%20%20value%3D%22moire%22%2C%0A%20%20%20%20%20%20%20%20label%3D%22Factory%22%2C%0A%20%20%20%20)%0A%20%20%20%20variant%20%3D%20mo.ui.number(value%3D421%2C%20start%3D0%2C%20stop%3D9999%2C%20label%3D%22Variant%22)%0A%20%20%20%20run_btn%20%3D%20mo.ui.run_button(label%3D%22%F0%9F%94%8D%20Run%20all%20LLM%20judges%22)%0A%20%20%20%20mo.hstack(%5Bfactory%2C%20variant%2C%20run_btn%5D%2C%20gap%3D2%2C%20justify%3D%22start%22)%0A%20%20%20%20return%20factory%2C%20run_btn%2C%20variant%0A%0A%0A%40app.cell%0Adef%20_(factory%2C%20lib%2C%20variant)%3A%0A%20%20%20%20piece_id%20%3D%20f%22%7Bfactory.value%7D-%7Bvariant.value%3A04d%7D%22%0A%20%20%20%20png_path%20%3D%20lib.piece_path(piece_id%2C%20%22png%22)%0A%20%20%20%20return%20(png_path%2C)%0A%0A%0A%40app.cell%0Adef%20_(lib%2C%20mo%2C%20png_path)%3A%0A%20%20%20%20if%20not%20png_path.exists()%3A%0A%20%20%20%20%20%20%20%20preview%20%3D%20mo.md(f%22%E2%9A%A0%EF%B8%8F%20%7Bpng_path.name%7D%20not%20found.%20Generate%20it%20first.%22)%0A%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20preview%20%3D%20mo.Html(%0A%20%20%20%20%20%20%20%20%20%20%20%20f'%3Cdiv%20style%3D%22text-align%3Acenter%3B%22%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20f'%3Cimg%20src%3D%22%7Blib.png_data_uri(png_path)%7D%22%20'%0A%20%20%20%20%20%20%20%20%20%20%20%20f'style%3D%22max-width%3A400px%3B%20max-height%3A500px%3B%20border%3A1px%20solid%20%23444%3B%22%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20f'%3C%2Fdiv%3E'%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20preview%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(json%2C%20lib%2C%20png_path%2C%20run_btn%2C%20subprocess)%3A%0A%20%20%20%20judge_scores%20%3D%20%7B%7D%0A%20%20%20%20if%20run_btn.value%20and%20png_path.exists()%3A%0A%20%20%20%20%20%20%20%20%23%20Use%20batch_llm_judges.py%20via%20subprocess%20for%20a%20single%20piece%0A%20%20%20%20%20%20%20%20try%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%23%20Score%20via%20scoring.py%20with%20full%20LLM%20mode%0A%20%20%20%20%20%20%20%20%20%20%20%20result%20%3D%20subprocess.run(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Blib.PYTHON%2C%20str(lib.SCORING_PY)%2C%20str(png_path)%2C%20%22--json%22%5D%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20capture_output%3DTrue%2C%20text%3DTrue%2C%20timeout%3D120%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20result.returncode%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20full%20%3D%20json.loads(result.stdout)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20judge_scores%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22aesthetic_judge%22%3A%20full.get(%22aesthetic_judge%22%2C%200.5)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22gemini_challenger%22%3A%20full.get(%22gemini_challenger%22%2C%200.5)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22perplexity_judge%22%3A%20full.get(%22perplexity_judge%22%2C%200.5)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22codex_art_judge%22%3A%20full.get(%22codex_art_judge%22%2C%200.5)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22composite%22%3A%20full.get(%22composite%22%2C%200)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22ink_coverage%22%3A%20full.get(%22ink_coverage%22%2C%200.5)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22entropy%22%3A%20full.get(%22entropy%22%2C%200.5)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20except%20Exception%20as%20e%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20judge_scores%20%3D%20%7B%22error%22%3A%20str(e)%7D%0A%20%20%20%20return%20(judge_scores%2C)%0A%0A%0A%40app.cell%0Adef%20_(judge_scores%2C%20mo)%3A%0A%20%20%20%20if%20not%20judge_scores%3A%0A%20%20%20%20%20%20%20%20scores_view%20%3D%20mo.md(%22_Click%20'Run%20all%20LLM%20judges'%20to%20score._%22)%0A%20%20%20%20elif%20%22error%22%20in%20judge_scores%3A%0A%20%20%20%20%20%20%20%20scores_view%20%3D%20mo.md(f%22%E2%9A%A0%EF%B8%8F%20Error%3A%20%7Bjudge_scores%5B'error'%5D%7D%22)%0A%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%23%20Display%20each%20judge%20as%20a%20labeled%20bar%0A%20%20%20%20%20%20%20%20judges_meta%20%3D%20%5B%0A%20%20%20%20%20%20%20%20%20%20%20%20(%22aesthetic_judge%22%2C%20%22Gemini%20Aesthetic%22%2C%20%22%2322d3ee%22%2C%20%22Vision%20%C2%B7%20beauty%20%2B%20plottability%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20(%22gemini_challenger%22%2C%20%22Gemini%20Adversarial%22%2C%20%22%23f97316%22%2C%20%22Vision%20%C2%B7%20harsh%20critic%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20(%22perplexity_judge%22%2C%20%22Qwen%20Structural%22%2C%20%22%23a78bfa%22%2C%20%22Text%20%C2%B7%20SVG%20structure%22)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20(%22codex_art_judge%22%2C%20%22Claude%20Art-Historical%22%2C%20%22%234ade80%22%2C%20%22Vision%20%C2%B7%20gallery-worthiness%22)%2C%0A%20%20%20%20%20%20%20%20%5D%0A%20%20%20%20%20%20%20%20bars_html%20%3D%20'%3Cdiv%20style%3D%22background%3A%230f0f0f%3B%20padding%3A24px%3B%20border-radius%3A8px%3B%20border%3A1px%20solid%20%23333%3B%22%3E'%0A%20%20%20%20%20%20%20%20bars_html%20%2B%3D%20'%3Ch3%20style%3D%22margin%3A0%200%2016px%3B%20color%3A%23fff%3B%22%3ELLM%20Judge%20Scores%3C%2Fh3%3E'%0A%20%20%20%20%20%20%20%20for%20jkey%2C%20jlabel%2C%20jcolor%2C%20jdesc%20in%20judges_meta%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20jval%20%3D%20judge_scores.get(jkey%2C%200.5)%0A%20%20%20%20%20%20%20%20%20%20%20%20bar_pct%20%3D%20int(jval%20*%20100)%0A%20%20%20%20%20%20%20%20%20%20%20%20is_fallback%20%3D%20jval%20%3D%3D%200.5%0A%20%20%20%20%20%20%20%20%20%20%20%20label_color%20%3D%20%22%23666%22%20if%20is_fallback%20else%20%22%23ccc%22%0A%20%20%20%20%20%20%20%20%20%20%20%20note%20%3D%20%22%20(fallback)%22%20if%20is_fallback%20else%20%22%22%0A%20%20%20%20%20%20%20%20%20%20%20%20bars_html%20%2B%3D%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f'%3Cdiv%20style%3D%22margin-bottom%3A14px%3B%22%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f'%3Cdiv%20style%3D%22display%3Aflex%3B%20justify-content%3Aspace-between%3B%20margin-bottom%3A4px%3B%22%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f'%3Cspan%20style%3D%22color%3A%7Blabel_color%7D%3B%20font-family%3Asystem-ui%3B%20font-size%3A13px%3B%22%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f'%3Cstrong%3E%7Bjlabel%7D%3C%2Fstrong%3E%7Bnote%7D%3Cbr%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f'%3Cspan%20style%3D%22font-size%3A11px%3B%20color%3A%23666%3B%22%3E%7Bjdesc%7D%3C%2Fspan%3E%3C%2Fspan%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f'%3Cspan%20style%3D%22font-family%3Amonospace%3B%20color%3A%7Bjcolor%7D%3B%20font-size%3A18px%3B%20font-weight%3A600%3B%22%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f'%7Bjval%3A.3f%7D%3C%2Fspan%3E%3C%2Fdiv%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f'%3Cdiv%20style%3D%22background%3A%231a1a1a%3B%20height%3A8px%3B%20border-radius%3A4px%3B%20overflow%3Ahidden%3B%22%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f'%3Cdiv%20style%3D%22background%3A%7Bjcolor%7D%3B%20height%3A100%25%3B%20width%3A%7Bbar_pct%7D%25%3B%20opacity%3A%7B0.3%20if%20is_fallback%20else%201.0%7D%3B%22%3E%3C%2Fdiv%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f'%3C%2Fdiv%3E%3C%2Fdiv%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20composite%20%3D%20judge_scores.get(%22composite%22%2C%200)%0A%20%20%20%20%20%20%20%20bars_html%20%2B%3D%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20f'%3Chr%20style%3D%22border%3Anone%3B%20border-top%3A1px%20solid%20%23333%3B%20margin%3A20px%200%3B%22%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20f'%3Cdiv%20style%3D%22display%3Aflex%3B%20justify-content%3Aspace-between%3B%20align-items%3Abaseline%3B%22%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20f'%3Cspan%20style%3D%22color%3A%23fff%3B%20font-family%3Asystem-ui%3B%20font-size%3A16px%3B%20font-weight%3A600%3B%22%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20f'Composite%20(algo%20%2B%20judges)%3C%2Fspan%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20f'%3Cspan%20style%3D%22font-family%3Amonospace%3B%20color%3A%23fff%3B%20font-size%3A28px%3B%20font-weight%3A700%3B%22%3E'%0A%20%20%20%20%20%20%20%20%20%20%20%20f'%7Bcomposite%3A.1f%7D%3C%2Fspan%3E%3C%2Fdiv%3E'%0A%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20bars_html%20%2B%3D%20'%3C%2Fdiv%3E'%0A%20%20%20%20%20%20%20%20scores_view%20%3D%20mo.Html(bars_html)%0A%20%20%20%20scores_view%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(judge_scores%2C%20mo)%3A%0A%20%20%20%20if%20not%20judge_scores%20or%20%22error%22%20in%20judge_scores%3A%0A%20%20%20%20%20%20%20%20agreement%20%3D%20mo.md(%22%22)%0A%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%23%20Compute%20pairwise%20agreement%20(variance%20across%20non-fallback%20judges)%0A%20%20%20%20%20%20%20%20judge_vals%20%3D%20%5Bjudge_scores.get(k%2C%200.5)%20for%20k%20in%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5B%22aesthetic_judge%22%2C%20%22gemini_challenger%22%2C%20%22perplexity_judge%22%2C%20%22codex_art_judge%22%5D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20judge_scores.get(k%2C%200.5)%20!%3D%200.5%5D%0A%20%20%20%20%20%20%20%20if%20len(judge_vals)%20%3E%3D%202%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20mean%20%3D%20sum(judge_vals)%20%2F%20len(judge_vals)%0A%20%20%20%20%20%20%20%20%20%20%20%20variance%20%3D%20sum((v%20-%20mean)%20**%202%20for%20v%20in%20judge_vals)%20%2F%20len(judge_vals)%0A%20%20%20%20%20%20%20%20%20%20%20%20spread%20%3D%20max(judge_vals)%20-%20min(judge_vals)%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20spread%20%3C%200.1%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20consensus%20%3D%20%22%F0%9F%9F%A2%20Strong%20consensus%22%0A%20%20%20%20%20%20%20%20%20%20%20%20elif%20spread%20%3C%200.25%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20consensus%20%3D%20%22%F0%9F%9F%A1%20Mild%20disagreement%22%0A%20%20%20%20%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20consensus%20%3D%20%22%F0%9F%94%B4%20Strong%20disagreement%20%E2%80%94%20investigate%22%0A%20%20%20%20%20%20%20%20%20%20%20%20agreement%20%3D%20mo.md(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22%23%23%23%20Judge%20Agreement%5Cn%5Cn%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22-%20**Mean**%3A%20%7Bmean%3A.3f%7D%5Cn%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22-%20**Spread**%3A%20%7Bspread%3A.3f%7D%5Cn%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22-%20**Variance**%3A%20%7Bvariance%3A.4f%7D%5Cn%22%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20f%22-%20**Verdict**%3A%20%7Bconsensus%7D%22%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20agreement%20%3D%20mo.md(%22_Need%20at%20least%202%20judge%20scores%20to%20compute%20agreement._%22)%0A%20%20%20%20agreement%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%22%22%22%0A%20%20%20%20---%0A%20%20%20%20_Note%3A%20Claude%20art-historical%20judging%20uses%20Claude%20Code%20subagents%20and%20is%20run%20separately.%20To%20judge%20this%20piece%20via%20Claude%2C%20spawn%20a%20subagent%20and%20pass%20the%20PNG%20path._%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
c32a403e794a7aafe75381a341d2fd91