Files
alexpolo1 ec3beea01e Remove cloud backend — on-device Tensor chip only
Delete GeminiCloudModel.kt entirely. All inference now runs through
Gemini Nano on the Tensor G5 TPU via ML Kit, with MediaPipe as fallback
for custom local model files. No data leaves the device.

- OnDeviceModel.create() reverts to Nano → MediaPipe chain, no apiKey param
- Removed: API key UI, SharedPreferences key storage, cloud model routing
- Removed: thinking mode (cloud-only feature)
- Removed: pixel10-fast / pixel10-thinking model IDs → single "pixel10" model
- /v1/models now reports honest on-device limits (4096 ctx, 1024 output)
- CI smoke test updated: installs APK on emulator and verifies package,
  no inference tests (require real Pixel hardware with Tensor chip)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 21:58:21 +01:00

117 lines
3.5 KiB
YAML

name: CI
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: gradle-
- name: Build debug APK
run: ./gradlew assembleDebug --no-daemon
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk
# NOTE: Full inference tests (tool calling, generation) require a real Pixel
# device with the Tensor chip and Gemini Nano available via AICore.
# The emulator has no Tensor chip — run on-device tests manually with:
# adb install app-debug.apk
# adb shell am startservice -n com.pixel10.ai/.server.ApiServerService \
# -a com.pixel10.ai.START_SERVER --ei port 8080
# adb forward tcp:8080 tcp:8080
# curl http://localhost:8080/health
install-smoke:
name: Install + Smoke Test (emulator)
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
- name: Download APK artifact
uses: actions/download-artifact@v4
with:
name: app-debug
path: apk/
- name: Install Android SDK components
run: |
yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager \
"platform-tools" \
"emulator" \
"system-images;android-31;google_apis;x86_64"
- name: Create AVD
run: |
echo no | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd \
--name pixel10_test \
--package "system-images;android-31;google_apis;x86_64" \
--device "pixel_6"
- name: Start emulator
run: |
$ANDROID_HOME/emulator/emulator \
-avd pixel10_test \
-no-window -no-audio -no-snapshot \
-gpu swiftshader_indirect &
$ANDROID_HOME/platform-tools/adb wait-for-device
- name: Wait for emulator boot
run: |
timeout 300 bash -c '
until $ANDROID_HOME/platform-tools/adb shell \
getprop sys.boot_completed 2>/dev/null | grep -q "1"; do
sleep 3
done
'
$ANDROID_HOME/platform-tools/adb shell input keyevent 82
- name: Install APK
run: $ANDROID_HOME/platform-tools/adb install apk/app-debug.apk
- name: Verify APK installed
run: |
$ANDROID_HOME/platform-tools/adb shell pm list packages | grep com.pixel10.ai \
|| (echo "FAIL: APK not installed" && exit 1)
echo "PASS: APK installed successfully"