PTENES
Skip to content
PATH 3

⚙️ Installation & Techniques

The hands-on heart of the course: install Ollama and run your first model, get a ChatGPT-like interface, learn to choose GGUF and quantization, adjust context and temperature, serve an OpenAI-compatible local API, and build a RAG from your documents.

1 · Install 2 · Download model 3 · Run 4 · Chat Local API · OpenAI-compatible · Open WebUI · RAG
6
Modules
36
Topics
~4h
Duration
Intermediate
Level

Trail map

Detailed content

3.1~30 min

🚀 First model running: Ollama

From zero to your first chat with minimal friction — install, download, and run a local model.

What it is:

Runtime that downloads, manages, and runs local models with one command; wraps llama.cpp.

Why learn:

It's the shortest path to your first result.

Key concepts:

Runtime, llama.cpp, cross-platform.

What it is:

On macOS/Linux, a single script; on Windows, a graphical installer.

Why learn:

No build or manual dependency setup.

Key concepts:

curl install, ollama --version.

What it is:

The command ollama run downloads the model and opens the prompt so you can chat.

Why learn:

Seeing the model respond proves the lab works.

Key concepts:

ollama run, llama3.2, qwen2.5.

What it is:

Commands to download, list, remove, and see what’s running.

Why learn:

Keeps disk and memory under control.

Key concepts:

pull, list, rm, ps.

What it is:

The :2b/:7b/:14b tags connect the model to the memory rule in Track 2.

Why learn:

Choosing wrong causes freezes or forces disk swapping.

Key concepts:

Size tags, VRAM/RAM, start small.

What it is:

A Modelfile is the recipe that defines the system prompt, parameters, and base model.

Why learn:

Create an assistant with a personality without programming.

Key concepts:

Modelfile, SYSTEM, ollama create.

View Full
3.2~30 min

💬 ChatGPT-style interface: Open WebUI & LM Studio

From terminal to browser: chat with history, multiple models, and attachments.

What it is:

Chat with history, model switching, and attachments, outside the terminal.

Why learn:

Brings the local experience closer to ChatGPT.

Key concepts:

History, multiple models, attachments.

What it is:

A front end that connects to Ollama or any OpenAI-compatible API, running locally.

Why learn:

It's the local community's default interface.

Key concepts:

Front end, OpenAI-compatible, local.

What it is:

A command docker run starts the interface on port 3000.

Why learn:

Installs in isolation, without cluttering the system.

Key concepts:

docker run, port 3000, volume.

What it is:

App that downloads GGUF and includes chat + a built-in local server.

Why learn:

A 100% graphical option for anyone who doesn't want to use the terminal.

Key concepts:

GGUF, built-in server, desktop.

What it is:

Configure the UI to use the Ollama endpoint and switch models.

Why learn:

It's the link between the polished interface and the engine.

Key concepts:

Endpoint, model selection, system prompt in the UI.

What it is:

Multiple chats, document RAG, prompt profiles, and users.

Why learn:

Turns the toy into a daily tool.

Key concepts:

Multiple chats, RAG, profiles.

View Full
3.3~40 min

📦 Choosing and downloading the right model: GGUF and quantization

Where to find models, which format to download, and which quantization offers the best cost × quality.

What it is:

Central repository of open models, with one model card per model.

Why learn:

That's where almost everything you'll run comes from.

Key concepts:

Repository, model card, open models.

What it is:

GGUF is the packaged format for running via llama.cpp/Ollama on CPU/GPU.

Why learn:

Downloading the wrong format won’t run in your runtime.

Key concepts:

GGUF, safetensors, GPTQ/AWQ.

What it is:

Suffixes like Q4_K_M, Q5, and Q8 indicate how much the weights have been compressed.

Why learn:

Q4_K_M/Q5_K_M are usually the quality × size balance.

Key concepts:

Q4_K_M, Q5, Q8, sweet spot.

What it is:

pull using the Ollama tag, or download the GGUF from HF and import it.

Why learn:

Each path serves a runtime and a level of control.

Key concepts:

ollama pull, GGUF from HF, ollama create.

What it is:

Recaps the memory rule for choosing the quantization based on VRAM/RAM.

Why learn:

Prevents choosing a model that won't fit.

Key concepts:

Memory rule, decision flow, quantization based on VRAM.

What it is:

Check the checksum and test with a standard prompt, comparing quants.

Why learn:

Too aggressive a quant degrades the response.

Key concepts:

Checksum, standard prompt, compare quants.

View Full
3.4~40 min

🎛️ Parameters and quality: context, temperature, offload

The buttons that change the response and speed — and how to diagnose when something gets stuck.

What it is:

num_ctx defines how much the model reads at once; long context uses memory (KV cache).

Why learn:

Increasing it without a plan can exhaust your memory.

Key concepts:

num_ctx, KV cache, memory cost.

What it is:

Temperature measures how random/creative the text is; low = deterministic.

Why learn:

Each task calls for a recipe (code = low, brainstorm = high).

Key concepts:

temperature, top_p, top_k.

What it is:

Defines the role, format, and constraints for the response.

Why learn:

It's the cheapest quality lever.

Key concepts:

Role, format, constraints.

What it is:

num_gpu determines how many layers fit on the GPU; the rest go to the CPU, which is slower.

Why learn:

Balancing offload is what makes it fit and run faster.

Key concepts:

num_gpu, layers, GPU vs. CPU.

What it is:

What speeds up or slows down generation, including KV cache quantization.

Why learn:

Small adjustments can double tokens/s.

Key concepts:

KV cache, batch, tokens/s.

What it is:

Cause checklist: model too large, aggressive quantization, huge context, swapping.

Why learn:

Solve it yourself without guessing in the dark.

Key concepts:

OOM, quantization, context, swapping.

View Full
3.5~40 min

🔌 Serving through an OpenAI-compatible local API

Turn your local model into an endpoint that your apps, scripts, and agents can consume like OpenAI.

What it is:

Expose the local model as if it were OpenAI for apps and scripts.

Why learn:

It's what connects the model to the agents in Track 4.

Key concepts:

Endpoint, integration, reuse.

What it is:

Ollama serves on localhost:11434, with native routes and OpenAI-compatible /v1 routes.

Why learn:

Knowing the right route prevents half the errors.

Key concepts:

localhost:11434, /v1, routes.

What it is:

One curl to stop /v1/chat/completions returns the response in JSON.

Why learn:

Confirm that the API responds before writing code.

Key concepts:

curl, chat/completions, JSON.

What it is:

The same OpenAI SDK, pointed at the local base_url.

Why learn:

Reuses the entire existing ecosystem.

Key concepts:

OpenAI SDK, base_url, dummy api_key.

What it is:

stream:true for real-time responses, an embeddings route, and model routing.

Why learn:

Cover real use cases beyond simple chat.

Key concepts:

stream, embeddings, routing.

What it is:

OLLAMA_HOST=0.0.0.0 + Tailscale to access it from another machine, without opening it to the public internet.

Why learn:

Remote access without leaving a security hole.

Key concepts:

OLLAMA_HOST, tailnet, no public port.

View Full
3.6~45 min

🧠 Embeddings, memory & basic RAG

Give the model memory: retrieve relevant passages from your documents and answer based on them.

What it is:

Vectors that represent the meaning of text; similar ones are close together in space.

Why learn:

It's the foundation of every similarity search.

Key concepts:

Vector, similarity, semantic space.

What it is:

RAG (Retrieval-Augmented Generation) searches for relevant passages and gives them to the model as context.

Why learn:

Answers questions about YOUR documents without retraining.

Key concepts:

RAG, retrieval, context.

What it is:

Ingestion (chunk → embed → store) and query (embed the question → find neighbors → assemble the prompt).

Why learn:

Understanding the flow is what lets you debug it.

Key concepts:

Chunk, embed, neighbors.

What it is:

Download a small embedding model and call the embeddings endpoint via API.

Why learn:

Embedding models even run on budget hardware.

Key concepts:

nomic-embed-text, embeddings endpoint, lightweight.

What it is:

A vector store (Chroma/FAISS/sqlite-vec) stores vectors for similarity search.

Why learn:

It's where RAG memory lives.

Key concepts:

Chroma, FAISS, sqlite-vec.

What it is:

Ingest a .txt, create embeddings, search, and respond with the local model.

Why learn:

Close out the track by proving the complete cycle.

Key concepts:

Ingestion, search, verifiable answer.

View Full