Grok Voice app icon

Develop

How the app is put together.

These notes match the tree on main at 0.1.65. The short contributor path is CONTRIBUTING.md. Release signing steps also live in RELEASING.md. Screen rules are DESIGN-LANGUAGE.md.

Architecture

The UI is React and Vite. Tauri 2 hosts it. On Android the WebView sits in ai.grokvoice.app. Rust owns the microphone, the vault, the stores, and the model runtimes.

  • Session. xAI and OpenAI are realtime voice. Each xAI call mints a short-lived client secret with POST https://api.x.ai/v1/realtime/client_secrets, then connects to wss://api.x.ai/v1/realtime. The long-lived key is not sent on the socket. OpenAI uses its own key the same way. 1min.ai is a text model: Moonshine and the on-device voice stay on the phone. On-device Talk waits for a pause, then runs a GGUF. It is not full-duplex barge-in.
  • Audio. Uplink is 16 kHz PCM16. Downlink is 24 kHz PCM16. On Android the capture is an AudioRecord owned by the microphone foreground service. cpal is the desktop capture and the speaker.
  • Tools. actions::tool_definitions in src-tauri/src/actions.rs is the phone tool list, and it appends finance::tool_definitions. Cloud sessions and 1min.ai use that list. remember_fact and forget_fact are added only in the on-device session (local_memory.rs).
  • Vault. Keys live in a Stronghold snapshot. On Android the snapshot key is wrapped by a non-exportable Android Keystore key.
  • Wake word. rustpotter, trained from three recordings on the phone. The samples are not uploaded.
  • Stores. Notes, Time, the in-app calendar, People, Finance, settings, pinned facts, and web preferences are local files. The list is persist::STORES. Talk history (memory.json) and voice-time counters (usage.json) are excluded. Talk and the screen share the saved stores. There is no bank login and no cloud sync. Backup version 2 covers the list and still opens an older file that contains history, without restoring that history. A passphrase uses AES-256-GCM and PBKDF2 and is what puts API keys in the file. Without one, the file is plain and has no keys. Model weights are named, not copied. backupRoundTrip.test.ts fails if a new key is stored without being listed.

Codebase map

PathWhat it is
src/App.tsxTab shell: Talk, Notes, Agenda, Finance, Settings. Agenda holds Calendar, Reminders, Alarms, and Countdowns.
src/components/Screens. Onboarding.tsx is the setup tour. AssistantView.tsx draws Talk bubbles. FinancePage.tsx, BudgetSection.tsx, and the chart files are money. LocalPacks.tsx is the pack list.
src/lib/budget.tsThe month budget: expected income, expense limits, left to spend, and the savings target. The month range is 24 back and 12 ahead.
src/lib/moneyFlow.tsThe money-flow chart. Card charges stay in spending. Card and loan payments are a separate debt flow. Still owed is not added to the period.
src/lib/legendShare.tsHoldings shares. Parts add to 100. The portfolio value row reads 100 and is not part of the denominator.
src/index.cssTheme tokens, Talk bubbles, and the short-landscape side rail at max-height 520px.
src/lib/setupGuide.tsThe five paths and the key copy. stack.ts is the first-run byte total.
src/lib/i18n.tsScreen strings for en, es, de, pt, and ca-ES-valencia. financeCopy.ts, setup-i18n.json, and phonon-i18n.json add more.
src/lib/appearance.tsTheme presets and the custom palette. The attribute is data-appearance.
src-tauri/src/lib.rsRust crate root. Commands are registered from here.
src-tauri/src/actions.rsNotes, Time, Calendar, People, music, settings, calls, and messages.
src-tauri/src/finance.rsMoney tools, including colors, save_budget, and the PDF. suggest fills a month only when Talk is asked to set up or fill the budget. A budget delete waits for confirmed.
src-tauri/src/local/Packs, llama.cpp, Moonshine, Piper, Phonon, and the on-device turn.
src-tauri/src/realtime.rsxAI and OpenAI voice sessions.
src-tauri/src/onemin.rs1min.ai text provider.
src-tauri/gen/android/The generated Android project, plus the voice service, widgets, and permissions. Do not re-init over it.
docs/This site. GitHub Pages serves the folder.

Home-screen widgets are declared in AndroidManifest.xml and labeled in strings.xml: Listen, Reminders, Coming up, Net worth, This month, Next 30 days, and Next. HomeWidgets.kt and WidgetTheme.kt paint them from the theme.

Tauri and Android build

You need Node, pnpm, Rust, a JDK, and the Android SDK with NDK 27.1.12297006. CI uses Rust 1.94.1, Temurin 17, Node 26.0.0, pnpm 10.33.0, platform android-37.0, and build-tools 37.0.0.

pnpm install
pnpm tauri dev

That is the desktop shell. Phone alarms, the calendar provider, the keystore, and the foreground service run on Android.

export ANDROID_HOME="$HOME/Android/Sdk"
export ANDROID_NDK_HOME="$HOME/Android/Sdk/ndk/27.1.12297006"
export NDK_HOME="$ANDROID_NDK_HOME"

pnpm tauri android dev
pnpm tauri android build --target aarch64 --apk

The release APK is written to:

src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk

pnpm tauri android init is only for a missing src-tauri/gen/android. This repository already contains that project. build.rs downloads sherpa-onnx v1.13.8 and llama.cpp tag b12774, and it builds libptts_ffi. Model weights are not in the APK.

arm64-v8a

minSdk is 26 and targetSdk is 37 in src-tauri/gen/android/app/build.gradle.kts. The release command targets aarch64. The workflow rejects an APK whose badging ABI or lib/ entries are anything other than arm64-v8a, and it requires lib/arm64-v8a/libptts_ffi.so.

Signing with the debug certificate

The release build type uses the debug signing config. The Gradle comment says “Local sideload key. Replace this with an upload keystore before Play Store.” A local APK is therefore signed with the debug keystore on that machine.

The Release APK workflow signs that file again with apksigner (v2 only) and the repository secrets:

  • ANDROID_KEYSTORE_BASE64
  • ANDROID_KEYSTORE_PASSWORD
  • ANDROID_KEY_ALIAS
  • ANDROID_KEY_PASSWORD

It accepts one certificate, SHA-256 fd400ffe61c9b18654bc40f567275e5a6e13bab8d311355f389f6e46458aafe9. That is the sideload certificate the README calls the debug key. An APK signed by another certificate does not install over an existing copy. GitHub cannot show the secrets again. Keep an offline backup of the keystore.

CI: Build and sign

The workflow file is .github/workflows/release-apk.yml. The workflow name is Release APK. The job name is Build and sign. It runs on ubuntu-24.04 with a 180 minute limit.

  • A pull request into main builds, signs, and verifies. It does not upload a release. The tag it checks is v plus the version in src-tauri/tauri.conf.json.
  • A push of a v* tag builds the same APK and uploads GrokVoice-X.Y.Z.apk to that GitHub release, creating the release when it is missing. A tag push does not replace an asset that is already there.
  • Manual dispatch takes a tag and a dry-run flag. Dry run skips the upload. Manual dispatch can replace the asset with --clobber.

Before the native build, the job runs:

node --experimental-strip-types --test src/lib/setupGuide.test.ts src/lib/i18nCoverage.test.ts

Verify checks versionName, versionCode, minSdk 26, the arm64-v8a ABI, v2 signing, the certificate, and libptts_ffi.so. The 0.1.65 release asset is 58,162,590 bytes, sha256 a1d569de0c02c9a81eedd6f15cd5931472dc8d5284754f3107216db534821313.

Versioning

versionName is the version string. versionCode is major * 1000000 + minor * 1000 + patch. For 0.1.65 that is 1065. The workflow computes it the same way and compares it to aapt dump badging. Gradle reads tauri.android.versionCode and tauri.android.versionName from the generated tauri.properties.

The 0.1.65 bump changed these files:

  • package.json
  • src-tauri/tauri.conf.json
  • src-tauri/Cargo.toml and src-tauri/Cargo.lock
  • src-tauri/src/local/phonon.rs (the Hugging Face user-agent GrokVoice/0.1.72)
  • README.md and docs/index.html, where the user-facing copy names the version

Merge the bump to main, tag that commit vX.Y.Z, and push the tag. See RELEASING.md.

Local AI packs

Definitions are PACKS in src-tauri/src/local/packs.rs and MODELS in src-tauri/src/local/phonon.rs. Bytes below are the download_bytes fields, or the sum of the Phonon file sizes. llama.cpp b12774 loads the GGUF. A custom GGUF is refused above 2,147,483,648 bytes.

PackBytesMinimum RAM
Moonshine Base English, int8250,807,309First-run speech
SmolLM2 135M Instruct Q8_0144,811,3602 GB
Phonon 31m English65,051,089First-run voice
Piper en_US lessac, low67,097,098Other English voice
LFM2.5 350M Q8_0379,217,6322 GB
Qwen2.5 0.5B Instruct Q8_0675,710,8163 GB
Qwen3.5 0.8B Q8_0811,843,8402 GB
Llama 3.2 1B Instruct Q4_K_M807,694,4643 GB
Gemma 3 1B Instruct Q4_K_M806,058,2403 GB
Qwen3.5 2B IQ4_NL1,213,300,9923 GB
Gemma 4 E2B QAT Q42,620,370,9768 GB
Qwen3.5 4B Q4_K_M2,708,804,6088 GB
German NeMo FastConformer, int8108,124,747Optional speech
Piper de_DE thorsten, low67,101,576Optional voice
Spanish NeMo FastConformer, int8107,246,685Optional speech
Piper es_ES davefx, medium67,184,952Optional voice

Phonon 40m checkpoints are gated, CC BY-NC 4.0. Sum of the four files in each spec: English 75,092,305 bytes, Spanish 75,093,175, German 75,092,449, Portuguese 75,093,372, French 75,092,087, multilingual 75,092,127. Minimum RAM for the chat models is localModelCandidates in setupGuide.ts. Strength order in that list picks the strongest model that fits.

Translations and the check

Locales are en, es, de, pt, and ca-ES-valencia. English is the key. t("…") and fill("…") in src/ must exist in every other catalog. Android strings.xml files are values, values-es, values-de, values-pt, and values-b+ca+ES+valencia. Apostrophes in those XML files are written as \'. Spoken lines are the EN, ES, DE, PT, and CA tables in src-tauri/src/i18n.rs.

The check is src/lib/i18nCoverage.test.ts plus src/lib/setupGuide.test.ts. CI runs both before the APK build. Run them locally with the same command as the workflow. A new English string that is missing, empty, or still identical in another locale fails the test, except for names the test keeps on purpose.

Tests

JavaScript tests are the src/lib/*.test.ts files, run with Node’s test runner (node --experimental-strip-types --test). The CI job runs the setup and i18n files. The others cover finance math, colors, appearance, budgets, and time tabs.

Rust unit tests live next to the modules under src-tauri/src. Run them with:

cargo test --manifest-path src-tauri/Cargo.toml

The Release APK workflow does not run that cargo suite. It compiles the Android release instead.

DESIGN-LANGUAGE.md

Read it before changing a screen, sheet, dialog, widget, or theme. Themes may set only the semantic tokens it lists, through data-appearance. No raw hex in a component. No pure black or white. Text is at least 13px. Targets are at least 48px. Keyboard focus draws an outline. Radius stays on 0, 2, and 4px. One accent. Primary actions are solid fills. Secondary actions are underlined text. This site uses the Graphite tokens from src/index.css.

Contribute

Follow CONTRIBUTING.md. A new field or a new kind of record needs create, read, update, and delete on the screen and in Talk, in all five locales. Deletes that remove a saved record wait for a clear yes. Talk does not create an account, a card, or another record the person did not ask for.