Architecture Overview
Relevant source files
The following files were used as context for generating this wiki page:
Ownkey Keyboard is a privacy-first, open-source Android Input Method Editor (IME) derived from FlorisBoard. The project focuses on practical "Bring Your Own Key" (BYOK) AI integration, specifically utilizing Mistral Voxtral for Automatic Speech Recognition (ASR) dictation and Large Language Model (LLM) text rewriting.
Sources: README.md:3-10, AGENTS.md:14-16
The architecture is built upon three primary pillars: an IME application layer for user interaction and orchestration, an ASR/AI integration layer for external service communication, and a security layer for encrypted local storage of sensitive API credentials.
Sources: VOXTRAL_KEYBOARD_PLAN.md:18-35
System Components
The project is structured into modular components that separate the keyboard's core input logic from its AI capabilities and user interface management.
Layered Architecture
The application is logically divided into three functional layers:
- IME App Layer: Handles the keyboard lifecycle, audio capture for dictation, state management, and the suggestion/autocorrect pipeline.
- AI Integration Layer: Orchestrates requests to the Mistral Voxtral endpoint and other OpenAI-compatible backends for dictation and text rewriting.
- Security Layer: Manages local API key storage using the Android Keystore-backed encrypted preferences.
Sources: VOXTRAL_KEYBOARD_PLAN.md:19-35, README.md:33-36
Component Relationship
The following diagram illustrates the relationship between the core Android services and the AI integration components:
This diagram shows how the FlorisImeService acts as the entry point, delegating AI tasks to specialized managers that retrieve credentials from the secure storage layer.
Sources: app/src/main/AndroidManifest.xml:45-66, VOXTRAL_KEYBOARD_PLAN.md:19-35, AGENTS.md:17-21
AI Integration and Data Flow
Ownkey's primary differentiator is its integration of networked AI services without blocking local typing responsiveness.
Voice Dictation Flow (Voxtral)
Voice input is routed through an internal dictation flow. Audio captured via the RECORD_AUDIO permission is transmitted to a configured ASR endpoint. By default, this uses the Mistral Voxtral API.
| Parameter | Default Value | Description |
|---|---|---|
| Endpoint | api.mistral.ai/v1/audio/transcriptions | The URL for sending audio data. |
| Model | voxtral-mini-latest | The specific ASR model used for transcription. |
| Storage | Keystore-backed | Local API keys are never stored in plaintext. |
Sources: README.md:23-28, app/src/main/AndroidManifest.xml:13, AGENTS.md:14-22
Sequence: AI Rewrite Request
When a user selects text and triggers a "Rewrite" action, the following sequence occurs:
This sequence demonstrates the "Bring Your Own Key" model where the application retrieves user-provided credentials to authenticate directly with AI providers.
Sources: AGENTS.md:14-22, VOXTRAL_KEYBOARD_PLAN.md:19-35
Extension and Theme System
The architecture includes a sophisticated extension system for themes and language packs. Extensions are handled via a workspace-based editing system that supports metadata validation and zip-based archival.
Extension Workspace Management
The ExtensionEditScreen manages a ExtEditorWorkspace to track modifications to extensions (themes, keyboard layouts, etc.) before they are saved to internal storage.
| Feature | Description |
|---|---|
| Metadata Management | Validates ID, version, title, maintainers, and license. |
| Component Creation | Allows creating components from empty templates or existing ones. |
| Asset Handling | Manages bundled fonts and images within the extension zip. |
| Persistence | Uses ZipUtils to package the saverDir into a .flex archive. |
Sources: app/src/main/kotlin/dev/patrickgold/florisboard/app/ext/ExtensionEditScreen.kt:111-155, app/src/main/kotlin/dev/patrickgold/florisboard/app/ext/ExtensionEditScreen.kt:200-244
Security and Privacy Model
The security architecture is designed to prevent in-app monitoring of private content while enabling secure communication with AI providers.
- Credential Storage: API keys for dictation and rewrite are stored in Android Keystore-backed encrypted preferences. Legacy plaintext keys are migrated and purged upon update.
- Privacy Nuance: While the app itself does not monitor content, networked ASR and LLM requests transmit data to user-configured endpoints governed by the provider's specific privacy policy.
- Permissions: The application requires
INTERNETfor AI requests andRECORD_AUDIOfor dictation.
Sources: README.md:31-42, VOXTRAL_KEYBOARD_PLAN.md:29-35, app/src/main/AndroidManifest.xml:10-13
Summary
The Ownkey Keyboard architecture extends the FlorisBoard base with a specialized AI orchestration layer and a robust security framework for managing user-provided API keys. By separating the ASR and LLM managers from the core IME service, the system maintains high typing responsiveness while providing extensible AI features. Its privacy model shifts control to the user, allowing for custom endpoint configuration and local credential encryption.