|
Download README.md from noodcon/PI: direct link, hf CLI and curl.
- Browser
- Download file 1.77 kB
-
https://huggingface.co/spaces/noodcon/PI/resolve/main/README.md
- Command line
-
hf download hf://spaces/noodcon/PI/README.md
-
curl -L -o README.md https://huggingface.co/spaces/noodcon/PI/resolve/main/README.md
1.77 kB
Pi · MiniCPM5-2B in your browser (React)
Bản viết lại bằng React + Vite + TypeScript của Space MiniCPM5-2B WebGPU Pi:
một coding agent (MiniCPM5-2B q4f16 + shell just-bash) chạy hoàn toàn trong trình duyệt bằng WebGPU.
Không có API key, không có server.
Chạy trên Google AI Studio (Build)
- Đẩy thư mục này lên một repo GitHub.
- Trong AI Studio → Build → dấu + → Import from GitHub.
- Mở tab Preview. Nếu WebGPU/OPFS bị chặn trong khung xem trước, dùng nút Open in a new tab.
Chạy cục bộ
npm install
npm run dev # http://localhost:3000
npm test # test logic thuần (không cần GPU)
npm run build
Yêu cầu
- Chrome/Edge gần đây có WebGPU +
shader-f16, và OPFS. - Lần đầu tải ≈ 1,84 GB từ
Mike0021/MiniCPM5-2B-ONNX(revision được ghim, kiểm SHA-256, lưu OPFS). - Runtime ONNX
.wasm(~23 MB) tự tải từ jsDelivr/unpkg. Muốn tự host: đặtort-wasm-simd-threaded.asyncify.{mjs,wasm}(từonnxruntime-web@1.26.0-dev.20260416-b7804b056c/dist) vàopublic/runtime/, hoặc đặt biếnVITE_ORT_WASM_BASE.
Cấu trúc
src/worker/— engine WebGPU, tải model, parser tool-call, vòng lặp agent, workspace just-bash (chạy trong Web Worker)src/client/— cầu nối worker + hookuseAgentsrc/components/— giao diện Reacttests/run.ts— test cho parser, top-p, tool, agent (model giả)
Khác bản gốc
Không có terminal xterm/Pi TUI, không tô màu cú pháp, không có mascot; vòng lặp agent tự viết thay cho Pi agent-core. Chưa được kiểm thử với model thật trong repo này (cần GPU) — xem ghi chú khi giao.