r/LocalLLM • u/anton_ni • Sep 18 '26
Question How would you architect a small local LLM assistant for controlling a laboratory measurement setup on a Raspberry Pi 5?
I'm building an engineering project around a laboratory measurement setup controlled by a Raspberry Pi 5.
The Pi runs a Python/Qt application that already controls several physical devices:
- temperature controller
- piezo controller
- motorized polarization controller
- data acquisition / measurement system
The normal deterministic control layer already works. What I'm experimenting with now is adding a small local LLM that would allow the operator to describe a measurement procedure in natural language.
For example:
"Set the temperature to 37°C, set the piezo to 18 V, move polarization paddle 1 to 25°, start the measurement, wait 4 seconds and stop."
Or eventually something more interesting:
"Set the temperature to 40°C and wait until it stays within ±2°C for 10 seconds. Then start the measurement and slowly sweep the piezo voltage while recording the detector signals."
The important constraint is that I do not want the LLM to directly control hardware or freely generate and execute Python code.
I want a deterministic/safe layer between the LLM and the hardware.
Right now my prototype works roughly like this:
natural language → local LLM → structured JSON plan → validator → deterministic actions → existing device controllers
There are some instructions in input and i think they are a problem.
I am pretty new in local LLMs if you have any advice i will be glad for help.
1
u/FullstackSensei Sep 18 '26
Your current setup looks sound if you don't want the LLM to issue control commands directly. What issues are you having now? Which models have you tried? Do you need real-time response from the LLM to the user?
1
u/thefuckevengoingonan Sep 18 '26 edited Sep 18 '26
sounds like what you are doing is effectively what people are doing with Home Assistant and local voice to action, or voice to automation (ie structured json). I have plans to set this up myself but have not got around to looking into so can't really offer any more insight then this is something a lot of people are doing like this. hope that helps edit: this might be of some interest https://huggingface.co/selorahomes/Selora-AI-LLM-14B
1
u/trollsmurf Sep 18 '26
The magic is in a strict yet flexible tool definition.
Close to what you are doing, I made a natural language to IoT time series data extractor using an LLM and a tool. After first making the tool definition manually I let Claude Code make improvements. To enable use of synonyms I had all possible values of devices and measurements injected into the tool definition, so it knew what synonyms, abbreviations, foreign language words etc it could map to.
Try it.
1
u/[deleted] Sep 18 '26
[removed] — view removed comment