Knight Rider
A talking K.I.T.T.: voice conversations with an LLM, running locally on a Raspberry Pi 5 inside a toy car.

Knight Rider is the demo from my workshop "Rust at The Edge: AI Development, Edge Deployment, Real World Inference" at RustConf 2025 in Seattle. You talk to the car, and it answers. Speech recognition, the language model and speech synthesis all run on a Raspberry Pi 5 hidden inside a Playmobil K.I.T.T., with no cloud involved.
The code is meant as a reference for building your own voice assistant in Rust.
- GitHub: steckes/knight-rider, with a demo video
How it works
Four AI models work together in a loop:
- Silero VAD listens to the microphone and detects when someone is speaking.
- Moonshine turns the speech into text.
- Gemma 3 270M, running in llama.cpp's server, writes the answer.
- Matcha TTS turns the answer back into speech.
While K.I.T.T. is working on an answer, it doesn't accept new speech input. Answers are capped at 200 characters, so generating the speech doesn't take too long.
Each model can be swapped: Whisper instead of Moonshine, Kitten or Kokoro instead of Matcha, and Gemma 3 1B for smarter but slower answers.
Hardware

- Raspberry Pi 5 with 4 or 8 GB, depending on the language model
- Raspberry Pi Codec Zero for the microphone and speaker
- Mini speakers
- Playmobil K.I.T.T., just big enough for the Pi
- A power bank, so you can carry the car around
The Pi starts everything on boot, and K.I.T.T. says "All systems ready!" once it's listening.
Software
The app is written in Rust:
- sherpa-rs runs voice detection, speech recognition and speech synthesis.
- llama.cpp runs the language model as a local server, which the app talks to over HTTP.
- rtaudio handles audio input and output, and rubato resamples between the sound card and the models.
It runs on any computer, not just the Pi. Setup instructions are in the repository.