Needle: A 26M Parameter Function-Calling Model That Runs at 6000 tok/s on Mobile

✍️ OpenClawRadar📅 Published: May 12, 2026🔗 Source
Ad

Cactus has open-sourced Needle, a 26M parameter function-calling model designed to run on budget phones, watches, and glasses. It achieves 6000 tok/s prefill and 1200 tok/s decode on consumer devices using their custom inference engine, Cactus.

Architecture: Simple Attention Networks

Needle uses a Simple Attention Network — no MLPs anywhere. The entire model consists of attention and gating layers. Key design: d=512, 8H/4KV, BPE=8192, with an encoder-decoder structure (12 encoder layers, 8 decoder layers) using cross-attention, masked self-attention with RoPE, and tied embeddings.

Training Details

  • Pretrained on 200B tokens across 16 TPU v6e (27 hours)
  • Post-trained on 2B tokens of synthesized function-calling data (45 minutes)
  • Data synthesized via Gemini with 15 tool categories (timers, messaging, navigation, smart home, etc.)

Benchmark Results

Needle beats FunctionGemma-270M, Qwen-0.6B, Granite-350M, and LFM2.5-350M on single-shot function calling. However, those models have more scope/capacity and excel in conversational settings.

Quickstart

git clone https://github.com/cactus-compute/needle.git
cd needle && source ./setup
needle playground

Opens a web UI at http://127.0.0.1:7860 for testing and fine-tuning on your own tools.

Ad

Usage (Python)

from needle import SimpleAttentionNetwork, load_checkpoint, generate, get_tokenizer

params, config = load_checkpoint("checkpoints/needle.pkl") model = SimpleAttentionNetwork(config) tokenizer = get_tokenizer()

result = generate( model, params, tokenizer, query="What's the weather in San Francisco?", tools='[{"name":"get_weather","parameters":{"location":"string"}}]', stream=False ) print(result)

[{"name":"get_weather","arguments":{"location":"San Francisco"}}]

Fine-tuning Locally

# via playground (auto-generates data via Gemini)

needle playground

or provide your own data

needle finetune data.jsonl

Availability

Weights are on Hugging Face: Cactus-Compute/needle. Everything is MIT licensed.

📖 Read the full source: HN AI Agents

Ad

👀 See Also

Claude Code Karma: Local Observability Dashboard for Claude Code Sessions
Tools

Claude Code Karma: Local Observability Dashboard for Claude Code Sessions

Claude Code Karma is an open-source local dashboard that parses JSONL files from ~/.claude/ to visualize Claude Code session data, track tool usage, and monitor silent failures. Built with FastAPI, Svelte-Kit 2, Svelte 5, and SQLite, it provides full session timelines and live tracking.

OpenClawRadar
Multi-Agent Trading Council System Using GPT-5.1 and Claude 4.6
Tools

Multi-Agent Trading Council System Using GPT-5.1 and Claude 4.6

A developer built a multi-agent trading system using ZagiHQ for orchestration with three parallel data-gathering agents and three LLMs (GPT-5.1, Claude 4.6 Opus, Claude 4.6 Sonnet) that must agree on trades. The system filters out setups through disagreement and requires manual approval.

OpenClawRadar
User-built PTC for Claude Code shows 40-65% token savings on analysis tasks, not code writing
Tools

User-built PTC for Claude Code shows 40-65% token savings on analysis tasks, not code writing

A developer built a local PTC implementation called Thalamus for Claude Code and analyzed 79 real sessions, finding 40-65% token savings on analysis tasks but near-zero savings on code-writing tasks. The agent used execute() primarily for general Python computation rather than batching tool calls.

OpenClawRadar
Reverse-engineered Claude Code SDK released in four languages
Tools

Reverse-engineered Claude Code SDK released in four languages

A developer has reverse-engineered Claude Code and created single-file SDKs in Node.js, Python, Go, and Rust with zero dependencies. The tools provide full agent loop with streaming and tool use while using existing Claude Pro/Max subscriptions.

OpenClawRadar