Needle
Cactus Compute’s foundation model for mobiles, wearables, robots, smart home, automotive and microcontrollers.
- Hardware:
- Prebuilt engines per platform folder, e.g. macos-arm64 and linux-arm64
- Difficulty:
- Advanced
- Creator:
- cactus-compute
An 8-29 MB on-device model for tool calls and structured extraction

- Posted
What it does
Cactus Compute’s foundation model for mobiles, wearables, robots, smart home, automotive and microcontrollers. The whole model is a single 8-29 MB binary that trades general chat capacity for tool calls and structured extraction; it also returns text embeddings, and its sibling model Whistle adds speech-to-text.
- Tool calls: picks the right functions and fills every argument; ask for something no tool covers and you get an empty list, not a guess.
- Structured extraction: declare a shape, hand over messy text and get typed fields back.
- Text embedding: the same model returns a vector for a sentence, so an app can search, match and route locally.
- Speech: Whistle, the speech-to-text model, is one 16.9 MB file on the CPU and shares Needle’s container and engine.
- A byte-level grammar compiled from your schemas constrains every token, and every response carries a calibrated confidence score.
What you need
- Skill level
- Intermediate
- License
- No license stated
Parts
- macos-arm64 [optional]
- linux-arm64 [optional]
- AI model or service
- Needle 3 model, Whistle speech-to-text
Prices, notes and sources: Parts and requirements
Parts and requirements
| Part | Spec / notes | Needed | Price |
|---|---|---|---|
| macos-arm64 | Optional | ||
| linux-arm64 | Example builds an 8-layer model for it | Optional |
- Computer for setup: pip install cactus-needle
Steps
- Skill level
- Intermediate
- pip install cactus-needle
- Decorate functions with @needle.tool and call run()
- needle build --platform <folder> fetches the engine and puts the weights beside it
Full instructions: View original
How it works
Give it the functions your app exposes; a byte-level grammar compiled from your schemas constrains every token, and each turn returns the function calls with a calibrated confidence score.
| Layer | Component | Runs on |
|---|---|---|
| Model | Needle 3 weights (needle3.cact) | Deployment target |
| Engine | Prebuilt engine per deployment target | The platform folder you build |
| Speech | Whistle speech-to-text | CPU |
Setup effort
- Skill level
- Intermediate
pip install, decorate your functions as tools, then build for a deployment target with needle build --platform.
Limits and caveats
- It trades general chat capacity for tool calls and extraction.
- Telemetry is on by default in the binary; set NEEDLE_TELEMETRY=0 and DO_NOT_TRACK=1 to turn it off.
- Platform fine-tuning runs on Cactus GPUs; local fine-tuning runs on your machine (JAX on CPU, CUDA or Metal).
Like this build? Get the weekly builds
Every Thursday: the 5 best gadget hacks you can copy. Free.
Built something? Submit a build
The creator's config
Copied word for word from the creator's repository, at the commit linked in each source.
Define a tool in Python (README example)
import needle @needle.tool def get_weather(city: str): "Get the current weather for a city." return {"city": city, "temp_c": 27, "sky": "clear"} agent = needle.Needle(tools=[get_weather]) print(agent.run("what's it like in Lagos right now?")["results"])Run both models from the CLI
needle --model needle3.cact --model whistle.cact --tools tools.json --audio clip.wav
Use-case ideas
- Fine-tune a subnetwork as small as 2 layers on one product’s tools for devices far smaller than the full model needs.
Why it's interesting
Needle deliberately gives up general chat to do a few things well on small devices: picking tool calls, structured extraction, text embeddings and, through its sibling model Whistle, speech-to-text. The README says the whole model ships as a single 8-29 MB binary. Given the functions an app exposes, it fills every argument from what the user said, returns two calls in order when asked for two things, and returns an empty list rather than a guess when no tool fits. A byte-level grammar compiled from your schemas constrains every token, so output always parses, and each response carries a calibrated confidence score. You decorate a Python function and its docstring becomes the tool description. Weights and platform engines are on Hugging Face, and there is a browser demo.
Hardware
- Prebuilt engines per platform folder, e.g. macos-arm64 and linux-arm64
Credits and links
- Cactus Compute: Creator
This page is a short summary written by HardwareLab. Build steps, code and photos belong to the creator; follow “View original” for the full project.
Featured? Add this badge
Built this? Paste the badge into your README. It links back to this page.
Markdown
[](https://hardwarelab.dev/projects/needle-tiny-llm/?utm_source=badge&utm_medium=referral&utm_campaign=launch_2w)HTML
<a href="https://hardwarelab.dev/projects/needle-tiny-llm/?utm_source=badge&utm_medium=referral&utm_campaign=launch_2w"><img src="https://hardwarelab.dev/badge.svg" alt="Featured on HardwareLab" width="188" height="20"></a>Related builds
All 23 in Local LLM Rigs & Edge Agents
28.9M-parameter LLM on an ESP32-S3
A 28.9M-parameter language model generating text on an ESP32-S3.
- ESP32-S3 N16R8
- OLED
Advanced4.6K
Fruit fly connectome on an ESP32-S3
A port of part of the fruit fly connectome, 48,311 neurons and 9.46 million connections from a real fly brain, escaping a spider on an ESP32-S3.
- ESP32-S3 N16R8
- OLED
Advanced · Our suggestion4.6K
Muse Gadgets SDK
Meta’s open SDKs for connecting Muse to ESP32 and Raspberry Pi gadgets.
- ESP32 boards
- Raspberry Pi (3B+, 4, 5 or Zero 2 W) or another Linux computer with Bluetooth LE
Intermediate2.7K
ESP32 iPhone Agent
An ESP32-S3 board lets an AI model use a real iPhone: no computer at run time, no jailbreak.
- Seeed XIAO ESP32S3 (plain, 8MB PSRAM; any ESP32-S3 with native USB + PSRAM)
- iPhone on iOS 18+ with cellular data
- Lightning to USB Camera Adapter (Lightning iPhones only)
- +2 more
Intermediate4.8K

Needle 2 ESP32
45M-parameter LLM offline on an ESP32-S3 turning English into valid commands.
- ESP32-S3
Advanced209
Sources
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L5
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L6
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L7
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L61
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L12
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L32-L43
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L79
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L109
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L158-L162
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L24-L26
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L154
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L24-L162
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L3
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L166
- github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L115-L123