Running Small Language Models on Edge Devices: A Practical Guide
Which edge hardware can run a small language model, what quantisation does, and realistic offline AI uses in factories, from Raspberry Pi to Jetson.
By CrimsonEdge Systems team
Language models are no longer only cloud services. Small language models (SLMs), typically from under 1 billion to a few billion parameters, can now run on single-board computers and edge AI modules. For factories, field equipment and products that must work offline, that opens up new possibilities.
Here's what's realistic, what hardware you need, and where it makes sense.
What makes a model "small enough"
Three things decide whether a model fits on an edge device:
- Parameter count. Families such as Gemma, Phi, Qwen and Llama all ship small variants designed for local use.
- Quantisation. Storing weights in 4 or 8 bits instead of 16 cuts memory roughly two to four times with a modest quality loss. Formats such as GGUF, used by
llama.cpp, are common for edge deployment. - Memory bandwidth. Generating text is often limited by how fast the device can read the model's weights, not by raw compute.
As a rule of thumb, a 4-bit model needs a little over half a gigabyte of memory per billion parameters, plus room for the context.
Hardware tiers
| Device class | What it can do | Typical use |
|---|---|---|
| Microcontrollers (ESP32-S3, STM32) | TinyML: keyword spotting, anomaly detection, classification | Sensors, wake words, vibration alerts |
| Raspberry Pi 5 class | Quantised SLMs of about 1–3B parameters, a few tokens per second | Offline Q&A, short summaries, voice commands |
| Edge AI modules with GPU/NPU (e.g. NVIDIA Jetson Orin) | Larger models and much faster generation, plus vision | Robots, in-vehicle assistants, multi-camera systems |
| On-prem server with GPU | Mid-size models for a whole site | Plant-wide assistant over manuals and data |
Benchmarks vary widely with model, quantisation and settings, so test with your own prompts before choosing hardware.
Where SLMs fit in industry
- Offline maintenance assistant. Retrieval-augmented generation (RAG) over equipment manuals and repair logs, running on a box in the plant, so sensitive documents never leave the site.
- Voice control in noisy environments. On-device speech recognition plus a small model to turn "start line two warm-up" into a structured command. A human or PLC logic still decides whether to execute it.
- Summarising machine events. Turning a stream of alarms into a readable shift summary.
- Field equipment. Service tools that explain error codes to technicians where there's no signal.
WarningLanguage models can produce confident wrong answers. Keep them in an advisory role and never let model output directly control machinery.
Hybrid is often best
Many teams settle on a hybrid design: a small local model handles routine, privacy-sensitive or offline tasks, and harder questions go to a larger cloud model when a connection is available. This keeps everyday costs predictable and data on-site.
Getting started
- Pick one narrow task with clear success criteria, such as "answer questions from these 40 manuals".
- Prototype on a laptop with a runtime such as
llama.cppor Ollama and two or three candidate models. - Measure answer quality, speed and memory with real prompts.
- Choose hardware that meets the target with headroom, and plan cooling and power for the environment.
- Add guardrails: retrieval from approved documents only, citations back to the source page, and logging.
For sensor-level intelligence that runs on microcontrollers, see predictive maintenance with vibration sensors and edge AI, and plan power budgets with our free battery life calculator.
CrimsonEdge Systems builds edge AI systems, from TinyML on microcontrollers to on-prem assistants. See our AI solutions or contact us.
Sources
Frequently asked questions
Can a microcontroller like the ESP32 run a language model?
Not a useful general-purpose one. Microcontrollers are great for TinyML tasks such as keyword spotting, anomaly detection and simple classification. Language models need a single-board computer or a module with a GPU or NPU.
How big a model can a Raspberry Pi 5 run?
Community reports suggest quantised models of roughly 1–3 billion parameters run on a Raspberry Pi 5, at a few tokens per second. That's fine for short answers and summaries, but not for long conversations.
Why run AI on the device instead of the cloud?
It works without internet, keeps sensitive data on-site, has predictable costs and responds without network delay. Many systems use a hybrid: a small local model for everyday tasks and a cloud model for harder ones.
- #edge-ai
- #small-language-models
- #raspberry-pi
- #jetson
- #embedded