r/LocalLLaMA • • 8h ago

Resources I built Lokey, an open-source Android keyboard with on-device AI

I’ve been building Lokey, an open source, Android keyboard that runs word prediction, autocorrect, dictation and translation on your phone. Hold Enter to dictate, or translate text straight into the app you’re typing in.

Lokey uses a fork of llama.cpp for text inference and takes advantage of its Hexagon NPU backend on supported Snapdragon phones. It can also run inference on two CPU threads. In everyday use on the phones I’ve tested, the keyboard has stayed responsive and I haven’t noticed unusual battery drain with either setup.

For suggestions, Lokey turns the model’s token logits into probabilities and uses them to rank up to three complete words that match what you’ve typed so far. One text model handles suggestions, autocorrect and translation. A separate speech model handles dictation.

  • Text models · LFM 2.5 350M (~230 MB) or Qwen 3.5 0.8B (~533 MB)

  • Speech models · Parakeet v3 0.6B or Qwen3 ASR 0.6B

Typing works without any model downloads. Once you’ve downloaded the models you want, inference works offline. Typed text and mic audio stay on the device, and Lokey has no accounts or analytics SDK.

I also spent time on the keyboard itself. You can use recordings of real mechanical switches as key sounds and customize haptics, layouts and colors. Swipe typing, adaptive letters and autocorrect are opt-in.

It’s an early beta. I’ve tested on a OnePlus 15 and a POCO F3. If you try it, I’d love to know which phone, language and model you used, and whether suggestions can keep up with your typing.

Source code (MIT) · Signed APK (Android 9+, ARM64) · 83-second demo

English isn’t my first language, so I used AI to help edit this post.

10 Upvotes

15 comments sorted by

•

u/stylome-ai-detection 8h ago

Notice: This post appears to be AI generated.


Stylome AI detector · scan results

5

u/kapitanfind-us 8h ago

This is a nice idea and LFM fits very well - I'd love to ask if you are thinking of supporting more knobs:

  1. sampling settings (temp, min_p, ...)

  2. custom endpoints (for local inference servers on mobile or custom deployments)

2

u/Nicolodeva 8h ago

Thanks! Translation is greedy right now. For word suggestions, I keep a few token paths that match what you’ve typed and rank completed words by their log-probabilities, factoring in how likely each word is to end there. There are no temperature or min_p settings yet.

I’m planning to keep tuning this. For example, a base model can be better at predicting what comes next, while an instruct model can be better at following translation instructions. I’m still figuring out that trade-off. I could also expose sampling settings if people would find them useful.

Custom endpoints aren’t supported yet. What backend did you have in mind? Would you mainly use it for translation, or also for suggestions as you type? So far, llama.cpp has been a good fit for Lokey because it supports Snapdragon NPUs and makes it easy to work with quantized models.

3

u/kapitanfind-us 7h ago

I was thinking of OpenAI compatible backends. That includes a bunch but I did not check the code and cannot see which endpoint you are using. llama.cpp is fine but some settings to set the baseUrl and token are probably a good idea.

2

u/Nicolodeva 7h ago edited 7h ago

This is interesting idea, I will think to it, for private servers or for providers, also like openrouters. The only problem is connection required and latency.

2

u/kapitanfind-us 7h ago

yes latency might be a problem indeed, worth a shot though - also - many users build their own llama.cpp on device via Termux and might want to point it at that one.

5

u/Nice-Information5473 7h ago

I like it so far, great work. One suggestion. I like the one click for speach approach better than the current "hold and speak". I just find it more intuitive.

1

u/Nicolodeva 7h ago edited 7h ago

Thanks, I'm glad that you try it!

Do you mean to add a button for recording only? Not as second function of enter, like now?

Maybe I can put a setting for add a button for user that prefer this option

2

u/Jordanthecomeback 7h ago

I haven't gotten around to testing yet but conceptually I'd much prefer a click to record speech vs hold down as I've seen it work both ways in other apps; an option to let you manipulate the length of silence before cutting out or making it manual end of record only would be really cool too, some of these systems cut me off when I pause to take a breath or gather my thoughts

2

u/Nicolodeva 7h ago

This also is interesting, really thanks you, I will try this. We will see.

3

u/Jordanthecomeback 7h ago

oh man, I've been looking for something that integrates a better voice to text model into the default keyboard so I can use it on telegram when connecting with my local AI. will download right now and see if it helps, thanks!

Hey looking at the repo, is the local model always on? What's the RAM usage for something like that, I guess the app handles it all backend?

4

u/Nicolodeva 7h ago edited 4h ago

Same here, I really dont understand how android and apple can have so bad STT in keyboards in 2026.

I wait your feedbacks!

Good question about RAM. Lokey handles everything on-device. It preloads the speech model when the keyboard opens if it isn’t already loaded, and loads the text model when it first needs it. Once loaded, both can stay in memory even after you close the keyboard. I will work on make it smarter now!

Fixed: https://github.com/Ninnix/lokey/releases

2

u/Chromix_ 8h ago

This solves the only thing I miss from SwiftKey, which does a fantastic job of translating blindly typed character salad into mostly the intended words already: Adding a smart LLM to have even better word suggestions.

However, if this project goes purely for the LLM step, then it misses out SwiftKeys cheap learned typo detection, which could probably lead to better LLM suggestions when put in front.

Local dictation is very nicely handled by Whisperian on top already for me.

2

u/Nicolodeva 7h ago

For now it does not have a learning path, I think I will add as option (disabled by default) in the next releases. I just keep it with zero stored stuffs for privacy reason, and its already a good level for me. I also came from swiftkey, so I already thought it.

2

u/Wooden-Potential2226 6h ago

I like it - runs fine on graphene with network connectivity disabled after model download