Skip to content
HardwareLab

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

Needle
No photo in the source; GitHub repository card, served from HardwareLab.The browser demo is on cactuscompute.com/needle; there is no creator video we can embed.

By cactus-compute

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

PartSpec / notesNeededPrice
macos-arm64 Optional
linux-arm64 Example builds an 8-layer model for itOptional
  • Computer for setup: pip install cactus-needle

Full build guide

Steps

Skill level
Intermediate
  1. pip install cactus-needle
  2. Decorate functions with @needle.tool and call run()
  3. 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.

LayerComponentRuns on
ModelNeedle 3 weights (needle3.cact) Deployment target
EnginePrebuilt engine per deployment target The platform folder you build
SpeechWhistle 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.

Source: github.com/cactus-compute/needle#readme

Hardware

  • Prebuilt engines per platform folder, e.g. macos-arm64 and linux-arm64

Credits and links

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.

Featured on HardwareLab

Markdown

[![Featured on HardwareLab](https://hardwarelab.dev/badge.svg)](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>

Sources

  1. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L5
  2. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L6
  3. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L7
  4. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L61
  5. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L12
  6. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L32-L43
  7. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L79
  8. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L109
  9. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L158-L162
  10. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L24-L26
  11. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L154
  12. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L24-L162
  13. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L3
  14. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L166
  15. github.com/cactus-compute/needle/blob/810ded9d83b1b152f85bbeb055d6e238e4fb9533/README.md?plain=1#L115-L123