Downloads · 30 days
91
9% of all-time downloads
theabbie/needle-pi-coding-agent
needle-pi-coding-agent is a text generation model from theabbie. Use it when you need the model to write or continue text. It is set up for jax. The card lists the license as mit.
A 26.3M-parameter Cactus Needle fine-tune for routing coding-agent intents into Pi's four built-in tools: read, bash, edit, and write.
Downloads · 30 days
91
9% of all-time downloads
All-time downloads
1K
Public
Repo size
52.8 MB
Likes
4
Public
Click a slice to open those files.
.pkl52.6 MB · 94%
From the Hugging Face model README
A 26.3M-parameter Cactus Needle fine-tune for routing coding-agent intents into Pi's four built-in tools: read, bash, edit, and write.
It is designed as a small parser/router, not a knowledge engine. An upstream planner should provide concrete paths, commands, content, or replacements; this model selects the tool and copies those arguments into a structured call.
Evaluation used a held-out, balanced 40-example test set with 10 examples per tool.
| Metric | Base Needle | This fine-tune |
|---|---|---|
| Exact match | 27.5% | 80.0% |
| Tool-call F1 | 28.95% | 80.0% |
| Tool-name F1 | 88.0% | 100.0% |
| JSON parse rate | 82.5% | 100.0% |
| Argument accuracy | 32.35% | 80.0% |
Exact matches by tool improved from read 8/10, bash 2/10, edit 0/10, write 1/10 to read 9/10, bash 8/10, edit 9/10, write 6/10.
These are local single-run measurements, not an external benchmark. See metrics.json for machine-readable results.
Cactus-Compute/needlebash: 450; read, edit, write: 350 each)3e-5, Muon 0.02The additional bash data emphasizes parsing fully specified arbitrary shell commands, including quoting, flags, environment variables, pipelines, redirects, subshells, and multiline commands. The model is not expected to invent specialist commands from vague goals.
Clone the Needle repository, install it, then download this repository:
hf download theabbie/needle-pi-coding-agent --local-dir needle-pi-coding-agent
import json
from needle import SimpleAttentionNetwork, generate, get_tokenizer, load_checkpoint
params, config = load_checkpoint("needle-pi-coding-agent/needle-pi-coding-agent.pkl")
model = SimpleAttentionNetwork(config)
tools = json.loads(open("needle-pi-coding-agent/training/pi_tools.json").read())
result = generate(
model,
params,
get_tokenizer(),
query="Run bash command: curl -s https://api.ipify.org",
tools=json.dumps(tools, separators=(",", ":")),
stream=False,
)
print(result)
# [{"name":"bash","arguments":{"command":"curl -s https://api.ipify.org"}}]
The bundled integration/pi_tool_router.py accepts this JSON on standard input:
{"intent":"Run bash command: curl -s https://api.ipify.org","tools":[...]}
and emits a JSON array containing the selected call.
needle-pi-coding-agent.pkl: best native Needle/JAX checkpointconfig.json and tokenizer/: architecture and tokenizer filestraining/pi_tools_1500.jsonl: full 1,500-example training corpustraining/pi_tools.json: flattened schemas for Pi's built-in toolstraining/generate_pi_dataset.py: resumable, atomically persisted generatortraining/codex_client.py: clean Codex CLI text-generation adaptertraining/pi_tools_1500.progress.json: final generation manifestintegration/pi_tool_router.py: minimal stdin/stdout router used by the Pi provider prototypeedits array with oldText and newText values.MIT. Based on Cactus-Compute/needle and the Needle source repository.