iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🌟

ZundaGPT2 Lite: How to Run on Raspberry Pi, Linux Mint, and Ubuntu

に公開

logo

🚀 Introduction

ZundaGPT2 Lite is a chat client application that allows you to chat with AI using APIs provided by OpenAI, Google Gemini, Anthropic Claude, and others. It has a sister app called ZundaGPT2, but ZundaGPT2 Lite is a lightweight version that omits the audio output feature from ZundaGPT2.

Since March 2024, ZundaGPT2 Lite has been released on GitHub as a Windows application, but starting from v1.21.0, it also supports Raspberry Pi OS Bookworm and Linux Mint/Ubuntu. In this article, I will describe the steps for using the Raspberry Pi and Linux versions.

https://github.com/led-mirage/ZundaGPT2Lite

🍉 Prerequisites

🪴 Registering API Keys

Register environment variables for your API keys in files such as ~/.bashrc, ~/.profile, or ~/.xsessionrc.

# API Keys
export OPENAI_API_KEY="xxx"
export GEMINI_API_KEY="yyy"
export ANTHROPIC_API_KEY="zzz"

Refer to the following for how to use each file:

File Use Case
~/.bashrc When launching from a terminal or connecting via SSH
~/.profile When logging in locally to the desktop environment
~/.xsessionrc When connecting via RDP

🪴 pyenv + Python 3.12.0

If you run it with Python instead of using the executable, pyenv is convenient.

pyenv is not strictly necessary, but the code examples in this article assume you are using pyenv. If you use pyenv, please install Python 3.12.0 with the following command:

# Install Python 3.12.0
pyenv install 3.12.0

If you do not use pyenv, replace python in the code examples with python3 or adjust according to your environment.

For instructions on installing pyenv, please also refer to my article: "pyenv Installation Guide and Usage".

🪴 Installing Fonts (Optional)

ZundaGPT2 Lite uses emojis on some screens. If the display looks incorrect, you may want to install additional fonts.

# Install Japanese fonts
sudo apt install fonts-noto fonts-noto-cjk fonts-noto-cjk-extra fonts-noto-color-emoji

🎈 Raspberry Pi

Environment: Raspberry Pi OS Bookworm 64bit, X11/LXDE
Limitations: Only IBus supports Japanese input; printing functionality is not available

🎬 Using the Executable

1. Download

Download ZundaGPT2Lite_x.x.x_raspberrypi_arm64.zip from the Releases page on GitHub, and extract it to a suitable directory.

2. Run

Double-click ZundaGPT2Lite to launch it.
If you get a permission error, run chmod +x ZundaGPT2Lite to grant execution permission.

🎬 Running with Python

First Time (Installation and Launch)

# Clone the repository
git clone https://github.com/led-mirage/ZundaGPT2Lite.git

# Move to the project directory
cd ZundaGPT2Lite

# Create a Python virtual environment
python -m venv venv

# Activate the Python virtual environment
. venv/bin/activate

# Install dependencies
pip install -r requirements_linux.txt

# Install X11-related packages
sudo apt install libxcb-xinerama0 libxcb-cursor0

# Create symbolic links
sudo ln -s /usr/lib/aarch64-linux-gnu/libwebp.so.7 /usr/lib/aarch64-linux-gnu/libwebp.so.6
sudo ln -s /usr/lib/aarch64-linux-gnu/libtiff.so.6 /usr/lib/aarch64-linux-gnu/libtiff.so.5

# Launch
python app/main.py

Second Time Onwards

# Move to the project directory
cd ZundaGPT2Lite

# Activate the Python virtual environment
. venv/bin/activate

# Launch
python app/main.py

Build (Creating an Executable)

# Move to the project directory
cd ZundaGPT2Lite

# Activate the Python virtual environment
. venv/bin/activate

# Install PyInstaller
pip install pyinstaller

# Grant execution permission to the build script
chmod +x build.sh

# Run the build (a ZundaGPT2Lite file will be created in the dist directory)
./build.sh

🎈 Linux Mint / Ubuntu

Environment 1: Linux Mint 22.1 Cinnamon Edition
Environment 2: Linux Ubuntu 24.04.2 Desktop
Limitations: Only IBus supports Japanese input; printing functionality is not available

🎬 Using the Executable

1. Download

Download ZundaGPT2Lite_x.x.x_linux_x64.zip from the Releases page on GitHub, and extract it to a suitable directory.

2. Run

Double-click ZundaGPT2Lite to launch it.
If you get a permission error, run chmod +x ZundaGPT2Lite to grant execution permission.

🎬 Running with Python

First Time (Installation and Launch)

# Clone the repository
git clone https://github.com/led-mirage/ZundaGPT2Lite.git

# Move to the project directory
cd ZundaGPT2Lite

# Create a Python virtual environment
python -m venv venv

# Activate the Python virtual environment
. venv/bin/activate

# Install dependencies
pip install -r requirements_linux.txt

# Install X11-related packages
sudo apt install libxcb-xinerama0 libxcb-cursor0

# Launch
python app/main.py

Second Time Onwards

# Move to the project directory
cd ZundaGPT2Lite

# Activate the Python virtual environment
. venv/bin/activate

# Launch
python app/main.py

Build (Creating an Executable)

# Move to the project directory
cd ZundaGPT2Lite

# Activate the Python virtual environment
. venv/bin/activate

# Install PyInstaller
pip install pyinstaller

# Grant execution permission to the build script
chmod +x build.sh

# Run the build (a ZundaGPT2Lite file will be created in the dist directory)
./build.sh

🎈 WSL2

Environment: Ubuntu 24.04.2 LTS
Limitations: Japanese input is not possible; printing functionality is not available

🎬 Running with Python

First Time (Installation and Launch)

# Clone the repository
git clone https://github.com/led-mirage/ZundaGPT2Lite.git

# Move to the project directory
cd ZundaGPT2Lite

# Create a Python virtual environment
python -m venv venv

# Activate the Python virtual environment
. venv/bin/activate

# Install dependencies
pip install -r requirements_linux.txt

# Configure for software rendering
export QT_QUICK_BACKEND=software

# Launch
python app/main.py

Second Time Onwards

# Move to the project directory
cd ZundaGPT2Lite

# Activate the Python virtual environment
. venv/bin/activate

# Configure for software rendering
export QT_QUICK_BACKEND=software

# Launch
python app/main.py

🗨️ Digression: Challenges When Running on Raspberry Pi

🖊️ Choosing the UI Toolkit

ZundaGPT2/Lite uses PyWebView as the library for building the GUI. PyWebView is also designed to use another UI toolkit internally; on Linux, this is either QT or GTK, and one of them must be installed separately.

The PyWebView documentation describes the following installation methods, but on the Raspberry Pi, errors occurred during the source build performed during pip install, and installation was not possible.

pip install pywebview[gtk]      # Method using GTK
pip install pywebview[qt]       # Method using PyQt6

We attempted to resolve the build errors by adding various packages, but both methods had significant environment-dependent issues and could not be installed.

Therefore, we chose PySide6 as an alternative.
Since PySide6 is officially managed and distributed as binaries by QT itself, it can be used without building on many environments, including the Raspberry Pi. PyWebView automatically recognizes PySide6 as its QT backend, so it works without any particular issues.

To install PyWebView and PySide6 together, run the following command:

pip install pywebview[pyside6]  # Method using PySide6

Alternatively, to install PySide6 alone, run the following command:

pip install pyside6 qtpy

As of now (June 27, 2025), the latest version of PySide6 that can be installed via pip is 6.8.0.2, but this version is not compatible with Debian 12 Bookworm. PySide6 internally uses libraries called libwebp and libtiff, and these libraries are not present in Bookworm, causing errors at runtime.

To resolve this issue, the above steps create symbolic links. When PySide6 requests version 6 of libwebp, the link forwards the request to version 7 of libwebp, which Bookworm supports. The same applies to libtiff.

However, the next version of PySide6, 6.8.1, is expected to support Arm Bookworm, so it should work without symbolic links in the future.

To remove the created symbolic links, run the following commands (for reference):

# Remove symbolic links
sudo rm /usr/lib/aarch64-linux-gnu/libwebp.so.6
sudo rm /usr/lib/aarch64-linux-gnu/libtiff.so.5

🖊️ About Japanese Input

The main frameworks for Japanese input are IBus and Fcitx5, but recently Fcitx5 seems to be used more often.

I also initially tried to use Fcitx5, but even when trying to input Japanese into a text box, I could not switch to Japanese input mode. After a long period of trial and error, I discovered that IBus works normally for Japanese input. At that point, I gave up on using Fcitx5.

The fact that Japanese input does not work with Fcitx5 is likely a compatibility issue with QT, but I don't know the exact reason. Since using IBus works, I decided to use IBus.


📝 Summary

In this article, I have described the steps to run ZundaGPT2 Lite on Linux-based operating systems.

ZundaGPT2 Lite is a lightweight version without the audio output feature, but it still has character settings, log management, Markdown rendering, and other features similar to ZundaGPT2. It can be used not only for fun but also for learning, work, and more, so please give it a try.

That's all for this time. See you somewhere in the digital space again.
Bye bye, see you! 😊

Discussion