Introduction to LLMs and SLMs Explained Simply (with Diagrams and Real Code)
Introduction to LLMs and SLMs: The Essentials in One Article — Real Code, Diagrams, and Concrete Steps, Excerpts from a 44-Lesson Course.
A no-nonsense guide: Introduction LLMs SLMs dissected with diagrams, concrete examples and tested commands. Everything comes from a structured 11-chapter course — here are the best parts.
- Introduction and Installation
- How an LLM Works
- Transformer Architecture
- Overview of LLMs in 2026
- SLMs Small Language Models
Install Ollama and run your first model
Learning objectives
- Install Ollama on your operating system
- Verify that the service is running correctly
- Download a model from the Ollama library
- Start a conversation with a local model
- Understand where models are stored on your machine
- Know the basic Ollama commands
Why Ollama?
Ollama is an open-source tool that radically simplifies using LLMs locally. Where you previously had to manually manage quantization, GPU bindings and Python dependencies, Ollama gives you a single binary and a command as simple as ollama run llama3. It has become the reference in 2026 for running an LLM on your laptop.
Simplicity
A single command to download and run a model. No manual GPU configuration.
Multi-platform
Windows, macOS (Apple Silicon) and Linux. Automatically optimized for CPU and GPU.
Built-in REST API
Ollama exposes a local API on http://localhost:11434 for integration into your apps.
Step-by-step installation
Go to https://ollama.com/download and choose your system. Installation takes less than two minutes.
Windows
/bye to exit the conversation and /? to see all available commands in Ollama's interactive mode.Where are the models stored?
Models can be large. Knowing where they live avoids unpleasant storage surprises.
| OS | Default location |
|---|---|
| Windows | C:\Users\<votre-nom>\.ollama\models |
| macOS | ~/.ollama/models |
| Linux | /usr/share/ollama/.ollama/models |
To change this location (to an external drive for example), set the OLLAMA_MODELS environment variable before starting the service.
Ollama API and Python integration
Learning objectives
- Understand that Ollama exposes a local HTTP API
- Call the API with
curland from Python - Use the official Python library
- Pass a system prompt and options
- Integrate a local LLM into an application
Ollama is also a server
In addition to the command line, Ollama runs in the background as a local HTTP server, accessible at http://localhost:11434. Everything the CLI does, you can do via HTTP request, from any language.
The bridge to code
From chatting in the terminal to the Python API, you now know how to integrate a local LLM into any program.
Installation and first pipeline
pipeline.Learning objectives
- Install Transformers and its dependencies
- Understand what a pipeline is
- Run sentiment analysis in 3 lines
- Know the available tasks
- Load a specific model into a pipeline
Hugging Face: the GitHub of models
Hugging Face provides the Transformers library, which has become the standard for using open-source models in Python. It gives access to hundreds of thousands of models through a uniform interface.
Ready-to-use tasks
| Task (string) | What it does |
|---|---|
sentiment-analysis | Determines whether a text is positive or negative. |
text-generation | Completes or generates text. |
summarization | Summarizes a long text. |
translation | Translates from one language to another. |
question-answering | Answers a question from a provided context. |
zero-shot-classification | Classifies a text into categories you define. |
Choosing a specific model
For French or a specific need, explicitly specify the model (its Hugging Face identifier).
This article covers the most useful excerpts — the full Introduction LLMs SLMs course (11 chapters, 44 lessons, corrected exercises and final project) takes you all the way.
./access-the-full-course free course: Prompt EngineeringFAQ
How long does it take to learn Introduction LLMs SLMs?
Are there any prerequisites?
Where to start concretely?
📬 Want to receive this type of guide every week? Subscribe for free — real code, zero fluff.