How an AI Assistant Answers Questions
When you ask a question like, "What is machine learning?", your AI assistant completes four simple steps:
- Receives your question (e.g., "What is machine learning?")
- Sends that question to an AI model
- The AI model understands the request and generates an answer
- The answer is returned to your Python program and displayed to the user
For example, the model might return: "Machine learning is a branch of artificial intelligence..."
What is an AI Model?
An AI model is the brain of your assistant. It has already learned from massive amounts of text, books, articles, websites, and publicly available information. When you ask a question, the model predicts the most appropriate response based on its training. To understand how this ability to reason and act compares to more advanced systems, explore our guide on Understanding Generative AI, AI Agents, and Agentic AI: Key Differences Explained.
Key insight: You don't need to know how a model was trained to build useful AI applications. Your focus is on using existing models effectively, not training them from scratch. For a practical, step-by-step implementation, you can follow our guide to Build Your Own ChatGPT: Python AI Assistant Explained.
Where Does the AI Model Run?
There are two common options:
1. Cloud Models
- The model runs on someone else's server
- Your program sends requests and receives responses over the internet
- Examples: OpenAI, Google (Gemini), Anthropic (Claude), Grok
- Disadvantage: Cost - you pay API charges for usage
2. Local Models (Our Choice)
- You download the model onto your own laptop or computer
- Your Python program uses the model directly
- Name: Ollama
- Advantages:
- Free – no ongoing costs
- Private – data stays on your machine
- Easy to install – minimal setup
- Great for learning – safe sandbox
- No API charges – all processing is local
Why We Use Ollama in This Course
Ollama is an open-source, downloadable model that lets you practice every project without worrying about cost. It's the ideal tool for learners who want to build AI agents without incurring expenses. Once you're ready to work with cloud-based options, you can also learn how to Build AI Agents with Microsoft Copilot Studio – No Code Guide to expand your skills.
Summary: Cloud vs. Local at a Glance
| Feature | Cloud Model | Local Model (Ollama) | |---|---|---| | Cost | API charges per request | Free | | Privacy | Data sent to server | Data stays on your machine | | Setup | Requires internet connection | Download once, run offline | | Learning curve | Understanding API keys | Simple local execution | | Best for | Production deployments | Learning and experimentation |
By using a local model, you gain complete control over your workflow and can focus on mastering AI integration without financial barriers. To see how other AI tools can enhance your workflow, check out our list of Top AI Tools to Boost Productivity and Transform Business Operations.
Now, we will try to understand how does an AI assistant understand or answer questions.
So, suppose you ask, "What is machine learning?" So, what you are asking? What
is machine learning? Your assistant performs four simple steps.
Step number one, it receives your question. So, it receives your question, which is what is machine learning.
Then, it sends that question to an AI model. Then, that particular AI model
understands the request, that means that question, and generates an answer. After this generates an answer, the
answer is returned to your Python program and displayed to the user. So, normally you will see the answer
like this for "Machine learning is a branch of artificial intelligence, etc." because you asked, "What is machine
learning?" So, these are the four steps which is taken by your AI assistant. So, the question now is, "What is an AI
model?" Because we keep on talking about AI model. So, try to understand what an AI model is.
AI model is the brain of your assistant. That means, it has already learned from enormous amount of text, books,
articles, websites, and publicly available information. Therefore, since it has already learned,
therefore, when you ask a question, the model predicts the most appropriate response. The model predicts the most
appropriate response based on what it has learned. So,
the more important thing is you don't need to know how the model was trained to build useful AI applications.
That means you don't have to make the model itself. Model is already available. You have to use that.
In this course, our focus is on using AI models effectively rather than training them. So, in this course, we will use
the existing AI model to make AI agents. So, where does the AI model run? Because we need AI model, so we need to
know where that particular AI model run. So, there are two common options. One is the cloud models.
That means the AI model runs on someone else's server, and your program sends request over the
internet. So, the model is available on the internet at a server, and you send the request to the
model, that means server on the internet to get the response back. For example, models from OpenAI, models
from Google, model from Anthropic, Grok. These are the models which are available on the server.
And option two, which we will be using, that is called local models. Local means you have downloaded the AI
models on your laptop or computer and thereafter you make the Python program which uses this AI model which is
already downloaded on local computer. What is advantage of this local AI model? First is it is free.
The second is it is private. That means it is it is to you.
Third is it is very easy to install. Fourth is it is great for learning. And the fifth and most important is no
API charges. If you will use any model which is publicly available on the cloud, then
those particular model will have a cost which you have to bear. So right now in this course, we don't
want to incur any cost to you. Therefore, we are using this downloadable model.
What is the name of that model? That is we will use O L L A M A, Ollama. This is the model which we are going to use. It
is open source model and we will use this model in most of our course. And that suggests that you can practice
every project without worrying about cost. So I hope now this is clear. We will
meet in the next session. Thank you.
The process involves four steps: (1) your application receives the question, (2) sends it to an AI model, (3) the model generates a response based on its training, and (4) the answer is returned to your program for display. The model uses its pre-learned knowledge from vast text sources to predict the most relevant answer.
An AI model is the trained 'brain' of your assistant, already loaded with knowledge from books, articles, and websites. You do not need to train models yourself. Your primary task is to use existing models effectively by integrating them into your applications via code or tools.
Cloud models (e.g., OpenAI, Google Gemini) run on remote servers and require internet access and per-request API payments. Local models like Ollama run on your own computer, are completely free, keep all data private, and can operate offline after a one-time download.
Ollama eliminates all costs, privacy concerns, and internet dependencies. You can practice building AI agents locally without worrying about API charges or data leaving your machine. It provides a safe sandbox for experimentation, making it ideal for learners who want to focus on mastering AI integration without financial barriers.
The main advantages are: zero ongoing costs (completely free), total privacy (your data stays on your machine), simple one-time setup, ability to run offline, a safe learning environment without risk of accidental API charges, and full control over your workflow.
While Ollama is excellent for learning and experimentation, cloud models are generally better suited for production deployments due to scalability, reliability, and advanced features. However, Ollama can still be used for personal or internal projects where cost control and privacy are top priorities.
You need to download and install Ollama from ollama.ai, then pull a model (like Llama 3 or Mistral). After that, your Python code can interact with the model via a simple API call, sending prompts and receiving generated responses—all without any internet connection or paid subscriptions.
Keep this summary
Save it to LunaNotes and it becomes a real note in your library — editable, searchable, and ready to turn into flashcards or a diagram. Free to start.
Save to LunaNotesOr summarise for another video.
32K+ people have turned 65K+ videos into notes
“Very useful tool. I'm using it for the last couple weeks and I'm loving it so far. Makes learning on YouTube a great experience.”
This summary and transcript were automatically generated using AI with the Free YouTube transcript summary tool by LunaNotes.
Related summaries
Install Ollama and Run Qwen3 4B Locally – AI Model Setup Guide
Learn how to install the Ollama AI framework on your computer, download the lightweight Qwen3 4B model, and run it locally via terminal. This step-by-step tutorial lets you chat with an open-source LLM right on your own laptop—no cloud or GPU required.
Free AI Development Setup: Install Python, VS Code & Ollama Tools
Learn how to set up a complete local AI development environment using three free tools. This guide covers Python installation, Visual Studio Code setup, and Ollama for running AI models on your own computer — no GPU or cloud costs required.
How to Write Your First AI Program in Python with Ollama
Learn to write a simple AI-powered Python program that communicates with a local AI model (Ollama). This step-by-step tutorial covers importing libraries, loading environment variables, connecting to the AI, sending a question, and displaying the response.
How to Configure AI Model Settings for Your First Python Program
Learn to set up a configuration file (.env) for your AI program, including base URL, API key, and model name. This tutorial shows how to configure Ollama locally so your Python code can communicate with an AI model without hardcoding settings.
Install Python, VS Code, and Ollama for AI Agent Development
This video provides a step-by-step guide to setting up your development environment for building AI agents. Learn how to install Python, download and configure Visual Studio Code, and set up Ollama with large language models.
Most viewed summaries
A Comprehensive Guide to Using Stable Diffusion Forge UI
Explore the Stable Diffusion Forge UI, customizable settings, models, and more to enhance your image generation experience.
Kolonyalismo at Imperyalismo: Ang Kasaysayan ng Pagsakop sa Pilipinas
Tuklasin ang kasaysayan ng kolonyalismo at imperyalismo sa Pilipinas sa pamamagitan ni Ferdinand Magellan.
Mastering Inpainting with Stable Diffusion: Fix Mistakes and Enhance Your Images
Learn to fix mistakes and enhance images with Stable Diffusion's inpainting features effectively.
Pamamaraan at Patakarang Kolonyal ng mga Espanyol sa Pilipinas
Tuklasin ang mga pamamaraan at patakaran ng mga Espanyol sa Pilipinas, at ang epekto nito sa mga Pilipino.
How to Install and Configure Forge: A New Stable Diffusion Web UI
Learn to install and configure the new Forge web UI for Stable Diffusion, with tips on models and settings.
Found this summary useful?
Take it with you. One click puts it in your own LunaNotes library.
Save to LunaNotes