CoolFace
Apppublic

Mike0021/MiniCPM5-2B-WebGPU-Pi-HTTP

sourceHugging Faceapache-2.0updated 6d agoView on Hugging Face
0likes
index.html112 linesDownload Raw Back to root
1<!doctype html>2<html lang="en">3<head>4  <meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">5  <meta name="theme-color" content="#18181e">6  <meta name="color-scheme" content="dark">7  <link rel="icon" href="./favicon.svg" type="image/svg+xml">8  <link rel="preload" href="./modal-cat-v1.png" as="image" type="image/png" fetchpriority="high">9  <meta name="description" content="Pi, MiniCPM5 and a bash workspace, running entirely in your browser.">10  <meta property="og:type" content="website">11  <meta property="og:title" content="Pi, entirely in your browser.">12  <meta property="og:description" content="MiniCPM5-2B, WebGPU inference, and a local shell. A coding agent running entirely in your browser.">13  <meta property="og:url" content="https://mike0021-minicpm5-2b-webgpu-pi-http.static.hf.space/">14  <meta property="og:image" content="https://huggingface.co/spaces/Mike0021/MiniCPM5-2B-WebGPU-Pi-HTTP/resolve/main/social-thumbnail-v3.png">15  <meta property="og:image:width" content="3136">16  <meta property="og:image:height" content="1984">17  <meta property="og:image:alt" content="A coding agent running entirely in your browser, above the Pi terminal and its pixel cat mascot.">18  <meta name="twitter:card" content="summary_large_image">19  <meta name="twitter:title" content="Pi, entirely in your browser.">20  <meta name="twitter:description" content="MiniCPM5-2B, WebGPU inference, and a local shell. A coding agent running entirely in your browser.">21  <meta name="twitter:image" content="https://huggingface.co/spaces/Mike0021/MiniCPM5-2B-WebGPU-Pi-HTTP/resolve/main/social-thumbnail-v3.png">22  <meta name="twitter:image:alt" content="A coding agent running entirely in your browser, above the Pi terminal and its pixel cat mascot.">23  <title>Pi · Coding agent in your browser</title>24  <script type="module" crossorigin src="./assets/index-CdBuZzGZ.js"></script>25  <link rel="stylesheet" crossorigin href="./assets/index-D2YMAIXb.css">26</head>27<body>28  <header><a class="brand" href="./" aria-label="Pi"><svg class="pi-logo" viewBox="165.29 165.29 469.43 469.43" width="18" height="18" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M165.29 165.29H517.36V400H400V517.36H282.65V634.72H165.29ZM282.65 282.65V400H400V282.65Z"/><path fill="currentColor" d="M517.36 400H634.72V634.72H517.36Z"/></svg></a>29      <div id="runtime-meter" class="runtime-meter" role="group" aria-label="Execution in this browser" data-state="idle">30        <div class="runtime-content">31          <span class="runtime-location"><span class="runtime-dot" aria-hidden="true"></span><span class="runtime-engine">WebGPU</span></span>32          <span class="runtime-divider" aria-hidden="true"></span>33          <svg class="runtime-sparkline" width="48" height="18" viewBox="0 0 48 18" aria-hidden="true" hidden><g class="runtime-bars" fill="currentColor"></g></svg>34          <span class="runtime-value">Idle</span>35        </div>36        <span class="sr-only" role="status" aria-live="polite"></span>37      </div>38      <div class="model-panel">39        <div class="model-heading"><div><a class="header-model-source" href="https://huggingface.co/openbmb/MiniCPM5-2B" target="_blank" rel="noopener noreferrer" aria-label="MiniCPM5-2B by OpenBMB on Hugging Face (opens in a new tab)" title="View MiniCPM5-2B on Hugging Face"><img src="./openbmb-avatar.webp" width="16" height="16" alt=""><strong>MiniCPM5-2B</strong></a><span class="badge">4-bit</span></div><button id="load" class="primary" aria-describedby="load-status load-detail">Load model</button></div>40        <p id="load-status" class="sr-only" role="status">One download, about 1.84 GB. Cached in this browser for next time.</p>41        <progress id="progress" hidden max="100" value="0" aria-label="Model download"></progress>42        <div id="load-detail" class="sr-only"></div>43      </div>44  </header>45  <main>46    <section id="conversation-panel" class="conversation" aria-label="Agent conversation">47      <div class="terminal-panel">48      <div id="pi-terminal" aria-label="Pi terminal"></div>49      <div id="notice" role="status" hidden></div>50      <a id="open-tab" class="button" target="_blank" rel="noopener noreferrer" hidden>Open workspace in a new tab ↗</a>51      <div class="terminal-controls"><button id="new-chat" type="button">New chat</button><span id="activity" class="sr-only" role="status">Files and chat are saved on this device.</span><button id="newline" type="button" title="Insert a newline (Shift+Enter)">↵ Newline</button><button id="stop" type="button" hidden>Stop</button><button id="send" class="primary">Send ↑</button></div>52      <footer>Pi TUI · xterm.js <span>Model and tools run in your browser</span></footer>53      </div>54    </section>55    <div id="column-resizer" class="column-resizer" role="separator" tabindex="0" aria-label="Resize chat and workspace" aria-orientation="vertical" aria-controls="conversation-panel workspace-panel" aria-valuemin="0" aria-valuemax="100" aria-valuenow="55" title="Drag to resize · Arrow keys to adjust · Double-click or Enter to reset"></div>56    <aside id="workspace-panel" class="workspace" aria-label="Workspace">57      <div class="workspace-heading"><h2>Workspace</h2><div><button id="add-file" class="quiet">+ File</button><label class="button quiet" for="upload">Import</label><input id="upload" type="file" multiple hidden><button id="export" class="quiet">Export</button></div></div>58      <div class="folder-controls"><button id="open-folder" type="button" class="quiet"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg><span>Link a folder</span></button><button id="reconnect-folder" type="button" class="quiet" hidden>Reconnect folder</button></div>59      <div id="local-folder-bar" hidden>60        <strong id="local-folder-name"></strong><span id="local-folder-hint" role="status"></span>61        <div class="folder-actions"><button id="review-changes" type="button">Review &amp; apply</button><button id="refresh-folder" type="button" class="quiet" title="Reload files from disk and start a fresh chat">Refresh</button><button id="disconnect-folder" type="button" class="quiet">Back to demo</button></div>62      </div>63      <div class="file-area"><nav id="files" aria-label="Files"></nav><div class="editor-area"><div class="editor-heading"><span class="editor-file"><span id="filetype"></span><span id="filename">Select a file</span></span><button id="save" class="quiet" disabled>Save</button></div><label for="editor" class="sr-only">File contents</label><div class="editor-input"><pre id="editor-highlight" aria-hidden="true"></pre><textarea id="editor" wrap="off" autocomplete="off" autocapitalize="off" spellcheck="false" disabled placeholder="Select a file to inspect or edit it."></textarea></div></div></div>64      <details class="terminal" open>65        <summary>Shell <span>just-bash</span></summary>66        <div class="shell-toolbar"><span>/workspace</span><button id="shell-clear" type="button" class="quiet" title="Clear shell output (Ctrl+L)">Clear</button></div>67        <div id="terminal-output" role="log" aria-label="Shell output" aria-live="polite" tabindex="0"><div class="shell-empty"><strong>Ready in your workspace</strong><span>Try <code>ls -la</code> or <code>cat README.md</code>.</span></div></div>68        <form id="shell-form">69          <span class="shell-prompt" aria-hidden="true">$</span><label for="command" class="sr-only">Shell command</label>70          <div class="shell-input"><pre id="command-highlight" aria-hidden="true"></pre><textarea id="command" rows="1" autocomplete="off" autocapitalize="off" spellcheck="false" placeholder="Enter a shell command…" aria-describedby="shell-hint"></textarea></div>71          <button id="shell-run" class="primary">Run</button>72        </form>73        <div id="shell-hint"><span>Enter to run · Shift+Enter for newline</span><span>↑↓ history</span></div>74      </details>75      <p class="workspace-note">HTTP: curl can request any HTTPS URL. Browser CORS applies. <a href="./http-help.html" target="_blank" rel="noopener">HTTP help ↗</a></p>76    </aside>77  </main>78  <dialog id="local-review" aria-labelledby="review-title" aria-describedby="review-description">79    <div class="review-heading"><h2 id="review-title">Review local changes</h2><button id="review-close" type="button" aria-label="Close change review">×</button></div>80    <p id="review-description"></p><div id="review-files"></div><p id="review-error" role="alert"></p>81    <div class="review-actions"><button id="review-discard" type="button">Discard changes</button><button id="review-apply" type="button" class="primary">Apply to folder</button></div>82  </dialog>83  <dialog id="model-dialog" aria-labelledby="model-title" aria-describedby="model-description">84    <div class="setup-paws" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i><i></i></div>85    <div class="setup-cat" aria-hidden="true"><span class="setup-cat-tail"></span><img src="./modal-cat-v1.png" width="1254" height="1254" alt="" draggable="false" loading="eager" fetchpriority="high" decoding="async"><span class="setup-cat-eyelids"></span></div>86    <div class="setup-heading">87      <h2 id="model-title">Download model weights</h2>88      <button id="model-cancel" type="button" aria-label="Close model setup" title="Close model setup"><svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" aria-hidden="true" focusable="false"><path d="m6 6 12 12M18 6 6 18"/></svg></button>89    </div>90    <div class="setup-body">91    <p id="model-description">The model and shell run in your browser. HTTP commands can send requests and data to external services.</p>92    <dl class="setup-runtime">93      <div><dt>Model</dt><dd class="setup-model"><a class="model-org" href="https://huggingface.co/openbmb" target="_blank" rel="noopener noreferrer" aria-label="OpenBMB on Hugging Face (opens in a new tab)" title="OpenBMB on Hugging Face"><img src="./openbmb-avatar.webp" width="18" height="18" alt=""></a><a class="model-source" href="https://huggingface.co/openbmb/MiniCPM5-2B" target="_blank" rel="noopener noreferrer" title="View MiniCPM5-2B on Hugging Face">MiniCPM5-2B</a></dd></div>94      <div><dt>Inference</dt><dd>On your GPU</dd></div>95      <div><dt>Shell</dt><dd>Bash in the browser</dd></div>96    </dl>97    <div class="setup-facts"><strong>About 1.84 GB on the first download</strong><span>Saved in this browser for faster starts next time.</span></div>98    <p class="setup-label">Your message</p><div id="model-preview"></div>99    <p id="model-error" role="alert" hidden></p>100    <a id="model-open-tab" class="button" target="_blank" rel="noopener noreferrer" hidden>Open workspace in a new tab ↗</a>101    <p class="setup-credits"><span>Powered by</span>102      <a href="https://huggingface.co/docs/transformers.js/index" target="_blank" rel="noopener noreferrer" title="Transformers.js documentation (opens in a new tab)"><img src="./library-icons/huggingface.svg" width="14" height="14" alt="">Transformers.js</a>103      <a href="https://onnxruntime.ai/docs/" target="_blank" rel="noopener noreferrer" title="ONNX Runtime documentation (opens in a new tab)"><img src="./library-icons/onnxruntime.ico" width="14" height="14" alt="">ONNX Runtime</a>104      <a href="https://github.com/earendil-works/pi" target="_blank" rel="noopener noreferrer" title="Pi agent toolkit (opens in a new tab)"><svg class="credit-pi" viewBox="165.29 165.29 469.43 469.43" width="14" height="14" aria-hidden="true" focusable="false"><path fill="currentColor" fill-rule="evenodd" d="M165.29 165.29H517.36V400H400V517.36H282.65V634.72H165.29ZM282.65 282.65V400H400V282.65Z"/><path fill="currentColor" d="M517.36 400H634.72V634.72H517.36Z"/></svg>Pi</a>105      <a href="https://github.com/vercel-labs/just-bash" target="_blank" rel="noopener noreferrer" title="just-bash browser shell (opens in a new tab)"><svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><rect x="2.5" y="4" width="19" height="16" rx="3"/><path d="m6 9 3 3-3 3m7 0h5"/></svg>just-bash</a>106    </p>107    </div>108    <div class="setup-actions"><button id="model-confirm" type="button" class="primary" autofocus>Load model &amp; send</button></div>109  </dialog>110</body>111</html>112