[PAID] LocalAI: Run Large Language Models (LLMs) completely offline ($10 or INR 701)

LocalAI Extension

Bring the power of ChatGPT directly to your app - 100% offline! This extension allows you to seamlessly integrate Large Language Models (LLMs) right on the user's Android device. Provide your users with smart, conversational AI without worrying about API limits, cloud hosting costs, or internet connectivity.

Key Features:

  • Fast Responses: Highly optimized for mobile processors to ensure lightning-fast generation and optimal response times (minimal delay).
  • Real-time Typewriter UI: Built-in token streaming events let you easily create beautiful, character-by-character typing effects.
  • 100% Free & Private: No API keys, no server costs, and no user data ever leaves the device.
  • Modern Model Support: Compatible with any standard GGUF model (Llama, Gemma, Qwen, etc.).

1. Overview

Version: 1
Released: August 26, 2026
Last Updated: August 26, 2026
Permissions: android.permission.INTERNET (only required if you choose to download models from the web)

Aix Size: 40.16 KB
(Note: Requires dropping the native liblocalai.so binary file or zip into your project's assets)

2. Blocks




3. Documentation

NativeReadyEvent raised when the native AI engine library (liblocalai.so) is successfully loaded and ready.
NativeFailedEvent raised when the native library fails to load. Returns the error message and device ABI info.
message : text
ModelReadyEvent raised when the GGUF model is fully loaded into memory and ready for text generation.
ModelFailedEvent raised when the GGUF model fails to load (e.g. invalid path, corrupt file, or insufficient memory).
message : text
DownloadProgressEvent raised periodically during model download with current progress percentage (0 to 100).
percent : number
DownloadCompletedEvent raised when the model file has finished downloading and is ready. Returns the absolute file path to be passed to LoadModel.
path : text
DownloadFailedEvent raised when model download or extraction fails.
message : text
GotResultEvent raised when text generation is complete. Returns the full generated response text.
text : text
TokenGeneratedEvent raised in real-time each time a new token is generated. Returns the newest 'token' and the accumulated 'partialText' for building streaming typewriter UI.
token : text
partialText : text
FailedEvent raised when text generation fails, is cancelled, or encounters an error.
message : text
LoadNativeLibraryLoads the native inference engine (liblocalai.so). Accepts app asset paths ('//liblocalai.so' or '//liblocalai.zip'), absolute paths ('/storage/.../liblocalai.so'), or 'file://' URIs. Zip files are automatically extracted to private storage. Fires NativeReady or NativeFailed.
path : text
DownloadModelDownloads a GGUF model or a .zip containing a GGUF from a remote URL or copies it from local storage into app-specific private directory. Automatically skips download if the file already exists. Fires DownloadProgress, then DownloadCompleted or DownloadFailed.
url : text
LoadModelLoads a GGUF model file into memory from an absolute path (e.g. returned by DownloadCompleted). Requires LoadNativeLibrary to be executed first. Fires ModelReady or ModelFailed.
path : text
UnloadModelUnloads the currently loaded GGUF model from memory to free up RAM. The native library remains loaded so another model can be loaded quickly.
GenerateStarts generating text asynchronously from the given prompt. Fires TokenGenerated in real-time as tokens arrive, GotResult when finished, or Failed if an error occurs.
prompt : text
CancelCancels an ongoing text generation or model download task immediately.
PromptModeSets the prompt formatting mode. Use 'Chat' (default) to format messages using the model's built-in chat template (System + User prompt), or 'Raw' for direct completion.
Accepts: text
SystemPromptSets the system instruction or persona for the AI in Chat mode (e.g. 'You are a helpful assistant.').
Accepts: text
NativeAssetsVersionVersion stamp for native library assets. Increment this value whenever you update the .so or .zip in app assets to force re-extraction.
Accepts: text
MaxTokensSets the maximum number of tokens (words/sub-words) the model can generate in a single response.
Accepts: number
TemperatureSets the sampling temperature. Lower values (e.g. 0.2) make output focused and deterministic; higher values (e.g. 0.8) make it more creative.
Accepts: number
TopPSets the Top-P (nucleus sampling) threshold (0.0 to 1.0). Only tokens comprising the top probability mass are considered.
Accepts: number
ContextSizeSets the context window size (number of tokens) allocated in memory. Default is 1024 (recommended for 4GB RAM devices).
Accepts: number
ThreadsSets the number of CPU threads used for inference. Set to 0 for automatic detection based on available CPU cores.
Accepts: number
IsModelLoadedReturns true if a GGUF model is currently loaded in memory and ready for text generation.
Accepts: boolean
IsNativeLoadedReturns true if the native AI engine library (liblocalai.so) is loaded and initialized.
Accepts: boolean
IsDownloadingReturns true while a model download or extraction is currently in progress.
Accepts: boolean

4. Example Usage

Step 1: Initialize the Native Engine Before you can do anything, you must load the native C++ library. Use the LoadNativeLibrary block and pass the asset path to your binary (e.g., //liblocalai.zip or //liblocalai.so). The extension will automatically extract and load the library. Important: Always wait for the NativeReady event to fire before attempting to download or load a model!

Step 2: Download a Model
Once the native engine is ready, you need a model to run. Use the DownloadModel block and provide a direct download URL to a .gguf file. The extension will download it safely to the app's private storage (and skip downloading if it already exists).

Here are some highly recommended, mobile-friendly models you can use for testing:

  • Qwen 2.5 (0.5B) - Tiny & Lightning Fast: https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF/resolve/main/qwen2.5-0.5b-instruct-q4_k_m.gguf
  • Llama 3.2 (1B) - Smart & Efficient: https://huggingface.co/bartowski/Llama-3.2-1B-Instruct-GGUF/resolve/main/Llama-3.2-1B-Instruct-Q4_K_M.gguf
  • Phi-3 Mini (3.8B) - High Quality (Requires ~3GB RAM): https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-gguf/resolve/main/Phi-3-mini-4k-instruct-q4.gguf

Tip: You can use the DownloadProgress event to show a progress bar.

Step 3: Load the Model into Memory
When the download finishes, the DownloadCompleted event will fire and provide the local path to the file on the device. Pass this path directly into the LoadModel block. Wait for the ModelReady event to confirm the model is successfully loaded into RAM.

Step 4: Generate Text
Simply call the Generate block with your user's query. Customization: Before generating, you can set the SystemPrompt property to give the AI a persona (e.g., "You are a helpful travel assistant"), and adjust properties like Temperature and MaxTokens to control the creativity and length of the response.

Step 5: Show Real-Time Streaming Responses
Use the TokenGenerated event to update your UI in real-time. This event fires every time the AI thinks of a new word. You can simply set your Label's text to the partialText variable to create a beautiful, ChatGPT-style typewriter effect. Once generation is completely finished, the GotResult event will fire.

5. Demo Video

6. Purchase Extension

UPI id: vknow360@apl

Thank you.
Hope it helps!

5 Likes

Great extension :clap::clap::clap:

  1. Where can I download liblocalai.zip (or liblocalai.so)? Or is this file downloaded/provided automatically by the extension after installation?

  2. Would it be technically feasible to add voice input/output (i.e. real voice-based communication) directly to the extension, without relying on AI2's SpeechRecognizer and TextToSpeech components? Ideally, this would use fully offline/local speech-to-text and text-to-speech models and provide sufficiently natural, low-latency voice interaction.
    (Then I would also like to pay $50. :joy:)

1 Like

Yes, it is provided after purchase. Size of zip file is 3 mb.

It is definitely possible but would be slow enough and may not work on low end devices.

1 Like

Great extension as always. Does it support tool calling?

Okay, but let's talk about high-end devices (Pixel 11 Pro, ...) ...

1 Like

Done (via PayPal).

No, that's difficult to implement since I want to keep support for older devices.

Still cool extension. Tool calling would be nice tho. Good luck

1 Like

I strongly advise against this extension β€” or, more precisely, against using the three LLMs proposed here β€” as it would be a complete waste of time. I thoroughly tested all three models and received virtually no correct or usable answers, regardless of the topic.

Instead, I regularly received lengthy responses containing long, nonsensical, and irrelevant commentary, even though I had explicitly asked that no comments or remarks be included.

Even translating a simple, single-line sentence from German to English β€” with instructions to output only the translated text β€” results in excessive commentary before and after the translation.

Sorry Sunny, I really appreciate your extensions and have been using them for years, but this one is unfortunately a flop.

1 Like

I think there is a small misunderstanding here. :slightly_smiling_face:

This extension itself is not an LLM. Its purpose is to allow you to run compatible LLMs locally on an Android device.

The quality of the responses, translations, and overall behavior depends primarily on the model being used, rather than the extension itself. The extension provides the interface and runtime needed to run those models completely offline on the device.

For example, a model may not have latest information about AI2 due to it being trained in 2023. The solution to this is adding tool calling feature which will increase response quality by a lot but would defy the purpose of local llm.

That said, I really appreciate you taking the time to test it and share your feedback!

2 Likes

Of course I am aware of that, but you do explicitly recommend these models (for your extension).

and the answer goes on and on...

This is the response from SmolLM2 360M.

However, I did optimize original inference engine by huge to shrink output native file. That might have done something with it like hallucination, repeating response, misinterpreting user message etc.

I'll try to fix these issues in v2.
There is definitely scope of improvement.

1 Like

"The result is" 20 is also a superfluous comment.

on hugginface you can check/test the models online for example

  • check gguf and Inference Available ( 314 models out of 200K of gguf available )
  • then in the page of each model you can make queries

For the other 200K models you have to download them : - (

2 Likes