How to install LLM models on Android using termux | Install ollama on Android

Large Language Models (LLMs) are no longer limited to cloud servers or powerful desktops. With Termux, you can run lightweight LLMs locally on Android, giving you privacy, offline access, and full control over your AI models.

In this guide, we’ll walk through installing Ollama and running LLMs on Android using Termux.

                           

What is LLM?

An LLM (Large Language Model) is an artificial intelligence system trained on huge amounts of text to understand and generate human-like language. It uses deep learning and transformer models to predict words based on context. LLMs can answer questions, write content, generate code, translate languages, and chat naturally.

Example:
If you ask an LLM, “Write a Python program to add two numbers”, it can instantly generate the correct code.
Popular LLMs include ChatGPT, Gemini, Claude, and LLaMA. LLMs are widely used in education, content creation, programming help, and automation.

What is Ollama

Ollama is an open source platform that lets you run Large Language Models (LLMs) locally on your device instead of using the internet or cloud servers.

What does Ollama do?

      1.Runs AI models offline
      2.Downloads and manages models easily
      3.Works on PC, Mac, Linux, and Android (via Termux)

     Example

With Ollama, you can run models like LLaMA, Mistral, or Gemma on your own system.

⚠️ Important Notes Before You Start

  • This setup works best on modern Android devices with:

  • Ollama does not officially support Android, so we use a Linux-based workaround

  • Performance will be slower compared to PCs or servers


What You’ll Need

  • An Android phone

  • Stable internet connection

  • Termux (from GitHub or F-Droid, not Play Store)


Step1: Install Termux 

  1. Download Termux from F-Droid or GitHub Releases

  2. Open Termux and allow storage permissions

Update packages:

pkg update && pkg upgrade

Step2: Install Ollama on Termux and run Ollama Server

Ollama requires a standard Linux environment.

Install it in Termux

pkg install ollama

Now run the ollama servre on Android

ollama serve



To check the server open your browser and search  http://localhost:11434/  And you will get a message Ollama is running

Step3: Install llama3.2 Model and run

Now Open a new session on termux and  install llama3.2 and run the model ,using the given code

ollama pull llama3.2

A 2GB file will be downloaded and then  enter the command to run ai model

ollama run llama3.2

Congratulations your AI model has downloaded successfully

Step4:How to stop the model

To stop the model use the command given below

/bye

For any query you can comment us and a full YouTube video about this tutorial is given below








Post a Comment

0 Comments