Gemma Translator: offline voice interpreter on Raspberry Pi 5

Gemma Translator is an open-source multilingual voice interpreter for Raspberry Pi 5. It performs speech translation entirely on-device, with no cloud access. It uses the Google Gemma 4 model and the LiteRT runtime. The result is a portable AI translator that respects privacy and works even without a network. The user interface has a retro-terminal style, designed for small screens like Raspberry Pi touch displays.

The goal of the project is to demonstrate that generative AI can run on edge devices. Indeed, the entire translation process happens on-device. The microphone captures audio, which is processed and sent to the local Gemma 4 E2B model. Speech synthesis relies on Moonshine, a low-latency open-source TTS engine. This gives fast response times and no data leaves the device.

How the offline voice interpreter works

The heart of the system is LiteRT-LM, an orchestration layer based on LiteRT. This runs the gemma4-e2b model entirely locally. The model has 5.1B total parameters, but only 2.3B are active per inference. This efficiency makes it suitable for a Raspberry Pi 5 with 8GB of RAM. The Raspberry Pi 5 with 8GB handles the full workload without issues.

The operational flow is simple. The user selects the two languages on the touchscreen. Then speaks into the microphone. The audio is converted to text, translated by the model, and finally spoken through the speaker. All happens in a few seconds. Latency is low thanks to Moonshine, which generates synthesized audio efficiently. Additionally, the project includes a custom PCB (AX-4LABS-NEW) with a rotary encoder and four mechanical buttons.

  • Microphone with USB audio capture interface
  • Speaker or headphones for audio output
  • 480×320 touchscreen display for language selection
  • Keyboard for initial setup

The user interface is built specifically for small screens. It is a React frontend with a retro-terminal aesthetic. Its main purpose is to select the two translation languages. A unified script starts the LLM server, the Python API, and the React frontend on the Pi 5. This simplifies system startup. The 3D-printed case is also optional, but it protects the components while traveling.

Why choose an offline voice interpreter

Privacy is the main advantage. No conversation is sent to external servers. Data stays on the device. Moreover, low latency improves the user experience. No stable internet connection is needed. This makes it ideal for travel, events, or environments with limited connectivity. The project also demonstrates that generative AI is accessible to makers. The project page provides all the necessary code.

For audio, you can use an external amplifier. For example, an open-source amplifier like ANGELO can improve the sound output of the speaker. Or you can simply connect headphones. The setup is flexible. The system recognizes both USB microphone input and analog audio output. This allows you to adapt the project to your needs.

What you need to rebuild the project

The component list is clear. A Raspberry Pi 5 with at least 8GB of RAM is essential. The 480×320 touchscreen display connects via HDMI. A USB microphone and speaker complete the hardware. The custom PCB is not mandatory, but it makes control more intuitive. The 3D-printed parts for the case are optional. However, they give the device a professional look.

The software requires LiteRT, LiteRT-LM, the gemma4-e2b model, and Moonshine. All are open source. Initial setup requires an internet connection to download the models. After that, the system works fully offline. This project is a perfect example of edge AI. It combines computing power, privacy, and practicality in a compact form factor.

Source: https://github.com/moonshine-ai/moonshine

Similar Posts