Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | |
| <meta name="description" content="Ares Static Lab: a from-scratch AI training control deck, browser RAG prototype, and Colab-first LLM build plan." /> | |
| <title>Ares Static Lab</title> | |
| <style> | |
| :root{ | |
| --bg:#070911; --bg2:#0d1020; --panel:#11172a; --panel2:#161d33; --panel3:#0d1324; | |
| --text:#edf3ff; --muted:#a8b4d7; --faint:#6f7da7; --line:#293454; | |
| --accent:#ff4d5e; --accent2:#7c5cff; --accent3:#26d9c2; --good:#55e6a5; --warn:#ffd166; | |
| --danger:#ff6b82; --shadow:0 22px 80px rgba(0,0,0,.42); --radius:24px; | |
| } | |
| *{box-sizing:border-box} | |
| html{scroll-behavior:smooth} | |
| body{margin:0;min-height:100vh;color:var(--text);font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:var(--bg);overflow-x:hidden} | |
| body::before{content:"";position:fixed;inset:0;z-index:-3;background:radial-gradient(circle at 12% 8%,rgba(124,92,255,.36),transparent 28%),radial-gradient(circle at 84% 0,rgba(255,77,94,.28),transparent 26%),radial-gradient(circle at 70% 85%,rgba(38,217,194,.14),transparent 30%),linear-gradient(180deg,#090b12,#070911 58%,#05060b)} | |
| body::after{content:"";position:fixed;inset:0;z-index:-2;opacity:.18;background-image:linear-gradient(rgba(255,255,255,.06) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.06) 1px,transparent 1px);background-size:46px 46px;mask-image:linear-gradient(to bottom,black,transparent 82%)} | |
| button,input,textarea,select{font:inherit} button{cursor:pointer} button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid rgba(124,92,255,.85);outline-offset:2px} | |
| .app{display:grid;grid-template-columns:330px minmax(0,1fr) 370px;gap:18px;max-width:1520px;margin:0 auto;padding:18px} | |
| .hero{grid-column:1/-1;position:relative;overflow:hidden;border:1px solid rgba(255,255,255,.1);border-radius:30px;background:linear-gradient(135deg,rgba(20,26,45,.88),rgba(13,18,34,.76));box-shadow:var(--shadow)} | |
| .hero::before{content:"";position:absolute;inset:-40%;background:conic-gradient(from 180deg,transparent,rgba(124,92,255,.22),rgba(255,77,94,.18),rgba(38,217,194,.18),transparent);animation:spin 18s linear infinite;filter:blur(26px);opacity:.55}.hero::after{content:"";position:absolute;inset:1px;border-radius:29px;background:linear-gradient(135deg,rgba(13,17,31,.92),rgba(14,19,34,.84));z-index:0}@keyframes spin{to{transform:rotate(1turn)}} | |
| .hero-inner{position:relative;z-index:1;display:grid;grid-template-columns:1fr auto;gap:20px;align-items:center;padding:22px} | |
| .brand{display:flex;gap:16px;align-items:center}.logo{width:64px;height:64px;flex:0 0 auto;border-radius:21px;background:linear-gradient(135deg,var(--accent2),var(--accent));display:grid;place-items:center;box-shadow:0 16px 38px rgba(124,92,255,.22),inset 0 1px 0 rgba(255,255,255,.28)} | |
| .logo svg{width:38px;height:38px;filter:drop-shadow(0 8px 12px rgba(0,0,0,.28))} h1{margin:0;font-size:clamp(29px,4vw,50px);letter-spacing:-.04em;line-height:.95}.subtitle{margin-top:8px;color:var(--muted);font-size:14px;max-width:760px;line-height:1.5} | |
| .hero-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap;justify-content:flex-end}.pill{border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.055);backdrop-filter:blur(14px);padding:9px 11px;border-radius:999px;color:var(--muted);font-size:12px}.pill strong{color:var(--text)} | |
| .hero-actions a,.hero-actions button{border:1px solid rgba(255,255,255,.1);border-radius:14px;color:var(--text);text-decoration:none;padding:10px 12px;background:#151d33;font-weight:800;box-shadow:none}.hero-actions .primary{border:0;background:linear-gradient(135deg,var(--accent2),var(--accent));box-shadow:0 12px 30px rgba(255,77,94,.18)} | |
| .panel{border:1px solid rgba(255,255,255,.09);border-radius:var(--radius);background:linear-gradient(180deg,rgba(22,29,51,.9),rgba(11,15,28,.92));box-shadow:var(--shadow);overflow:hidden}.pad{padding:18px}.stack{display:flex;flex-direction:column;gap:14px}.panel h2{margin:0 0 12px;text-transform:uppercase;letter-spacing:.12em;color:#dfe7ff;font-size:13px}.panel h3{margin:0 0 8px;font-size:15px}.small{color:var(--muted);font-size:12px;line-height:1.5}.muted{color:var(--muted)} | |
| .status{display:grid;gap:10px}.stat{display:grid;grid-template-columns:auto 1fr;gap:11px;padding:12px;border-radius:17px;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.07)}.dot{width:11px;height:11px;border-radius:50%;margin-top:4px;background:var(--good);box-shadow:0 0 18px var(--good)}.dot.warn{background:var(--warn);box-shadow:0 0 18px var(--warn)}.dot.red{background:var(--danger);box-shadow:0 0 18px var(--danger)}.stat b{display:block;font-size:13px}.stat span{display:block;color:var(--muted);font-size:12px;line-height:1.38;margin-top:3px} | |
| .metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.metric{padding:12px;border-radius:17px;background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.03));border:1px solid rgba(255,255,255,.08)}.metric .k{font-size:11px;text-transform:uppercase;letter-spacing:.1em;color:var(--faint)}.metric .v{margin-top:3px;font-size:21px;font-weight:900;letter-spacing:-.03em}.metric .d{margin-top:3px;color:var(--muted);font-size:11px;line-height:1.35} | |
| .progress{height:10px;border-radius:999px;background:#070b16;border:1px solid #263151;overflow:hidden}.progress i{display:block;height:100%;width:42%;background:linear-gradient(90deg,var(--accent2),var(--accent),var(--accent3));box-shadow:0 0 22px rgba(124,92,255,.35)} | |
| .timeline{display:grid;gap:9px}.step{display:grid;grid-template-columns:28px 1fr;gap:10px;align-items:start}.step i{width:28px;height:28px;border-radius:10px;display:grid;place-items:center;background:#10182d;border:1px solid var(--line);color:#dbe5ff;font-style:normal;font-weight:900;font-size:12px}.step.done i{background:linear-gradient(135deg,var(--accent2),var(--accent));border-color:transparent}.step b{display:block;font-size:12px}.step span{display:block;color:var(--muted);font-size:11px;margin-top:2px;line-height:1.35} | |
| main.panel{display:flex;flex-direction:column;min-height:760px}.deckbar{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 16px;border-bottom:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.025)}.tabs{display:flex;gap:8px;flex-wrap:wrap}.tab{border:1px solid rgba(255,255,255,.08);background:#0b1020;color:var(--muted);border-radius:999px;padding:9px 12px;font-weight:800;font-size:12px}.tab.active{background:linear-gradient(135deg,rgba(124,92,255,.35),rgba(255,77,94,.22));color:var(--text);border-color:rgba(255,255,255,.18)}.mode-row{display:flex;gap:8px;align-items:center}.select{background:#0b1020;color:var(--text);border:1px solid var(--line);border-radius:13px;padding:9px 10px;font-size:12px} | |
| .view{display:none;min-height:0}.view.active{display:flex;flex:1;flex-direction:column}.messages{flex:1;padding:18px;overflow:auto;display:flex;flex-direction:column;gap:14px;min-height:470px;scrollbar-color:#303c61 transparent}.msg{display:flex;gap:10px;max-width:940px}.msg.user{align-self:flex-end;flex-direction:row-reverse}.avatar{width:36px;height:36px;border-radius:14px;display:grid;place-items:center;flex:0 0 auto;background:linear-gradient(135deg,var(--accent2),var(--accent));font-size:18px;box-shadow:0 10px 24px rgba(124,92,255,.14)}.msg.user .avatar{background:#1b2540}.bubble{padding:13px 14px;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.047);border-radius:17px;color:#eef3ff;line-height:1.52;font-size:14px;white-space:pre-wrap}.msg.user .bubble{background:rgba(124,92,255,.17)}.sources{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px;padding-top:9px;border-top:1px solid rgba(255,255,255,.08)}.source-chip{font-size:11px;color:#d5defb;background:#0b1020;border:1px solid #273454;border-radius:999px;padding:5px 8px} | |
| .composer{border-top:1px solid rgba(255,255,255,.08);padding:14px;background:rgba(0,0,0,.14)}.inputrow{display:grid;grid-template-columns:1fr auto;gap:10px}textarea,input{font:inherit}textarea,input[type=text]{width:100%;background:#0b1020;color:var(--text);border:1px solid var(--line);border-radius:16px;padding:13px;outline:none}textarea{min-height:82px;resize:vertical}.btncol{display:flex;flex-direction:column;gap:8px}.btn{border:0;border-radius:15px;padding:11px 14px;color:white;background:linear-gradient(135deg,var(--accent2),var(--accent));font-weight:900;box-shadow:0 12px 28px rgba(124,92,255,.16)}.btn.secondary{background:#19233b;border:1px solid var(--line);box-shadow:none}.btn.ghost{background:transparent;border:1px solid var(--line);box-shadow:none;color:var(--muted)}.hintrow{display:flex;gap:10px;align-items:center;justify-content:space-between;margin-top:10px;color:var(--muted);font-size:12px;flex-wrap:wrap}.context-meter{display:inline-flex;align-items:center;gap:8px}.contextbar{width:130px;height:7px;border-radius:999px;background:#060a14;border:1px solid #24304f;overflow:hidden}.contextbar i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--accent3),var(--accent2),var(--accent))}.quick{display:flex;gap:7px;flex-wrap:wrap}.kbd{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;border:1px solid var(--line);background:#0b1020;border-radius:8px;padding:4px 7px;color:#c9d5ff;font-size:11px;cursor:pointer} | |
| .content-pad{padding:18px;display:grid;gap:14px}.pipeline-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.pipe-card{position:relative;padding:15px;border-radius:18px;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.08);overflow:hidden}.pipe-card::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:linear-gradient(var(--accent2),var(--accent))}.pipe-card b{font-size:14px}.pipe-card p{margin:6px 0 0;color:var(--muted);font-size:12px;line-height:1.45}.cmd{position:relative;background:#070b16;border:1px solid #263151;border-radius:17px;padding:13px;overflow:auto}.cmd pre{margin:0;color:#dbe6ff;font:12px/1.55 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;white-space:pre-wrap}.copy{position:absolute;right:9px;top:9px;border:1px solid #33405f;background:#121a2f;color:#dbe6ff;border-radius:10px;padding:6px 8px;font-size:11px;font-weight:800}.warning-card{border:1px solid rgba(255,209,102,.25);background:linear-gradient(180deg,rgba(255,209,102,.09),rgba(255,209,102,.03));border-radius:18px;padding:14px;color:#ffe6a5;font-size:12px;line-height:1.5}.ok-card{border:1px solid rgba(85,230,165,.2);background:linear-gradient(180deg,rgba(85,230,165,.08),rgba(85,230,165,.025));border-radius:18px;padding:14px;color:#d9ffef;font-size:12px;line-height:1.5}.download-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:10px}.file-link{display:block;text-decoration:none;color:var(--text);border:1px solid rgba(255,255,255,.09);background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.025));border-radius:17px;padding:13px}.file-link b{display:block;font-size:13px}.file-link span{display:block;color:var(--muted);font-size:11px;line-height:1.35;margin-top:4px}.badge{display:inline-flex;align-items:center;gap:6px;border:1px solid #33405f;border-radius:999px;padding:5px 8px;background:#0b1020;color:#dbe6ff;font-size:11px;font-weight:800}.dataset-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}.range-row{background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.08);border-radius:16px;padding:12px}.range-row label{display:flex;justify-content:space-between;gap:8px;font-size:12px;color:#dfe7ff;font-weight:800}.range-row input[type=range]{width:100%;accent-color:#7c5cff;margin-top:9px}.dataset-preview{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}.preview-card{border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.04);border-radius:17px;padding:13px}.preview-card b{font-size:13px}.preview-card p{margin:6px 0 0;color:var(--muted);font-size:12px;line-height:1.45}.hero-actions .dataset-button{background:#121a2f} | |
| .diagram{width:100%;height:auto;border-radius:20px;background:#0b1020;border:1px solid var(--line)}.memory textarea{min-height:86px}.memory .row{display:flex;gap:8px;margin-top:8px}.searchbox{margin-bottom:9px}.list{display:flex;flex-direction:column;gap:8px;max-height:240px;overflow:auto}.doc{border:1px solid rgba(255,255,255,.075);background:rgba(255,255,255,.04);border-radius:15px;padding:10px}.doc b{font-size:13px}.doc p{margin:4px 0 0;color:var(--muted);font-size:12px;line-height:1.38}.doc .score{color:var(--accent3);font-size:11px;margin-top:5px}.footer{grid-column:1/-1;text-align:center;color:var(--muted);font-size:12px;padding:8px 0 20px}.toast{position:fixed;right:18px;bottom:18px;z-index:10;background:#10182d;border:1px solid #33405f;color:#eaf0ff;border-radius:16px;padding:11px 13px;box-shadow:var(--shadow);opacity:0;transform:translateY(10px);transition:.18s}.toast.show{opacity:1;transform:none} | |
| @media(max-width:1220px){.app{grid-template-columns:1fr}.hero-inner{grid-template-columns:1fr}.hero-actions{justify-content:flex-start}.left,.right{order:2}main.panel{order:1}.pipeline-grid{grid-template-columns:1fr}} | |
| @media(max-width:720px){.app{padding:10px;gap:12px}.hero-inner{padding:16px}.brand{align-items:flex-start}.logo{width:54px;height:54px}.deckbar,.inputrow{grid-template-columns:1fr;display:grid}.mode-row{justify-content:space-between}.metric-grid{grid-template-columns:1fr}.btncol{flex-direction:row;flex-wrap:wrap}.btncol .btn{flex:1}.messages{padding:12px}.bubble{font-size:13px}} | |
| @media(prefers-reduced-motion:reduce){.hero::before{animation:none}} | |
| </style> | |
| </head> | |
| <body> | |
| <div class="app"> | |
| <header class="hero"> | |
| <div class="hero-inner"> | |
| <div class="brand"> | |
| <div class="logo" aria-hidden="true"><svg viewBox="0 0 64 64" fill="none"><path d="M32 5l22 9v16c0 15.2-8.7 24.3-22 29-13.3-4.7-22-13.8-22-29V14l22-9z" fill="rgba(255,255,255,.9)"/><path d="M32 13l14 6v11c0 9.5-5.2 15.9-14 19.8C23.2 45.9 18 39.5 18 30V19l14-6z" fill="url(#shieldg)"/><path d="M24 36l8-20 8 20h-5.2l-1.3-4h-7l-1.3 4H24zm4-8h4l-2-6-2 6z" fill="white"/><defs><linearGradient id="shieldg" x1="18" x2="46" y1="13" y2="50"><stop stop-color="#7c5cff"/><stop offset="1" stop-color="#ff4d5e"/></linearGradient></defs></svg></div> | |
| <div> | |
| <h1>Ares Static Lab</h1> | |
| <div class="subtitle">A public control deck for trainable Ares: official Colab brain notebook, starter datasets, tokenizer, Transformer, local RAG, evaluation, and honest deployment boundaries.</div> | |
| </div> | |
| </div> | |
| <div class="hero-actions"> | |
| <span class="pill"><strong>SDK:</strong> Static</span> | |
| <span class="pill"><strong>Core:</strong> No AI APIs</span> | |
| <span class="pill"><strong>Training:</strong> Colab/GPU</span> | |
| <button class="primary" id="jumpBrain">Train Ares</button> | |
| <button class="dataset-button" id="jumpDataset">Dataset</button> | |
| <button id="exportChat">Export chat</button> | |
| </div> | |
| </div> | |
| </header> | |
| <aside class="panel left"> | |
| <div class="pad stack"> | |
| <h2>Mission status</h2> | |
| <div class="status"> | |
| <div class="stat"><i class="dot"></i><div><b>Static Space deployed</b><span>HTML/CSS/JS only. Safe for public presentation and docs.</span></div></div> | |
| <div class="stat"><i class="dot"></i><div><b>Trainable Ares ready</b><span>The official UI exposes the Colab notebook, model configs, starter datasets, seed model repo, and training commands.</span></div></div> | |
| <div class="stat"><i class="dot"></i><div><b>Dataset starter included</b><span>1,000 roleplay JSONL scenarios + 500 ML-process records ship with this Space.</span></div></div> | |
| <div class="stat"><i class="dot warn"></i><div><b>Training is external</b><span>A Static Space cannot run GPUs, Python servers, or private persistent databases.</span></div></div> | |
| <div class="stat"><i class="dot red"></i><div><b>Not a trained frontier model</b><span>This browser assistant is a deterministic shell until Ares weights are trained and loaded elsewhere.</span></div></div> | |
| </div> | |
| <div class="metric-grid"> | |
| <div class="metric"><div class="k">Seed models</div><div class="v">1M→6M→30M</div><div class="d">Actual trained checkpoints uploaded.</div></div> | |
| <div class="metric"><div class="k">Dev target</div><div class="v">~100M</div><div class="d">First useful SFT/RAG experiments.</div></div> | |
| <div class="metric"><div class="k">Long context</div><div class="v">8K+</div><div class="d">After stable data + compute.</div></div> | |
| <div class="metric"><div class="k">Target config</div><div class="v">1.34B</div><div class="d">Design target, not free-Colab run.</div></div> | |
| </div> | |
| <div><div class="small" style="margin-bottom:8px">Prototype completion</div><div class="progress"><i></i></div></div> | |
| <h2>Roadmap</h2> | |
| <div class="timeline"> | |
| <div class="step done"><i>1</i><div><b>Static shell</b><span>Public UI, docs, architecture map.</span></div></div> | |
| <div class="step done"><i>2</i><div><b>Tokenizer + data</b><span>BPE training and bounded dataset builder.</span></div></div> | |
| <div class="step done"><i>3</i><div><b>Train/eval loop</b><span>AdamW, validation, reports, checkpoints.</span></div></div> | |
| <div class="step"><i>4</i><div><b>SFT + preference data</b><span>Instruction/chat tuning after base loss works.</span></div></div> | |
| <div class="step"><i>5</i><div><b>Tool backend</b><span>Safe code/web actuators later, outside Static SDK.</span></div></div> | |
| </div> | |
| </div> | |
| </aside> | |
| <main class="panel" id="mainDeck"> | |
| <div class="deckbar"> | |
| <div class="tabs" role="tablist" aria-label="Ares deck tabs"> | |
| <button class="tab active" data-tab="chat">Console</button> | |
| <button class="tab" data-tab="brain">Trainable Ares</button> | |
| <button class="tab" data-tab="dataset">Dataset</button> | |
| <button class="tab" data-tab="pipeline">Pipeline</button> | |
| <button class="tab" data-tab="colab">Colab</button> | |
| </div> | |
| <div class="mode-row"> | |
| <label class="small" for="mode">Mode</label> | |
| <select id="mode" class="select"><option value="rag">RAG-grounded</option><option value="plan">Plan-first</option><option value="direct">Direct</option></select> | |
| </div> | |
| </div> | |
| <section class="view active" id="view-chat"> | |
| <div class="messages" id="messages"></div> | |
| <div class="composer"> | |
| <div class="inputrow"> | |
| <textarea id="prompt" placeholder="Ask about tokenizer training, Colab setup, Transformer internals, RAG storage, SFT/RLHF, deployment, or the next Ares build step..."></textarea> | |
| <div class="btncol"><button class="btn" id="send">Send</button><button class="btn secondary" id="plan">Plan</button><button class="btn ghost" id="clear">Clear</button></div> | |
| </div> | |
| <div class="hintrow"> | |
| <span class="context-meter">Approx tokens: <b id="tokcount">0</b>/<span id="ctx">2048</span><span class="contextbar"><i id="ctxbar"></i></span></span> | |
| <span class="quick"><button class="kbd" data-prompt="Build the tokenizer step by step">tokenizer</button><button class="kbd" data-prompt="How do I run the Colab training pipeline safely?">Colab</button><button class="kbd" data-prompt="Explain the RAG storage plan">RAG</button><button class="kbd" data-prompt="What flaws or constraints should I watch for?">constraints</button></span> | |
| </div> | |
| </div> | |
| </section> | |
| <section class="view" id="view-brain"> | |
| <div class="content-pad"> | |
| <div class="ok-card"><strong>Trainable Ares is here:</strong> this Static Space now ships the full Colab brain notebook, Ares source code, model configs, tokenizer trainer, Wikipedia/ML/roleplay dataset builder, validation-aware trainer, and generation scripts. Training and inference run in Colab because Static Spaces cannot run PyTorch GPUs.</div> | |
| <div class="pipeline-grid"> | |
| <div class="pipe-card"><b>Brain notebook</b><p>Runs the complete path: Wikipedia streaming → roleplay JSONL → tokenizer → Ares training → optional roleplay SFT → generation.</p></div> | |
| <div class="pipe-card"><b>Actual Ares responses</b><p>After Colab training, <code>ares_core.generate</code> and <code>ares_core.agent_chat</code> sample from Ares checkpoint weights.</p></div> | |
| <div class="pipe-card"><b>Model configs</b><p>Start with ~10M or ~30M parameters, then scale only after validation loss and generation quality improve.</p></div> | |
| <div class="pipe-card"><b>Safety boundary</b><p>The UI does not hide an external AI model. The brain comes from your trained checkpoint.</p></div> | |
| </div> | |
| <h2>Official training files</h2> | |
| <div class="download-grid"> | |
| <a class="file-link" href="colab/ARES_NO_TERMINAL_TRAIN_AND_CONNECT.ipynb" download><b>No-terminal train + connect</b><span>Click-only Colab notebook: train Ares, start API, and open the UI connected to the checkpoint.</span></a> | |
| <a class="file-link" href="colab/OFFICIAL_Ares_Serious_Dataset_Training_Run.ipynb" download><b>Serious dataset notebook</b><span>Recommended: Wikipedia EN, FineWeb-Edu, OpenWebMath, code, UltraChat, 50k roleplay, 100M/2048 profile.</span></a> | |
| <a class="file-link" href="SERIOUS_TRAINING.md"><b>Serious training guide</b><span>Explains the non-toy dataset mixture and run steps.</span></a> | |
| <a class="file-link" href="colab/OFFICIAL_Ares_Colab_Training_Run.ipynb" download><b>Official real-generation notebook</b><span>Smaller default run: Wikipedia, TinyStories, 12k roleplay, tokenizer, training, SFT, and real checkpoint generation.</span></a> | |
| <a class="file-link" href="COLAB_OFFICIAL_RUN.md"><b>Clear Colab instructions</b><span>Step-by-step guide for the smaller official Ares training loop.</span></a> | |
| <a class="file-link" href="colab/Ares_Wikipedia_Roleplay_Brain_Training.ipynb" download><b>Earlier brain notebook</b><span>Previous Colab notebook for Wikipedia + roleplay training.</span></a> | |
| <a class="file-link" href="BRAIN_TRAINING.md"><b>Brain training guide</b><span>Readable command guide and scaling notes.</span></a> | |
| <a class="file-link" href="configs/ares_30m.json"><b>30M config</b><span>Small trainable Ares brain target for Colab.</span></a> | |
| <a class="file-link" href="https://huggingface.co/jacmor64/ares-seed-1m"><b>Trained seed 1M</b><span>1.05M Ares checkpoint trained from scratch to 5,000 steps.</span></a> | |
| <a class="file-link" href="https://huggingface.co/jacmor64/ares-seed-6m"><b>Trained seed 6M</b><span>6.23M increased-parameter checkpoint; best val loss ~3.918.</span></a> | |
| <a class="file-link" href="SEED_MODEL.md"><b>1M seed notes</b><span>Training summary and limitations.</span></a> | |
| <a class="file-link" href="SEED_6M_MODEL.md"><b>6M seed notes</b><span>Parameter increase and validation comparison.</span></a> | |
| <a class="file-link" href="https://huggingface.co/jacmor64/ares-seed-30m"><b>Trained seed 30M</b><span>28.3M checkpoint; needs more data/GPU training to beat 6M.</span></a> | |
| <a class="file-link" href="SEED_30M_MODEL.md"><b>30M seed notes</b><span>Official 30M architecture and validation comparison.</span></a> | |
| <a class="file-link" href="ares_core/model.py"><b>Ares model code</b><span>Decoder-only Transformer implementation.</span></a> | |
| </div> | |
| <h2>Colab bootstrap</h2> | |
| <div class="cmd"><button class="copy" data-copy="colabbootstrap">Copy</button><pre id="colabbootstrap">!git clone https://huggingface.co/spaces/jacmor64/ares-static-lab /content/ares-static-space | |
| %cd /content/ares-static-space | |
| !pip -q install -U tokenizers datasets safetensors huggingface_hub tqdm numpy | |
| # Then open/run: colab/OFFICIAL_Ares_Colab_Training_Run.ipynb | |
| # Real generation happens in notebook cells 20 and 22 after checkpoint training.</pre></div> | |
| <h2>Generate with trained brain</h2> | |
| <div class="cmd"><button class="copy" data-copy="brainchatcmd">Copy</button><pre id="brainchatcmd">python -m ares_core.agent_chat \ | |
| --checkpoint /content/drive/MyDrive/ares_brain_artifacts/checkpoints/ares-complete-wiki-roleplay-30m-roleplay-sft/ckpt_best.pt \ | |
| --tokenizer /content/drive/MyDrive/ares_brain_artifacts/tokenizers/ares-complete-wiki-roleplay-30m_tokenizer.json \ | |
| --rag-db /content/drive/MyDrive/ares_brain_artifacts/rag/ares-complete-wiki-roleplay-30m.sqlite \ | |
| --plan \ | |
| --interactive \ | |
| --device auto</pre></div> | |
| </div> | |
| </section> | |
| <section class="view" id="view-dataset"> | |
| <div class="content-pad"> | |
| <div class="warning-card"><strong>Starter data is preview-only:</strong> do not use the 1,000-roleplay / 500-ML files as the real Ares corpus. For serious training, use the Serious Dataset notebook, which streams Wikipedia EN, FineWeb-Edu, OpenWebMath, code, dialogue data, and generates 50,000 roleplay scenarios by default.</div> | |
| <div class="download-grid"> | |
| <a class="file-link" href="starter_datasets/ares_roleplay_starter_1000.jsonl" download><b>Roleplay starter JSONL</b><span>1,000 chat scenarios for Ares roleplay/SFT format.</span></a> | |
| <a class="file-link" href="starter_datasets/ares_ml_process_starter_500.txt" download><b>ML-process starter text</b><span>500 records about tokenizers, training, validation, AdamW, RAG, and debugging.</span></a> | |
| <a class="file-link" href="starter_datasets/DATASET_CARD.md"><b>Dataset card</b><span>Explains dataset contents and full Colab generation.</span></a> | |
| <a class="file-link" href="https://huggingface.co/datasets/jacmor64/ares-starter-dataset"><b>HF dataset repo</b><span>Official public starter dataset on Hugging Face.</span></a> | |
| <a class="file-link" href="colab/OFFICIAL_Ares_Serious_Dataset_Training_Run.ipynb" download><b>Generate serious corpus</b><span>Recommended: multiple official datasets + 50k roleplay + 100M/2048 profile.</span></a> | |
| </div> | |
| <h2>Dataset mixer</h2> | |
| <div class="dataset-controls"> | |
| <div class="range-row"><label>Wikipedia records <span id="wikiVal">50000</span></label><input id="wikiRecords" type="range" min="1000" max="100000" step="1000" value="50000"></div> | |
| <div class="range-row"><label>ML-process records <span id="mlVal">20000</span></label><input id="mlRecords" type="range" min="500" max="50000" step="500" value="20000"></div> | |
| <div class="range-row"><label>Roleplay records <span id="roleVal">50000</span></label><input id="roleRecords" type="range" min="1000" max="100000" step="1000" value="50000"></div> | |
| <div class="range-row"><label>Wikipedia source <span id="wikiModeLabel">Simple</span></label><select id="wikiSource" class="select" style="width:100%;margin-top:9px"><option value="20231101.en">Full English Wikipedia</option><option value="20231101.simple">Simple Wikipedia</option></select></div> | |
| </div> | |
| <div class="cmd"><button class="copy" data-copy="datasetcmd">Copy</button><pre id="datasetcmd"></pre></div> | |
| <h2>Dataset preview</h2> | |
| <div class="dataset-preview"> | |
| <div class="preview-card"><span class="badge">roleplay</span><p><b>Machine-learning tutor on a lunar base:</b> explain KV caches while staying calm, honest, and practical.</p></div> | |
| <div class="preview-card"><span class="badge">Wikipedia</span><p><b>Article records:</b> title + cleaned text are streamed from <code>wikimedia/wikipedia</code> in Colab.</p></div> | |
| <div class="preview-card"><span class="badge">ML process</span><p><b>Training troubleshooting:</b> loss spikes, tokenizer mismatch, validation overfitting, GPU OOM, RAG grounding, and checkpointing.</p></div> | |
| </div> | |
| </div> | |
| </section> | |
| <section class="view" id="view-pipeline"> | |
| <div class="content-pad"> | |
| <div class="ok-card"><strong>Pipeline status:</strong> the repository now includes dataset building, train/validation split, BPE tokenizer training, decoder-only Transformer training, validation loss/perplexity, checkpointing, HTML reports, SQLite RAG, and a RAG/planning chat wrapper.</div> | |
| <div class="pipeline-grid"> | |
| <div class="pipe-card"><b>1. Corpus builder</b><p>Streams bounded public data, filters short/long examples, deduplicates, and writes an Ares corpus.</p></div> | |
| <div class="pipe-card"><b>2. Tokenizer</b><p>Trains byte-level BPE from scratch with Ares special tokens.</p></div> | |
| <div class="pipe-card"><b>3. Transformer</b><p>RoPE, RMSNorm, GQA attention, KV cache, SwiGLU, unembedding, AdamW.</p></div> | |
| <div class="pipe-card"><b>4. Evaluation</b><p>Validation loss, perplexity, best checkpoint, and offline HTML report.</p></div> | |
| </div> | |
| <h2>Core training command</h2> | |
| <div class="cmd"><button class="copy" data-copy="traincmd">Copy</button><pre id="traincmd">python -m ares_core.train \ | |
| --config configs/ares_8m.json \ | |
| --tokenizer artifacts/tokenizers/ares_tokenizer.json \ | |
| --train artifacts/data/corpus_train.txt \ | |
| --val artifacts/data/corpus_val.txt \ | |
| --out artifacts/checkpoints/ares-10m \ | |
| --steps 300 \ | |
| --batch-size 8 \ | |
| --eval-every 50 \ | |
| --device auto</pre></div> | |
| <h2>Generate report</h2> | |
| <div class="cmd"><button class="copy" data-copy="reportcmd">Copy</button><pre id="reportcmd">python -m ares_core.train_report \ | |
| --log artifacts/checkpoints/ares-10m/train_log.jsonl \ | |
| --out artifacts/checkpoints/ares-10m/training_report.html</pre></div> | |
| </div> | |
| </section> | |
| <section class="view" id="view-colab"> | |
| <div class="content-pad"> | |
| <div class="warning-card"><strong>Public safety:</strong> keep Hugging Face tokens, checkpoints, SQLite databases, Google Drive private links, and raw datasets out of the Static Space repo. Colab artifacts should live in Google Drive or a separate model repo.</div> | |
| <div class="pipeline-grid"> | |
| <div class="pipe-card"><b>Step A: Open notebook</b><p>Use <code>colab/Ares_Wikipedia_Roleplay_Brain_Training.ipynb</code> for the official trainable Ares brain path.</p></div> | |
| <div class="pipe-card"><b>Step B: Enable GPU</b><p>Runtime → Change runtime type → GPU. Free Colab is for smoke tests, not 1B training.</p></div> | |
| <div class="pipe-card"><b>Step C: Run top-to-bottom</b><p>The notebook creates Drive artifacts, trains, evaluates, and generates a report.</p></div> | |
| <div class="pipe-card"><b>Step D: Scale carefully</b><p>Increase data and steps only after validation loss behaves correctly.</p></div> | |
| </div> | |
| <h2>Artifact rule</h2> | |
| <div class="cmd"><button class="copy" data-copy="artifactrule">Copy</button><pre id="artifactrule">Do not commit artifacts/, checkpoints/, *.pt, *.safetensors, *.sqlite, .env, kaggle.json, or access tokens to the public Space.</pre></div> | |
| </div> | |
| </section> | |
| </main> | |
| <aside class="panel right"> | |
| <div class="pad stack"> | |
| <h2>Architecture map</h2> | |
| <svg class="diagram" viewBox="0 0 360 280" role="img" aria-label="Ares architecture map"> | |
| <defs><linearGradient id="g2" x1="0" x2="1"><stop stop-color="#7c5cff"/><stop offset=".55" stop-color="#ff4d5e"/><stop offset="1" stop-color="#26d9c2"/></linearGradient></defs> | |
| <rect x="12" y="12" width="336" height="256" rx="22" fill="#0b1020" stroke="#293454"/> | |
| <g font-size="11" fill="#edf3ff" font-weight="700"> | |
| <rect x="30" y="34" width="124" height="34" rx="12" fill="url(#g2)"/><text x="54" y="55">BPE Tokenizer</text> | |
| <rect x="206" y="34" width="124" height="34" rx="12" fill="#18223a" stroke="#394765"/><text x="227" y="55">Token Embeds</text> | |
| <rect x="30" y="90" width="124" height="34" rx="12" fill="#18223a" stroke="#394765"/><text x="58" y="111">RoPE + RMS</text> | |
| <rect x="206" y="90" width="124" height="34" rx="12" fill="#18223a" stroke="#394765"/><text x="227" y="111">GQA Attention</text> | |
| <rect x="30" y="146" width="124" height="34" rx="12" fill="#18223a" stroke="#394765"/><text x="63" y="167">SwiGLU</text> | |
| <rect x="206" y="146" width="124" height="34" rx="12" fill="#18223a" stroke="#394765"/><text x="239" y="167">KV Cache</text> | |
| <rect x="30" y="202" width="124" height="34" rx="12" fill="#18223a" stroke="#394765"/><text x="57" y="223">Unembed</text> | |
| <rect x="206" y="202" width="124" height="34" rx="12" fill="url(#g2)"/><text x="240" y="223">Token Out</text> | |
| <path d="M154 51H206M268 68V90M206 107H154M92 124V146M154 163H206M268 180V202M206 219H154" stroke="#7f8db8" stroke-width="2" fill="none"/> | |
| </g> | |
| </svg> | |
| <h2>Local RAG memory</h2> | |
| <input id="memSearch" class="searchbox" type="text" placeholder="Search local memory..." /> | |
| <div class="memory"><input id="memTitle" type="text" placeholder="Memory title" /><textarea id="memText" placeholder="Paste facts, notes, docs, or project decisions. Stored only in this browser."></textarea><div class="row"><button class="btn secondary" id="addMem">Add</button><button class="btn ghost" id="resetMem">Reset</button></div></div> | |
| <div class="list" id="memList"></div> | |
| <h2>Retrieved preview</h2> | |
| <div class="list" id="retrievalList"></div> | |
| <h2>Ares engine</h2> | |
| <div class="memory"> | |
| <input id="engineUrl" type="text" placeholder="Paste Colab Ares API URL, e.g. https://...trycloudflare.com" /> | |
| <div class="row"><button class="btn secondary" id="saveEngine">Connect</button><button class="btn ghost" id="clearEngine">Local shell</button></div> | |
| <div class="small" id="engineStatus">No checkpoint engine connected. Chat uses local static fallback.</div> | |
| </div> | |
| <h2>Boundary</h2> | |
| <div class="small">Ares core intelligence must come from Ares-trained weights. Connect a Colab API running an Ares checkpoint to make this UI generate from the model.</div> | |
| </div> | |
| </aside> | |
| <div class="footer">Ares v0.2 static command deck — no external AI API core, no server-side Static Space compute, honest scaling path.</div> | |
| </div> | |
| <div id="toast" class="toast" role="status" aria-live="polite"></div> | |
| <script> | |
| const builtInDocs = [ | |
| {title:"Ares identity", text:"Ares is a from-scratch AI chatbot research project. The current static UI is not a trained frontier model; it is a local prototype and control panel."}, | |
| {title:"Core architecture", text:"Ares uses a decoder-only Transformer with BPE tokenization, token embeddings, RoPE positional embeddings, RMSNorm, grouped-query attention, KV caches, SwiGLU feed-forward networks, and tied unembedding token outputs."}, | |
| {title:"Training objective", text:"Pretraining minimizes cross-entropy next-token loss with backpropagation and AdamW. Cosine learning-rate decay, gradient clipping, mixed precision, checkpointing, validation loss, perplexity, and checkpoint reports are needed for stable scaling."}, | |
| {title:"Colab pipeline", text:"The Colab notebook builds a bounded corpus, creates train and validation splits, trains a BPE tokenizer, trains the smoke model, saves checkpoints, evaluates held-out loss, generates a report, and builds SQLite RAG storage."}, | |
| {title:"Context scaling", text:"Start with 256 or 512 tokens for smoke tests, then 2048 tokens for development, then 8192 tokens or more after compute and data are reliable."}, | |
| {title:"RAG storage", text:"Ares begins with SQLite FTS5 and deterministic hashed-vector retrieval. Later, an Ares-trained embedding head can replace hashed vectors. Petabyte scale requires sharding and object storage, not one SQLite file."}, | |
| {title:"SFT and RLHF", text:"After pretraining, format chat and code data for supervised fine-tuning. Then collect preference pairs for DPO or RLHF-style alignment. Do not run preference optimization before the base model works."}, | |
| {title:"Hugging Face Static constraint", text:"A Static Space can host HTML, CSS, JavaScript, docs, and files. It cannot run Python, GPUs, persistent server databases, or private model inference. Training must happen on Colab or another GPU environment."}, | |
| {title:"Tool use", text:"Web search and coding actuators are side goals after the base model exists. They require a safe backend or local sandbox and should not be the core intelligence."}, | |
| {title:"Public safety", text:"Do not publish tokens, checkpoints, SQLite databases, Google Drive private links, raw private datasets, .env files, or kaggle.json in the Static Space repo."}, | |
| {title:"Trainable Ares UI", text:"The official UI includes a Trainable Ares tab with the complete Colab brain notebook, configs, bootstrap commands, and generation commands for trained checkpoints."}, | |
| {title:"Ares starter dataset", text:"The Space includes a downloadable 1,000-example roleplay JSONL starter dataset and a 500-record machine-learning process starter dataset. The Colab notebook generates the larger Wikipedia plus roleplay mixture."}, | |
| {title:"Ares seed model", text:"Ares seed checkpoints now include 1.05M, 6.23M, and 28.3M models uploaded to Hugging Face. The 30M checkpoint proves parameter scaling, but the 6M seed still has the best validation loss on the tiny seed corpus. These are proof models, not capable assistants yet."}, | |
| {title:"Official Colab real generation", text:"Use colab/OFFICIAL_Ares_Colab_Training_Run.ipynb. It trains Ares on Wikipedia, optional TinyStories, ML-process curriculum, and 12,000 roleplay scenarios, then generates from the trained checkpoint in Colab."}, | |
| {title:"Serious Ares training corpus", text:"Use colab/OFFICIAL_Ares_Serious_Dataset_Training_Run.ipynb for the non-toy loop: Wikipedia EN, FineWeb-Edu, OpenWebMath, Python Code Dataset, UltraChat, 20k ML-process records, and 50k roleplay scenarios by default."}, | |
| {title:"Connecting the model", text:"The Static Space can call a Colab Ares API endpoint. Run ares_core.api_server with your checkpoint, expose it with cloudflared, and paste the URL into the Ares engine panel."} | |
| ]; | |
| const $ = sel => document.querySelector(sel); | |
| const $$ = sel => [...document.querySelectorAll(sel)]; | |
| const messages = $('#messages'); | |
| const promptBox = $('#prompt'); | |
| const tokcount = $('#tokcount'); | |
| const ctxbar = $('#ctxbar'); | |
| const memList = $('#memList'); | |
| const retrievalList = $('#retrievalList'); | |
| let chatLog = []; | |
| function toast(text){ const t=$('#toast'); t.textContent=text; t.classList.add('show'); setTimeout(()=>t.classList.remove('show'),1800); } | |
| function loadMem(){ try { return JSON.parse(localStorage.getItem('ares_memories') || '[]'); } catch { return []; } } | |
| function saveMem(items){ localStorage.setItem('ares_memories', JSON.stringify(items)); renderMem(); updateRetrievalPreview(); } | |
| function allDocs(){ return builtInDocs.concat(loadMem()); } | |
| function words(s){ return (String(s).toLowerCase().match(/[a-z0-9_]+/g) || []).filter(w => w.length > 1); } | |
| function approxTokens(s){ return Math.max(0, Math.ceil((s || '').trim().length / 4)); } | |
| function scoreDoc(q, d){ const qw=words(q), dw=new Set(words((d.title||'')+' '+(d.text||''))); if(!qw.length) return 0; let score=0; for(const w of qw){ if(dw.has(w)) score+=2; if(w.length>4){ for(const term of dw){ if(term.includes(w)||w.includes(term)) score+=.15; } } } const text=((d.title||'')+' '+(d.text||'')).toLowerCase(); if(text.includes(q.toLowerCase().slice(0,40))) score+=4; return score/Math.sqrt(8+dw.size); } | |
| function retrieve(q,k=3){ return allDocs().map(d=>({...d,score:scoreDoc(q,d)})).filter(d=>d.score>0).sort((a,b)=>b.score-a.score).slice(0,k); } | |
| function escapeHtml(s){ return String(s).replace(/[&<>"]/g, c => ({'&':'&','<':'<','>':'>','"':'"'}[c])); } | |
| function addMsg(role,text,sources){ const el=document.createElement('div'); el.className='msg '+role; const av=document.createElement('div'); av.className='avatar'; av.textContent=role==='user'?'🧑':'🛡️'; const bub=document.createElement('div'); bub.className='bubble'; bub.textContent=text; if(sources&&sources.length){ const src=document.createElement('div'); src.className='sources'; sources.forEach(s=>{ const chip=document.createElement('span'); chip.className='source-chip'; chip.textContent=s.title; src.appendChild(chip); }); bub.appendChild(src); } el.appendChild(av); el.appendChild(bub); messages.appendChild(el); messages.scrollTop=messages.scrollHeight; chatLog.push({role,text,sources:(sources||[]).map(s=>s.title),time:new Date().toISOString()}); } | |
| function planFor(q){ const t=q.toLowerCase(); if(t.includes('token')) return ['Collect clean public text/code/chat data','Train byte-level BPE tokenizer','Validate encode/decode round trips','Freeze special tokens','Use tokenizer.json in pretraining']; if(t.includes('rag')||t.includes('database')||t.includes('sqlite')) return ['Create SQLite docs + FTS5 tables','Chunk source documents','Store deterministic hashed vectors','Search FTS candidates','Rerank by vector cosine','Feed retrieved passages into Ares context']; if(t.includes('train')||t.includes('gpu')||t.includes('loss')||t.includes('colab')) return ['Run Colab GPU check','Build bounded corpus and validation split','Train tokenizer','Smoke train ~10M model','Watch validation loss/perplexity','Scale only after stability']; if(t.includes('hugging')||t.includes('deploy')||t.includes('space')) return ['Audit public repo','Keep README YAML static config','Upload source only','Keep checkpoints/tokens private','Run Python training elsewhere']; if(t.includes('rlhf')||t.includes('sft')||t.includes('align')) return ['Pretrain base model','Convert messages to SFT text','Fine-tune on instruction data','Collect preference pairs','Run DPO/RLHF-style alignment with eval gates']; return ['Clarify the goal','Retrieve relevant Ares memory','Break the task into verifiable components','Implement the smallest working version','Test, log, and scale only after it works']; } | |
| function reply(q,forcePlan=false){ const mode=$('#mode').value; const docs=mode==='direct'?[]:retrieve(q,3); const plan=planFor(q); let intro='No live Ares checkpoint engine is connected yet. Paste your Colab Ares API URL in the Ares engine panel to generate from trained weights. Until then, this is the static local fallback.'; let grounded=docs.length?'\n\nRelevant memory:\n'+docs.map((d,i)=>`${i+1}. ${d.title}: ${d.text}`).join('\n'):''; let steps=(forcePlan||mode==='plan'||/plan|step|build|train|deploy|how|colab/i.test(q))?'\n\nNext steps:\n'+plan.map((s,i)=>`${i+1}. ${s}`).join('\n'):''; let specific=''; const t=q.toLowerCase(); if(t.includes('flaw')||t.includes('constraint')) specific='\n\nConstraint caught: static hosting cannot supply GPUs, server-side Python, persistent SQLite, or petabyte storage. The correct architecture is static UI here, training on Colab/GPU compute, and later optional backend for tools.'; else if(t.includes('1b')||t.includes('billion')) specific='\n\nScaling note: the included 1B-class config is a target, not a promise of free training. It needs multi-GPU compute, high-quality token data, checkpoint sharding, and evaluations.'; else if(t.includes('intelligence')) specific='\n\nIntelligence path: pretraining gives language/world modeling; planning, retrieval, tool feedback, SFT, preference learning, and evaluations make behavior more agentic. We should measure capabilities instead of declaring AGI.'; else if(t.includes('token')||t.includes('secret')) specific='\n\nSecurity note: never publish access tokens, checkpoints, databases, or private Drive links in the Static Space repo.'; return intro+grounded+steps+specific; } | |
| function engineUrl(){ return (localStorage.getItem('ares_engine_url')||'').trim().replace(/\/$/,''); } | |
| function loadEngineFromQuery(){ try{ const params=new URLSearchParams(window.location.search); const e=params.get('engine'); if(e){ localStorage.setItem('ares_engine_url',decodeURIComponent(e).trim().replace(/\/$/,'')); } }catch{} } | |
| function setEngineStatus(){ const input=$('#engineUrl'); const status=$('#engineStatus'); if(!input||!status) return; input.value=engineUrl(); status.textContent=engineUrl()?('Connected endpoint: '+engineUrl()):'No checkpoint engine connected. Chat uses local static fallback.'; } | |
| async function callAresEngine(q){ const url=engineUrl(); const res=await fetch(url+'/generate',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({prompt:q,max_new_tokens:220,temperature:0.75,top_k:50,chat_format:true})}); if(!res.ok){ throw new Error('HTTP '+res.status+' '+await res.text()); } return await res.json(); } | |
| async function send(forcePlan=false){ const q=promptBox.value.trim(); if(!q) return; addMsg('user',q); promptBox.value=''; updateTokenMeter(); const sources=$('#mode').value==='direct'?[]:retrieve(q,3); updateRetrievalPreview(q); if(engineUrl()){ try{ addMsg('ares','Generating with connected Ares checkpoint engine…'); const data=await callAresEngine(q); addMsg('ares',data.text||data.full_text||'(empty model response)',sources); return; }catch(e){ addMsg('ares','Ares engine request failed: '+e.message+'\n\nFalling back to static local shell. Check that your Colab API is running and that the URL has no trailing path.'); } } setTimeout(()=>addMsg('ares',reply(q,forcePlan),sources),130); } | |
| function renderMem(){ const query=($('#memSearch')?.value||'').trim(); const mem=loadMem(); const shown=query?mem.map(m=>({...m,score:scoreDoc(query,m)})).filter(m=>m.score>0).sort((a,b)=>b.score-a.score):mem; memList.innerHTML=''; if(!shown.length){ const d=document.createElement('div'); d.className='doc'; d.innerHTML='<b>No matching browser memories</b><p>Add notes above to test local RAG retrieval.</p>'; memList.appendChild(d); return; } shown.forEach((m,idx)=>{ const d=document.createElement('div'); d.className='doc'; d.innerHTML=`<b>${escapeHtml(m.title||'Memory '+(idx+1))}</b><p>${escapeHtml((m.text||'').slice(0,160))}${(m.text||'').length>160?'…':''}</p>${query?`<div class="score">score ${m.score.toFixed(3)}</div>`:''}`; memList.appendChild(d); }); } | |
| function updateRetrievalPreview(q){ q=q||promptBox.value||$('#memSearch').value||'Ares training'; const docs=retrieve(q,4); retrievalList.innerHTML=''; if(!docs.length){ retrievalList.innerHTML='<div class="doc"><b>No retrieval yet</b><p>Type in the console or memory search to preview matches.</p></div>'; return; } docs.forEach(d=>{ const el=document.createElement('div'); el.className='doc'; el.innerHTML=`<b>${escapeHtml(d.title)}</b><p>${escapeHtml(d.text.slice(0,145))}${d.text.length>145?'…':''}</p><div class="score">score ${d.score.toFixed(3)}</div>`; retrievalList.appendChild(el); }); } | |
| function updateTokenMeter(){ const n=approxTokens(promptBox.value); tokcount.textContent=n; ctxbar.style.width=Math.min(100,n/2048*100)+'%'; updateRetrievalPreview(promptBox.value); } | |
| function switchTab(name){ $$('.tab').forEach(t=>t.classList.toggle('active',t.dataset.tab===name)); $$('.view').forEach(v=>v.classList.toggle('active',v.id==='view-'+name)); } | |
| $$('.tab').forEach(t=>t.addEventListener('click',()=>switchTab(t.dataset.tab))); | |
| $('#jumpBrain').addEventListener('click',()=>{ switchTab('brain'); $('#mainDeck').scrollIntoView({behavior:'smooth',block:'start'}); }); | |
| $('#jumpDataset').addEventListener('click',()=>{ switchTab('dataset'); $('#mainDeck').scrollIntoView({behavior:'smooth',block:'start'}); }); | |
| $('#send').addEventListener('click',()=>send(false)); $('#plan').addEventListener('click',()=>send(true)); $('#clear').addEventListener('click',()=>{ messages.innerHTML=''; chatLog=[]; welcome(); }); | |
| promptBox.addEventListener('input',updateTokenMeter); promptBox.addEventListener('keydown',e=>{ if(e.key==='Enter'&&(e.ctrlKey||e.metaKey)) send(false); }); | |
| $$('[data-prompt]').forEach(b=>b.addEventListener('click',()=>{ promptBox.value=b.dataset.prompt; updateTokenMeter(); promptBox.focus(); })); | |
| $$('[data-copy]').forEach(b=>b.addEventListener('click',async()=>{ const text=$('#'+b.dataset.copy).innerText; try{ await navigator.clipboard.writeText(text); toast('Copied'); }catch{ toast('Copy unavailable'); } })); | |
| $('#saveEngine').addEventListener('click',()=>{ const v=$('#engineUrl').value.trim().replace(/\/$/,''); localStorage.setItem('ares_engine_url',v); setEngineStatus(); toast(v?'Ares engine connected':'Ares engine cleared'); }); | |
| $('#clearEngine').addEventListener('click',()=>{ localStorage.removeItem('ares_engine_url'); setEngineStatus(); toast('Using local static shell'); }); | |
| $('#addMem').addEventListener('click',()=>{ const title=$('#memTitle').value.trim()||'User memory'; const text=$('#memText').value.trim(); if(!text) return toast('Add memory text first'); const mem=loadMem(); mem.unshift({title,text,created:new Date().toISOString()}); saveMem(mem.slice(0,80)); $('#memTitle').value=''; $('#memText').value=''; toast('Memory added'); }); | |
| $('#resetMem').addEventListener('click',()=>{ if(confirm('Delete local Ares memories in this browser?')){ saveMem([]); toast('Memory reset'); } }); | |
| $('#memSearch').addEventListener('input',()=>{ renderMem(); updateRetrievalPreview($('#memSearch').value); }); | |
| $('#exportChat').addEventListener('click',()=>{ const blob=new Blob([JSON.stringify({app:'Ares Static Lab',exported:new Date().toISOString(),messages:chatLog},null,2)],{type:'application/json'}); const a=document.createElement('a'); a.href=URL.createObjectURL(blob); a.download='ares-chat-export.json'; a.click(); URL.revokeObjectURL(a.href); toast('Chat export created'); }); | |
| function updateDatasetCommand(){ const w=$('#wikiRecords'), m=$('#mlRecords'), r=$('#roleRecords'), s=$('#wikiSource'); if(!w||!m||!r||!s) return; $('#wikiVal').textContent=w.value; $('#mlVal').textContent=m.value; $('#roleVal').textContent=r.value; $('#wikiModeLabel').textContent=s.value.includes('simple')?'Simple':'English'; $('#datasetcmd').textContent=`python -m ares_core.serious_mixture_build \ | |
| --output artifacts/data/ares_serious_corpus.txt \ | |
| --local data/sample_corpus.txt \ | |
| --preset serious \ | |
| --wikipedia-config ${s.value} \ | |
| --wikipedia-records ${w.value} \ | |
| --fineweb-records 50000 \ | |
| --openwebmath-records 20000 \ | |
| --code-records 20000 \ | |
| --dialogue-records 20000 \ | |
| --ml-records ${m.value} \ | |
| --roleplay-records ${r.value} \ | |
| --min-chars 80 \ | |
| --max-chars 32000`; } | |
| ['wikiRecords','mlRecords','roleRecords','wikiSource'].forEach(id=>{ const el=$('#'+id); if(el) el.addEventListener('input',updateDatasetCommand); }); | |
| function welcome(){ addMsg('ares',engineUrl()?'Ares UI connected to a checkpoint endpoint. Send a message to generate from the model.':'Ares UI is ready, but no checkpoint endpoint is connected yet. To generate real model responses, run the Colab Ares API cell and paste its public URL into the Ares engine panel.'); } | |
| loadEngineFromQuery(); renderMem(); updateRetrievalPreview(); updateTokenMeter(); updateDatasetCommand(); setEngineStatus(); welcome(); | |
| </script> | |
| </body> | |
| </html> | |