Arun Pandian M

Arun Pandian M

Android Dev | Full-Stack & AI Learner

Written by: Arun Pandian M•Published on: Jun 5, 2026

Understanding LLMs, Ollama, and Inference

Before building AI applications, we need to understand three fundamental concepts:

LLM
↓
Ollama
↓
Inference
https://storage.googleapis.com/lambdabricks-cd393.firebasestorage.app/img_understand_olm_inference.svg?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=firebase-adminsdk-fbsvc%40lambdabricks-cd393.iam.gserviceaccount.com%2F20261021%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20261021T141743Z&X-Goog-Expires=3600&X-Goog-SignedHeaders=host&X-Goog-Signature=50abef4fd80223633201d3d25dd287f1de2133d6181cd90f7bc61b3f50327a588e9eaafee781a39e238782e7441399dfccc62f6d5b3366a687eb7f2994762f68de98551911c092655af4f9a3d6be62aba2ebe531b879834262830021936b7629a198af7f97b4bfeac47617fb816b834b73934b6cc5133decd53cd61a8bf9d853e0eb147b432b09828d6d17f80f8040ba0a1d7d9e872bca6ddd915f47b39976bb31e13d60b20cafc58f33d1ff233986ee4c2c779343d76f54c62b5270d839b0c0515e9f031dfe5909d5e97f7e0aad5263695203886bd3d9434eff161945f24a3a3acb488d5d84af0913d3315c19c9dc689c4fe4d9b1847ae884b67b58905a301f

What is an LLM?

LLM stands for Large Language Model.

Examples:

  • Llama
  • Phi
  • Mistral
  • A language model predicts the next piece of text.

    Example:

    Input:

    The capital of France is

    Prediction:

    Paris

    Every response from an LLM is generated one token at a time.

    Training vs Inference

    Two terms you’ll hear frequently:

    Training

    The model learns patterns.

    Books
    Code
    Articles
    ↓
    Training
    ↓
    Model

    Inference

    The model answers questions.

    Question
    ↓
    Model
    ↓
    Answer

    As AI application engineers, we mostly perform inference.

    What is Ollama?

    Think of Ollama as a runtime.

    Java
    ↓
    JVM
    
    Python
    ↓
    Interpreter
    
    LLM
    ↓
    Ollama
    Java
    ↓
    JVM
    
    Python
    ↓
    Interpreter
    
    LLM
    ↓
    Ollama

    Ollama loads and runs models on your machine.

    Example:

    ollama run phi3:mini

    Calling a Model

    Once Ollama is running:

    import ollama
    
    response = ollama.chat(
        model="phi3:mini",
        messages=[
            {
                "role": "user",
                "content": "What is Kotlin?"
            }
        ]
    )
    
    print(response["message"]["content"])

    Flow:

    Python
    ↓
    Ollama
    ↓
    Model
    ↓
    Response

    Experiment

    Try:

    What is Android?

    Then:

    Explain Android to a beginner.

    Notice how the model changes its answer based on the input.

    #MachineLearning#SoftwareEngineering#BuildInPublic#LearningInPublic#LocalLLM#TechEducation#AIJourney#ArtificialIntelligence#AIEngineering#AIAgents#LLM#GenerativeAI#LargeLanguageModels#Ollama#Inference#OpenSourceAI#Python#PromptEngineering#AIApplications#DeveloperTools
    LAMBDA BRICKS