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=20261021T133935Z&X-Goog-Expires=3600&X-Goog-SignedHeaders=host&X-Goog-Signature=24c97f51c047c496e9932382652d2950879182db2d494e39bbe07faddc4774efb0882b57414c6370f02a6efc4ded9a5df264442d8f6c0d62c5cd8b66439beacf257a75848e8275f577a7aae0aa603054a54a6996e6f686d4055db7ad7caaa5f057d636fff8caf4297205c30711292f145494fe6f07203c178cc509cccb291b7df8d7f33157eda7da48ca03da9572653adad888c3a27dd9bd4a46529515823e19d1ab15c1a0d6603a4ae0e75b7f8f2cae04ba541530cb0f5ae936a7b2d6b69104ba248529bba4549172d3a4404ce8a1ef4f35d8e3dd894dd1a12f62fd6ded8ebce5179b84fb36b7698749549771a4a0121b8317cbc01f3ab2feb4f2ad197e09eb

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