Files
AIKeyboard/setup_heliboard.sh
T
nova aa8fff2c0d Initial commit: HeliBoard + Gemma 4 on-device AI correction
Integrates LiteRT-LM (Google) with Gemma 4 E2B-it for on-device
spell/grammar correction in HeliBoard. After sentence-ending punctuation,
the model checks the sentence and shows a correction in the suggestion strip.
Tapping it replaces the original text — fully offline, no cloud API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 14:57:10 +02:00

42 lines
1.2 KiB
Bash

#!/usr/bin/env bash
# setup_heliboard.sh
# Run once after cloning this repo to pull HeliBoard and apply AI patches.
#
# Model: https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm
set -euo pipefail
HELIBOARD_REPO="https://github.com/Helium314/HeliBoard.git"
HELIBOARD_COMMIT="main"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
HELIBOARD_DIR="$SCRIPT_DIR/heliboard"
PATCHES_DIR="$SCRIPT_DIR/patches"
echo "==> AIKeyboard Gemma 4 E2B Setup"
if [ ! -d "$HELIBOARD_DIR/.git" ]; then
git clone "$HELIBOARD_REPO" "$HELIBOARD_DIR"
fi
cd "$HELIBOARD_DIR"
git fetch origin
git checkout "$HELIBOARD_COMMIT"
echo "--> Applying Gemma 4 integration patches ..."
for patch in "$PATCHES_DIR"/*.patch; do
if [ -f "$patch" ]; then
git apply --check "$patch" 2>/dev/null && git apply "$patch" \
|| echo " SKIP: $(basename "$patch") already applied or conflicts."
fi
done
cd "$SCRIPT_DIR"
echo ""
echo "Next steps:"
echo " 1. Push Gemma 4 LiteRT model file to your device:"
echo " adb push gemma-4-E2B-it.litertlm /data/local/tmp/gemma-4-E2B-it.litertlm"
echo " adb shell chmod 644 /data/local/tmp/gemma-4-E2B-it.litertlm"
echo " 2. Build & Install: ./gradlew installDebug"