Vibeleaderboard
Index / tool
Visit github.com
Category
Developer Tools
Rank
No. 1839Tools index

Previous survey · No. 2767 ·

Pricing
Open Source
Type
TOOL
Use case
Models: Train & Run
Interfaces
CLI · Web
GitHub
7 stars
Date

About

Needle is a 45M-parameter foundation model from Cactus Compute built specifically for tool calling, device control, and structured data extraction rather than open-ended chat. The whole model ships as a roughly 14MB binary and runs a full session in about 28MB of RAM, which puts function-calling agents on phones, wearables, smart-home hardware, and robots. It comes with a Python package, fine-tuning CLIs, and an export path for custom quantized builds.

What it does

A very small language model trained for one job: turning a typed or spoken request into calls to functions your app defines, or pulling typed fields out of unstructured text. You describe actions as ordinary Python functions; the model picks which to call and fills in the arguments, and a grammar built from your schemas forces every answer to parse. Each answer carries a confidence number, and a request nothing covers returns an empty list instead of a guess. A prebuilt native engine, downloaded on first use, does the actual inference.

Why it's ranked here

The case is scope discipline backed by real mechanism. Instead of shrinking a chat model, the authors gave up open-ended text entirely: the model answers only with calls, a byte-level grammar constrains every token, and the engine holds back calls it rates under 0.1 confidence. One trained network can be cut to any depth from 2 to 20 layers, so a team picks a size per device. It is Apache 2.0 licensed and the runtime install needs only the Hugging Face client. The headline benchmark numbers ship as images and on the vendor site, so treat them as the vendor's claims until tested on your own tools.

What's good

Refusal is designed in rather than hoped for: an off-topic request yields no call, optional arguments the user never stated are dropped, and a repair step grounds values like dates, names and on/off verbs in the request text. A tool can be a decorated function, a Pydantic model or a raw JSON schema. The depth ladder is concrete: smaller cuts always keep the first and last blocks and add middle ones by splitting the widest gap, so every size is a nested slice of the same weights. Local fine-tuning runs on CPU, CUDA or Apple Metal, and keeps training dependencies out of the runtime install.

Tradeoffs

Telemetry is on by default and posts to a remote endpoint: event name, package version, OS, CPU architecture, Python version and a random install ID kept in your home directory. Environment variables switch it off, and it skips CI runs. Size figures disagree across the project's own text, from 8 to 35 megabytes for weights and 29 to 121 million parameters, so measure on your target. Local fine-tuning leaves the confidence head untrained, so tuned models report no confidence. Synthetic training data comes from a third-party model through OpenRouter. The bundled inference tests accept almost any response shape, so they prove little about accuracy.

How to use it well

Fits an app or device with a fixed, known set of actions: smart-home controls, a phone assistant, filling records from notifications or invoices. Write one tool per action with names a user would actually say, then pick a confidence threshold per product: act above it, ask for confirmation below it. Past five declared tools, only the five best matches reach the model each turn, so keep catalogues tight. It does not hold conversations or write free text, so pair it with a chat model if the product needs either. Turn telemetry off before shipping to end users.

Technical notes+

pyproject.toml declares cactus-needle 3.0.1, Apache-2.0, Python >=3.9, one runtime dependency (huggingface_hub, mirrored in requirements.txt), training deps behind the train extra (jax, flax>=0.10.2, optax, safetensors, sentencepiece), plus gpu (jax[cuda12]), metal (jax 0.4.38 pinned with jax-metal) and whistle speech extras; the console script maps needle to needle/cli.py main, whose subcommands are run, finetune, generate-data, build, platform, download, fetch, playground and whistle, and which installs an fd-level stderr filter at import to drop XLA Triton autotuner log noise. needle/model/architecture.py defaults TransformerConfig to vocab 16384, d_model 768, 12 query heads over 2 KV heads, 20 layers, max_seq_len 4096, a 1024-token sliding window with global attention at layers 4, 9, 14 and 19, engram memory at layers 3, 7, 11, 15 and 19, and 4 hyper-connection lanes; ladder_layer_indices keeps both endpoint blocks and adds interior ones by bisecting the largest gap, and width_slice halves d_model and heads for a narrower variant. needle/model/quantize.py fake-quantizes weights at 4 bits and activations at 8 with straight-through gradients, and its CQ path rotates 128-wide groups by a Hadamard matrix before snapping to Lloyd-Max Gaussian codebooks (a ternary 1.58-bit codebook also exists). needle/model/finetune.py targets LoRA at q_proj, k_proj, v_proj, gate_proj and out_proj, and synthesises data through OpenRouter with deepseek/deepseek-flash-latest by default, overgenerating 1.3x and deduplicating on query plus answers. needle/model/run.py rejects any checkpoint not at format version 2 and points Needle 2 checkpoints at cactus-needle<3. needle/agent/tools.py builds JSON schemas from signatures, Google-style docstrings, Literal, Enum, Annotated Field constraints and Pydantic models. needle/_telemetry.py posts to a Supabase functions endpoint on a daemon thread with a 3-second timeout, stores a uuid at ~/.cactus_needle/telemetry_id, and is disabled by NEEDLE_TELEMETRY=0, any DO_NOT_TRACK value, or a CI variable. needle/environments/_harness.py passes an environment suite at 90 percent of cases with zero critical failures. tests/test_inference.py is gated on the engine being present and its tool-call test accepts call, text or refuse types. llms.txt states that more than 5 declared tools triggers a retrieval head that exposes only the top 5 per turn, and that the engine withholds calls under 0.1 confidence. The README is the only text read that describes the native engine; its source is not among the files read.

Observed

License
Apache-2.0
Language
Python, requires 3.9 or newer; models trained in JAX
Install
pip install cactus-needle; training extras behind [train], with CUDA and Apple Metal variants
Runtime dependency
huggingface_hub only; engine and weights download from Hugging Face on first use
Interfaces
Python library plus a needle CLI (run, finetune, generate-data, build, platform, download, fetch, playground, whistle)
Deployment
Prebuilt engine under 1 MB per platform folder, e.g. macos-arm64 and linux-arm64
Telemetry
On by default; off with NEEDLE_TELEMETRY=0, DO_NOT_TRACK, or in CI
Fine-tuning
Local LoRA on attention projections; hosted full-model tuning needs a Cactus API key
Output format
Grammar-constrained JSON tool calls with reasoning and a confidence score; no free-text generation
Tests
pytest suite in the tests directory, inference tests gated on the downloaded engine

Read from README.md, pyproject.toml, requirements.txt, llms.txt, needle/cli.py, needle/model/architecture.py, needle/model/run.py, needle/model/finetune.py, needle/model/quantize.py, needle/agent/tools.py, needle/_telemetry.py, needle/environments/_harness.py, tests/test_inference.py.

Intel on Needle

More in Intel

Tags

on-device-aismall-language-modeltool-callingedge-aiquantizationllmrobotics

Tech Stack

Python

Comments (0)

No comments yet

Editorially curated, with community endorsements as a secondary signal. Corrections welcome.