m64_53ac9668fd7c / human/index.html
51 lines, 3.1 KBraw
1<!doctype html>2<html lang="en">3<meta charset="utf-8">4<meta name="viewport" content="width=device-width, initial-scale=1">5<title>model-for-opencode · Qwen3 4B</title>6<style>7 :root { color-scheme: light dark; --fg: #1d1d1f; --bg: #f6f5f2; --card: #fff; --muted: #6b6b70; --line: #d8d6d0; --accent: #0f766e; --code: #efede8; }8 @media (prefers-color-scheme: dark) { :root { --fg: #ecebe8; --bg: #161616; --card: #1f1f1f; --muted: #9a9a9f; --line: #333; --accent: #2dd4bf; --code: #262626; } }9 body { margin: 0; padding: 24px 16px; font: 15px/1.5 system-ui, sans-serif; color: var(--fg); background: var(--bg); }10 main { max-width: 760px; margin: 0 auto; }11 h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 16px; margin: 24px 0 6px; }12 .sub, .note { color: var(--muted); font-size: 14px; }13 a { color: var(--accent); } code { background: var(--code); border-radius: 4px; padding: 0 4px; font-size: 13px; }14 pre { background: var(--code); border-radius: 6px; padding: 10px; overflow-x: auto; font-size: 13px; }15 form { display: flex; gap: 8px; }16 input, button { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }17 input { flex: 1; min-width: 0; }18 button { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }19 #out { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 2.6em; margin-top: 8px; white-space: pre-wrap; }20</style>21<main>22 <h1>Qwen3 4B, for opencode</h1>23 <p class="sub">A local model on llama.cpp. Status: <span id="phase">checking…</span> · For agents: <a href="../agent">/agent</a></p>2425 <h2>Connect opencode</h2>26 <p class="note">Once, on your machine (opencode installed with <code>npm i -g opencode-ai</code>):</p>27 <pre id="login">…</pre>28 <p class="note">Then run <code>opencode</code> in any folder. opencode and your files stay on your machine; only the model calls come here.</p>29 <p class="note">Where m64 is installed, <code>m64 <this capsule> --ui opencode</code> does both steps.</p>3031 <h2>Try the model</h2>32 <form id="f"><input id="msg" value="Write a haiku about GPUs /no_think" aria-label="message"><button>Send</button></form>33 <div id="out"></div>34</main>35<script>36const $ = (id) => document.getElementById(id);37const base = location.href.replace(/\/human\/.*$/, "");38$("login").textContent = `opencode auth login ${base}`;39fetch("../status").then((r) => r.json()).then((s) => { $("phase").textContent = s.phase || "?"; })40 .catch(() => { $("phase").textContent = "status unavailable"; });41$("f").addEventListener("submit", async (e) => {42 e.preventDefault();43 $("out").textContent = "…";44 try {45 const r = await fetch("../v1/chat/completions", { method: "POST", headers: { "Content-Type": "application/json" },46 body: JSON.stringify({ messages: [{ role: "user", content: $("msg").value }], max_tokens: 300 }) });47 const d = await r.json();48 $("out").textContent = r.ok ? d.choices[0].message.content : `HTTP ${r.status}: ${JSON.stringify(d)}`;49 } catch (err) { $("out").textContent = String(err); }50});51</script>