{"id":50588223,"url":"https://github.com/aboutlo/pi-smart-edit","last_synced_at":"2026-06-05T08:01:42.801Z","repository":{"id":352498497,"uuid":"1215377782","full_name":"aboutlo/pi-smart-edit","owner":"aboutlo","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-19T20:55:51.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-19T22:32:22.737Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aboutlo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-19T20:45:39.000Z","updated_at":"2026-04-19T20:55:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/aboutlo/pi-smart-edit","commit_stats":null,"previous_names":["aboutlo/pi-smart-edit"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/aboutlo/pi-smart-edit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutlo%2Fpi-smart-edit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutlo%2Fpi-smart-edit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutlo%2Fpi-smart-edit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutlo%2Fpi-smart-edit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aboutlo","download_url":"https://codeload.github.com/aboutlo/pi-smart-edit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aboutlo%2Fpi-smart-edit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33935514,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-05T08:01:41.915Z","updated_at":"2026-06-05T08:01:42.790Z","avatar_url":"https://github.com/aboutlo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pi-extension-smart-edit\n\nA [pi](https://github.com/badlogic/pi) extension that overrides the built-in `edit` tool with whitespace-tolerant matching, designed for local/quantized LLMs.\n\n**smart-edit is a drop-in replacement for `edit` that makes local/quantized LLM coding more reliable.**\n\n## TL;DR\n\nWith Qwen 3.6 int4 runs (10 vs 10), smart-edit improved **edit success from 46% to 89%** and **task pass from 40% to 80%** on my local benchmark\\*.\n\nIt also reduced average runtime from **707s to 492s** (**~30% faster**) on that benchmark set.\n\nFor Qwen 3.6 nvfp4, the latest patched run improved task pass (10% → 20%) but has lower edit success and slower runtime by far in my use case (see table).\n\n---\n\n## Problem\n\nLocal LLMs often fail exact-text edits because of tiny formatting drift (indentation, quotes, trailing spaces). This causes retry loops and wasted tokens.\n\n## Solution\n\n`smart-edit` keeps `edit` precise, but more tolerant for local models:\n\n1. Exact match (same behavior as built-in)\n2. Normalized line match (whitespace/quote tolerant)\n\nSo you keep strict edits, but avoid brittle failures from tiny formatting drift.\n\nIt supports the current `edit` contract and keeps compatibility with older argument shapes, so resumed sessions continue to work.\n\n## Install\n\n```bash\n# npm\npi install npm:@aboutlo/pi-smart-edit\npi install npm:@aboutlo/pi-smart-edit@0.4.0 # pinned version\n\n# git\npi install git:github.com/aboutlo/pi-extension-smart-edit\npi install git:github.com/aboutlo/pi-extension-smart-edit@v0.4.0 # tag or commit\n```\n\nOr for quick local testing:\n\n```bash\npi -e /path/to/pi-extension-smart-edit/src/index.ts\n```\n\n## Usage\n\nAfter loading the extension, use `edit` normally in pi. The model/tooling handles the argument shape automatically.\n\n## Benchmark summary\n\nThis benchmark runs the same medium coding task 10 times per model, then reports:\n\n- `edit` success rate,\n- end-to-end task pass rate (typecheck + tests + no timeout),\n- runtime.\n\n### Results\n\n| Model          | Edit Success (without) | Edit Success (with) | Task Pass (without) | Task Pass (with) | Avg Time (without) | Avg Time (with) |\n| -------------- | ---------------------: | ------------------: | ------------------: | ---------------: | -----------------: | --------------: |\n| Qwen 3.5 int4  |                    69% |                 90% |                 20% |              40% |               620s |            655s |\n| Qwen 3.5 nvfp4 |                    98% |                 86% |                 20% |              20% |               651s |            814s |\n| Qwen 3.6 int4  |                    46% |              89% 🔥 |                 40% |           80% 🔥 |               707s |         492s 🔥 |\n| Qwen 3.6 nvfp4 |                    74% |                 72% |                 10% |              20% |               706s |            839s |\n\n- Benchmark code isn't shared. I may do it later once I open source the other repo that I'm developing with only local LLMs\n\n### Tips\nInt4 models are not always available but you can encode one on your mac following the below steps\n\n- `huggingface-cli download Qwen/Qwen3.6-27B`\n- `vi ~/my/path/Modelfile-Qwen3.6-27B-coding` or `vi ~/my/path/Modelfile-Qwen3.6-27B-general`\n### for coding\n```\nFROM /Users/[USER]/.cache/huggingface/hub/models--Qwen--Qwen3.6-35B-A3B/snapshots/7da1103448ba36029c34ce1a9a741dfe93ee0c50 # TODO CHANGE THE HASH\nRENDERER qwen3.5\nPARSER qwen3.5\nPARAMETER num_ctx 32768\nPARAMETER temperature 0.15\nPARAMETER top_k 40\nPARAMETER top_p 0.92\nPARAMETER min_p 0.03\nPARAMETER repeat_penalty 1.08\nPARAMETER repeat_last_n 256\nPARAMETER presence_penalty 0 or for general\n```\n\n### for general purpose tasks \n```\nFROM /Users/[USER]/.cache/huggingface/hub/models--Qwen--Qwen3.6-35B-A3B/snapshots/7da1103448ba36029c34ce1a9a741dfe93ee0c50 # TODO CHANGE THE HASH\nRENDERER qwen3.5\nPARSER qwen3.5\nPARAMETER num_ctx 32768\nPARAMETER temperature 0.6\nPARAMETER top_k 20\nPARAMETER top_p 0.95\nPARAMETER min_p 0\nPARAMETER repeat_penalty 1\nPARAMETER presence_penalty 03- ollama create --experimental -q int4 aboutlo/qwen3.6-27B-int4 -f ~/Desktop/Modelfile-Qwen-3.6-27B-general\n```\n\n- `ollama create --experimental -q int4 aboutlo/qwen3.6-27B-int4 -f ~/Desktop/Modelfile-Qwen-3.6-27B-general`\n\nEnjoy :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faboutlo%2Fpi-smart-edit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faboutlo%2Fpi-smart-edit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faboutlo%2Fpi-smart-edit/lists"}