The 14MB Needle 2 function-calling model lets a Raspberry Pi 5 turn natural-language instructions into local Python actions without an internet connection or AI accelerator.
Needle 2, developed by Cactus Compute, is a compact function-calling large language model designed specifically to translate plain-English requests into structured actions. On a Raspberry Pi 5, the 14MB model runs entirely on the CPU, allowing commands such as turning on an LED to be processed locally without a dedicated AI accelerator or cloud API. Raspberry Pi reports a 78ms response time for a simple LED command in its demonstration.
Rather than operating as a general chatbot, Needle is trained for selecting and executing predefined tools. Developers declare Python functions with the @needle.tool decorator, with the function name, description and type annotations used to create the tool schema. Needle then selects the appropriate function and supplies its arguments based on the user’s request, while the Python application determines what the selected function actually does.
The Raspberry Pi demonstration uses functions for tasks including saving notes, reading the Pi’s CPU temperature, controlling LEDs and taking photographs. For example, a request to check the Raspberry Pi’s temperature causes Needle to select a get_temperature() function, which then executes vcgencmd and returns the measured value. Developers can similarly expose GPIO Zero functions or other application-specific Python functions as tools.
Needle is deliberately narrow in what it accepts. If a request does not correspond to any of the available tools, the model can return an empty function-call list rather than attempting to answer it as a conventional language model. In Raspberry Pi’s tests, the model’s native session used about 28MB, while the complete Python demonstration process peaked between 43MB and 46.4MB. Tested commands took between 76ms and 149ms before the selected Python function itself was executed.
The model can also be fine-tuned locally for a particular collection of tools, making it suitable for dedicated embedded applications with a defined set of actions. Needle 2’s weights and code are available under the Apache 2.0 licence, with the model hosted on Hugging Face and the software on GitHub. The combination of a small model, CPU-only execution and local function calling provides a way to add natural-language control to Raspberry Pi projects without sending commands to a remote AI service.
















































































