[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-11541":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":14,"stars7d":16,"stars30d":12,"stars90d":15,"forks30d":15,"starsTrendScore":17,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":14,"lastSyncTime":27,"discoverSource":28},11541,"pi-ds4","mitsuhiko\u002Fpi-ds4","mitsuhiko","Run deepseek4 locally on metal right from within Pi",null,"TypeScript",151,37,3,2,0,5,6,4.74,"MIT License",false,"main",true,[],"2026-06-12 02:02:32","# pi-ds4\n\nPi provider extension for running [antirez\u002Fds4](https:\u002F\u002Fgithub.com\u002Fantirez\u002Fds4)\nas a local DeepSeek V4 Flash model.  The goal here is to see how good the UX\nand behavior can be around local models.\n\nThe extension registers `ds4\u002Fdeepseek-v4-flash` and\n`ds4\u002Fdeepseek-v4-flash-q2-imatrix` as models for `\u002Fmodel`, starts `ds4-server`\non demand, downloads\u002Fbuilds the runtime if needed, keeps a per-pi-process lease,\nand stops the server via a bundled watchdog when no clients are left.\n\n## Requirements and Behavior\n\nYou will need a mac with at least 128GB of RAM.  The default\n`ds4\u002Fdeepseek-v4-flash` model installs the 2-bit quantized model if you have\n128GB of RAM and picks the 4-bit quantized model if you have 256GB or more.\nSelect `ds4\u002Fdeepseek-v4-flash-q2-imatrix` to use the imatrix-tuned q2 model.\n\nIf you are signed into huggingface then your token is used for faster downloads.\nThe server is compiled\u002Fstarted and models are downloaded automatically on first\nuse.\n\n## Install\n\n```sh\npi install https:\u002F\u002Fgithub.com\u002Fmitsuhiko\u002Fpi-ds4\n```\n\nFor local development from this checkout, pass the path to an existing ds4 server checkout:\n\n```sh\n.\u002Finstall-pi-extension-local.sh \u002Fpath\u002Fto\u002Fantirez-ds4-checkout\n```\n\nIf `~\u002F.pi\u002Fds4\u002Fsupport` already exists and points elsewhere, use `--force` to\nmove it aside and install a symlink to the checkout you passed. Any existing\n`gguf\u002F*.gguf` model files (and resumable `.gguf.part` downloads) are preserved\ninto the new checkout first, using APFS clone-on-write copies on macOS when\navailable.\n\nThen restart pi or run `\u002Freload`.\n\n## Runtime layout\n\nRuntime state is kept under `~\u002F.pi\u002Fds4`:\n\n- `support\u002F` — shallow checkout of `https:\u002F\u002Fgithub.com\u002Fantirez\u002Fds4` (`main` by default)\n- `kv\u002F` — on-disk KV cache for the default model choice\n- `kv-q2-imatrix\u002F` — on-disk KV cache for the q2-imatrix model choice\n- `clients\u002F` — active pi process leases\n- `settings.json` — optional extension configuration overrides\n- `log` — build\u002Fdownload\u002Fserver\u002Fwatchdog log\n\nThe watchdog is bundled in this package (`ds4-watchdog.sh`), not expected to\nexist in the ds4 runtime checkout.\n\n## Configuration\n\nEnvironment overrides can also be placed in `~\u002F.pi\u002Fds4\u002Fsettings.json`.  In the\nJSON file, use the env var name (for example `\"DS4_READY_TIMEOUT_MS\"`), the\ncamel-case key without `DS4_` (for example `\"readyTimeoutMs\"`), or the lower\nsnake-case key without `DS4_` (for example `\"ready_timeout_ms\"`). Environment\nvariables win over the settings file.\n\n- `DS4_PROTOCOL`: Pi wire protocol. Supported values are `openai` (default,\n  OpenAI Chat Completions), `openai-responses`, and `anthropic`.\n- `DS4_SUPPORT_REPO`: runtime repo URL (default `https:\u002F\u002Fgithub.com\u002Fantirez\u002Fds4`)\n- `DS4_SUPPORT_BRANCH`: runtime branch (default `main`)\n- `DS4_RUNTIME_DIR`: use an existing ds4 checkout instead of `~\u002F.pi\u002Fds4\u002Fsupport`\n- `DS4_MODEL_QUANT`: force `q2`, `q2-imatrix`, or `q4` for the default model\n  choice (otherwise picked from system memory)\n- `DS4_READY_TIMEOUT_MS`: server startup timeout\n- `DS4_SERVER_BINARY`: custom `ds4-server` binary path\n- `DS4_WATCHDOG_SCRIPT`: custom watchdog script path\n- `DS4_API_KEY`: provider API key\u002Ftoken sent by Pi (default `dsv4-local`)\n\nSee `settings.example.json` for a complete example with a JSON schema reference.\nA minimal `~\u002F.pi\u002Fds4\u002Fsettings.json` can look like this:\n\n```json\n{\n  \"$schema\": \"https:\u002F\u002Fraw.githubusercontent.com\u002Fmitsuhiko\u002Fpi-ds4\u002Fmain\u002Fsettings.schema.json\",\n  \"protocol\": \"openai-responses\",\n  \"modelQuant\": \"q2-imatrix\",\n  \"readyTimeoutMs\": 900000\n}\n```\n\nUse `\u002Fds4` inside pi to show the live ds4 log.\n","pi-ds4 是一个用于在本地运行 DeepSeek V4 Flash 模型的 Pi 提供程序扩展。该项目通过注册 `ds4\u002Fdeepseek-v4-flash` 和 `ds4\u002Fdeepseek-v4-flash-q2-imatrix` 作为模型，按需启动 `ds4-server`，并根据系统内存自动选择合适的量化模型（如128GB RAM时使用q2模型，256GB以上RAM时使用q4模型）。它还提供了Hugging Face令牌支持以加速下载，并通过内置的看门狗机制管理服务器生命周期。适用于需要在Mac设备上进行高效本地AI模型推理的应用场景，尤其是那些对用户体验和性能有较高要求的情况。","2026-06-11 03:32:02","CREATED_QUERY"]