gitwtfhub

wtf is needle?

cactus-compute/needle — explained in plain English

Analysis updated 2026-08-13

4,690PythonAudience · developerComplexity · 2/5Setup · easy

TL;DR

A 14MB AI model for tool calling and data extraction that runs on phones, wearables, and other small devices.

Mindmap

mindmap
  root((Needle 2))
    What it does
      Tiny tool calling model
      Structured extraction
      Runs on edge devices
    Tech stack
      Python
      Hugging Face
    Use cases
      Edge device agents
      Data extraction
      Offline assistants
    Audience
      Developers
      Embedded engineers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Add tool calling to a Python app with a tiny model that runs on phones or edge devices.

REASON 2

Extract structured data like invoice fields from plain text using a Pydantic model.

REASON 3

Build an offline voice assistant for smart home devices that needs local tool calling.

What's in the stack?

PythonHugging Face

How it stacks up

cactus-compute/needleladaapp/ladapetergriffinjin/search-r1
Stars4,6904,6884,692
LanguagePythonPythonPython
Setup difficultyeasyhardhard
Complexity2/53/55/5
Audiencedevelopergeneralresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Downloads and caches an inference engine automatically on first run, no GPU required.

License terms are not stated in the available README excerpt.

Wtf does this do

Needle 2 is a very small AI model, only 14 megabytes, built specifically for calling tools and pulling structured data out of text on devices that cannot run typical large language models, like phones, smartwatches, smart home gadgets, and robots. Despite having only 45 million parameters, far fewer than most modern language models, the project reports it performs competitively against other small models many times its size on tool-calling benchmarks, while using about 28 megabytes of memory for a full session. The main way to use it is as a Python package, installed with a simple pip command. A developer describes the functions they want the AI to be able to call, using Python type hints and docstrings the same way many other tool-calling libraries work, and Needle decides which function to call and with what arguments based on a user's request. It can also extract structured data from plain text into a defined shape, such as pulling a vendor name, dollar total, and due date out of an invoice description. Several features aim to make Needle reliable on constrained hardware: it constrains every response to a strict format so it literally cannot produce an invalid tool call, it reports a confidence score with every answer so a program can automatically escalate uncertain cases to a bigger model or a human, and it can automatically pick just the most relevant tools out of a large catalog rather than considering all of them every time, which keeps memory use bounded even in long conversations. The project also includes a browser-based playground for trying out any model without writing code, useful for quickly testing how it responds to different tools and prompts. The underlying model weights are hosted on Hugging Face, and the inference engine downloads and caches itself automatically the first time it runs. Needle is built around a custom architecture the developers call a Simple Attention Network, described in more detail in an accompanying research paper.

Yoink these prompts

Prompt 1
Show me how to install cactus-needle and decorate a Python function as a tool.
Prompt 2
Help me write a Needle extraction call that pulls vendor, total, and due date from invoice text.
Prompt 3
Explain how Needle's confidence score works and how I should set an escalation threshold.
Prompt 4
Walk me through running the Needle playground locally to test my own tools.

Frequently asked questions

wtf is needle?

A 14MB AI model for tool calling and data extraction that runs on phones, wearables, and other small devices.

What language is needle written in?

Mainly Python. The stack also includes Python, Hugging Face.

What license does needle use?

License terms are not stated in the available README excerpt.

How hard is needle to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is needle for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.