HS
Back to Projects
Featured Case Study

AI Keyboard

A privacy-first, on-device AI typing assistant and hands-free macro automation utility powered by local LLMs and Android Accessibility APIs.

Suggestion Latency

<12ms

Real-time on-device inference

Typing Efficiency

+50%

Reduced keystrokes via LLM

Memory Footprint

32MB

Low-overhead background execution

Voice Processing

Offline

No internet connectivity needed

Interface Preview

Type "Draft an email saying I am running late"
Drafting response offline...
Running lateApologiesTraffic delay
Q
W
E
R
T
Y
U
I
O
P
A
S
D
F
G
H
J
K
L
Z
X
C
V
B
N
M

Interactive HTML interface mockup mapping suggestions.

System Architecture

To achieve sub-15ms typing response on mid-range Android hardware, the keyboard runs a dual-layer thread scheduler. The user input loop is isolated from the heavier machine learning execution paths.

01 // Audio Capture

Embedded NDK layer captures microphone buffers with noise cancellation.

02 // On-Device Inference

TensorFlow Lite parses language structures directly in native memory.

03 // Accessibility Mapper

Android Accessibility nodes are crawled to discover active UI boundaries.

04 // Macro Dispatcher

Dispatches touch events to automate workflows based on voice intent.

Implementation Achievements

  • Implemented TensorFlow Lite custom delegate model utilizing Android GPU parallel compute scripts (OpenCL) to run model inferences in under 12ms.

  • Designed fallback offline vocabularies to scale predictions seamlessly across devices with minimal memory profiles.

  • Mapped Android Accessibility Node hierarchies to build voice macros, allowing fully automated app controls like drafting and clicking.

  • Written completely inside memory-managed native C++ boundaries with JNI buffers to prevent JVM Garbage Collector execution stutters.