Android-nativo

App Android nativa (Kotlin/Compose): motore omni via JNI, chat, log e API locale sulla porta 17500.

Kotlin · Compose JNI · llama.cpp minSdk 26 · arm64-v8a
Schermata principale dell'app Android — stato API e backend attivo
Dashboard principale — backend attivo, porta API e stato servizi

Schermate

Tre schermate Compose e una pagina di stato servita dall’app.

MotoreEngine

Sceglie i provider (LLM Omni o Solo testo; STT Omni o Sherpa-onnx; TTS LFM3-Omni, Supertonic o Kokoro), la voce, la temperatura, la velocità della sintesi e la traduzione in inglese. Poi il modello (cartella e file .gguf + mmproj), il dispositivo di calcolo (CPU o GPU Vulkan), i livelli su GPU, la porta e il binding dell’API HTTP. Picks the providers (LLM Omni or Text only; STT Omni or Sherpa-onnx; TTS LFM3-Omni, Supertonic or Kokoro), the voice, the temperature, the synthesis speed and the English translation. Then the model (folder and .gguf file + mmproj), the compute device (CPU or Vulkan GPU), the GPU layers, the port and the HTTP API binding.

ChatChat

Conversazione con l’omni: i messaggi sono etichettati “Tu” e “Omni”. Sotto, il riepilogo dell’ultima risposta (token, millisecondi, token al secondo). Ci sono il campo messaggio, Invia, Azzera chat e il pulsante microfono per la chat vocale. Conversation with the omni: messages are labelled “You” and “Omni”. Below it, the summary of the last reply (tokens, milliseconds, tokens per second). There is the message field, Send, Clear chat and the microphone button for voice chat.

LogLog

Le righe del file di log del motore, con l’auto-aggiornamento attivabile. Ogni riga è nel formato HH:mm:ss.SSS [motore] messaggio; a piè compare il percorso del file e il numero di righe. The lines of the engine log file, with auto-refresh you can toggle. Each line is HH:mm:ss.SSS [engine] message; at the bottom you see the file path and the number of lines.

Stato su Android: il modello omni (chat, sintesi e riconoscimento) gira sul dispositivo tramite JNI. Il provider STT sherpa-onnx è già selezionabile nell'interfaccia, ma il suo backend ONNX su Android non è ancora collegato. Status on Android: the omni model (chat, synthesis and recognition) runs on the device through JNI. The sherpa-onnx STT provider can already be selected in the interface, but its ONNX backend is not wired up on Android yet.

Hardware verificato

Due dispositivi reali, due profili di accelerazione.

DeviceSoCGPUAPIBackend
POCO F7Snapdragon 8s Gen 4Adreno 825Android 16 CPU OpenCL
Redmi Note 9Helio G80Mali-G52 MC2Android 12 CPU
GPU: su entrambi i dispositivi l’accelerazione non è utilizzabile in modo affidabile (driver Vulkan 1.1/1.2 incompleto, OpenCL 1.1 senza estensioni richieste). Il motore resta su CPU con fallback automatico. GPU: on both devices acceleration is not reliably usable (incomplete Vulkan 1.1/1.2 driver, OpenCL 1.1 without the required extensions). The engine stays on CPU with automatic fallback.

Prestazioni

Misurazioni CPU con contesto Flash Attention + KV Q8_0.

OperazionePOCO F7Redmi Note 9NoteOrigine
Chat (decode)~14,5 tok/s~4,5 tok/s4 thread, Q4_0misurato stima
TTS (LFM3-Omni)~5,0 s~12 s18 caratterimisurato stima
ASR (LFM3-Omni)~3,4 s~8 s33 caratterimisurato stima
Voice chat completo~29 sn/dASR + chat + TTSmisurato
Origine dei dati: i valori del POCO F7 sono misurati sull’app installata; quelli del Redmi Note 9 sono stime di progetto, perché il dispositivo non era disponibile per la misurazione. Data origin: the POCO F7 figures were measured on the installed app; the Redmi Note 9 ones are project estimates, because the device was not available for measurement.
Contesto: Flash Attention attivo, KV cache Q8_0, n_batch 2048, prefill a chunk. Il modello è compute-bound: la KV quantizzata aiuta soprattutto con history lunghe. Context: Flash Attention enabled, Q8_0 KV cache, n_batch 2048, chunked prefill. The model is compute-bound: quantized KV helps mostly with long histories.

API sul telefonoAPI on the phone

L’app incorpora un server HTTP (Ktor) con gli stessi percorsi del desktop. The app embeds an HTTP server (Ktor) with the same paths as the desktop.

ServizioService
/ /health /v1/models
OpenAI-compatibleOpenAI-compatible
/v1/chat/completions /v1/audio/transcriptions /v1/audio/translations /v1/audio/speech /v1/voice/chat
Voicebox-compatibleVoicebox-compatible
/profiles /generate /transcribe
GestioneManagement
/api/settings /api/services /api/voices /api/log
Differenze: su Android le impostazioni si salvano con POST /api/settings (sul desktop è PUT), il log si legge da /api/log (sul desktop /api/activity) e il modello esposto si chiama local-omni. Differences: on Android the settings are saved with POST /api/settings (on the desktop it is PUT), the log is read from /api/log (on the desktop /api/activity) and the exposed model is called local-omni.

Installazione

APK firmato, modello GGUF, avvio automatico.

1 · APK
L’APK firmato si genera con gradlew assembleRelease in AiLocalVoiceServer.Android/ e si installa a mano. Su MIUI/HyperOS serve il tap manuale o “Installa app tramite USB”.The signed APK is built with gradlew assembleRelease in AiLocalVoiceServer.Android/ and installed manually. On MIUI/HyperOS a manual tap or “Install via USB” is required.
2 · Modello
Copia LFM3-Omni-2B-Q4_0.gguf e mmproj-LFM3-Omni-2B-Q4_0.gguf in Download/LFM3/ oppure scegli la cartella dall’app.Copy LFM3-Omni-2B-Q4_0.gguf and mmproj-LFM3-Omni-2B-Q4_0.gguf into Download/LFM3/ or pick the folder in the app.
3 · Avvio
Apri l’app: con “Avvio automatico” attivo il motore carica e l’API sale sulla porta scelta (:17500 per default).Open the app: with “Auto-start” enabled the engine loads and the API listens on the chosen port (:17500 by default).
4 · Build nativa
llama.cpp si compila fuori da Gradle (CMake + NDK) e il bridge JNI si mette in app/src/main/jniLibs/arm64-v8a/: i passaggi sono in docs/ANDROID.md.llama.cpp is compiled outside Gradle (CMake + NDK) and the JNI bridge goes into app/src/main/jniLibs/arm64-v8a/: the steps are in docs/ANDROID.md.
Nota: l’app richiede l’accesso ai file per leggere il modello dalla cartella condivisa. Il modello può anche stare nella cartella privata dell’app, senza permessi. Note: the app needs file access to read the model from shared storage. The model can also live in the app-private folder, with no permission.