AI learning app that builds a model of your knowledge and helps you learn what you don't know
First, for local inference, install ollama, then start it with
OLLAMA_HOST=0.0.0.0 OLLAMA_ORIGINS=* ollama serveYou might have to disable ollama system service first:
sudo systemctl stop ollama
sudo systemctl disable ollamaThe reason for doing this is that default ollama doesn't handle CORS well.
Now, you also need to setup a huggingface account at https://huggingface.co/ Then go to https://huggingface.co/settings/keys and add ssh key from ~/.ollama/id_ed25519.pub This will allow you to download gated models like gemma3n. Now, go to gemma3n page at
Now, proceed to download the model. Note that it is 3 GB in size.
ollama run hf.co/unsloth/gemma-3n-E2B-it-GGUF:Q2_K_XLAfter this, go ahead and setup this project:
npm installNow, to run a local app, do
ionic serveFirst, download the gemma3n model from huggingface at https://huggingface.co/google/gemma-3n-E2B-it-litert-preview
Then copy the file you downloaded to your device:
adb push gemma-3n-E2B-it-int4.task /data/local/tmp/llm/
Then build the js app, sync it with native android sources, build the android app and copy it on the device. You can conveniently do all that with a single command:
npx cap run android
You need android studio installed for this command to work. Also, it would ask you if to pick your device (or emulator) to which to copy the app.
To create a mobile version, first do
ionic capacitor syncto build static files and copyt them into native apps.
Then run for example
ionic capacitor run androidto run the app on the connected android phone or an emulator. Please note that you would need android studio installed for this to work.
You can also open android studio project if you wish to modify java part of the code:
ionic capacitor open android