# Corso pratico di llama.cpp / llama.cpp Practical Course > Corso pratico su llama.cpp, dall'installazione alla produzione, in italiano e in inglese. A hands-on llama.cpp course, from installation to production, in Italian and English. Autore / author: Prof. Giuseppe Bosi (https://www.giuseppebosi.com, LinkedIn https://www.linkedin.com/in/giuseppebosi). Ogni pagina è disponibile anche in Markdown aggiungendo `index.md` all'indirizzo (every page is also available as Markdown by appending `index.md` to its URL). ## Pagine (italiano) - [Home](https://corso-llamacpp.giuseppebosi.com/): Installa llama.cpp sulla tua macchina e fai girare il primo modello in 10 minuti. - [Informazioni](https://corso-llamacpp.giuseppebosi.com/informazioni/): Guida e corso pratico su llama.cpp, dall'installazione alla produzione. Aggiornato a settembre 2026. - [Lab 00-01: Stimare la memoria di un modello](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-00-01-stima-memoria/): Calcolare, prima a mano e poi con lo script stimamemoria.py, la memoria necessaria a tre modelli in tre quantizzazioni e con contesti diversi; poi… - [Lab 00-02: Anatomia di un file GGUF](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-00-02-anatomia-gguf/): Aprire un file GGUF con gli strumenti Python ufficiali (pip install gguf), leggere metadati, tokenizer e chat template, contare i tensori per tipo e… - [Lab 01-01: Installazione da binari/pacchetti](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-01-01-binari-precompilati/): Installare llama.cpp senza compilare sulla tua piattaforma con due metodi (installer o gestore di pacchetti + tarball della release), verificare versione,… - [Lab 01-02: Build dai sorgenti (CPU)](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-01-02-build-sorgenti-cpu/): Clonare llama.cpp, fissare la build di riferimento del corso, compilare il backend CPU con CMake, misurare quanto ci vuole e quanto risparmi con Ninja e… - [Lab 01-03: Build con backend GPU](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-01-03-build-gpu/): Compilare llama.cpp con il backend della tua GPU (uno dei quattro percorsi: CUDA, Metal, Vulkan, HIP), verificare che il modello finisca davvero in memoria… - [Lab 01-04: llama.cpp in Docker](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-01-04-docker/): Eseguire llama-cli e llama-server dalle immagini ufficiali ghcr.io/ggml-org/llama.cpp, montando la cache dei modelli già scaricata (senza inciampare nei… - [Lab 02-01: Il primo modello](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-02-01-primo-modello/): Scaricare il modello di prova del corso da Hugging Face, trovarlo nella cache, chattare con llama cli usando i comandi interni, dare un prompt di sistema,… - [Lab 02-02: Esperimenti di campionamento](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-02-02-campionamento/): Isolare l'effetto di ogni parametro di campionamento: stesso modello, stesso prompt, stesso seed, un solo flag cambiato per volta. Alla fine avrai una… - [Lab 02-03: Chat template e prompt di sistema](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-02-03-chat-template/): Vedere con i tuoi occhi il testo che il chat template costruisce a partire dai messaggi, capire perché il template sbagliato distrugge le risposte, e… - [Lab 03-01: Da Hugging Face a GGUF](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-03-01-conversione/): Prendere un modello pubblicato in safetensors, convertirlo in GGUF F16 con converthftogguf.py, controllare che il file sia completo (metadati, tokenizer,… - [Lab 03-02: La scala delle quantizzazioni](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-03-02-scala-quantizzazioni/): Produrre con llama quantize tre quantizzazioni dello stesso modello (Q4KM, Q40, Q2K) partendo dal Q80 già in cache, e misurare per ciascuna dimensione, bit… - [Lab 03-03: Quantizzazione con imatrix](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-03-03-imatrix/): Calcolare una matrice di importanza con llama-imatrix su un testo italiano, usarla per produrre un Q2K e confrontarlo con il Q2K "cieco" del lab 03-02 con… - [Lab 04-01: Server e web UI](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-04-01-server-e-webui/): Avviare llama serve con un modello piccolo, leggere i log di avvio, usare la web UI dal browser (allegati, branching, schema JSON) e interrogare con curl… - [Lab 04-02: Client compatibili OpenAI](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-04-02-client-openai/): Parlare con llama serve da un programma tuo, senza curl: prima con l'SDK ufficiale openai in Python (risposta intera e streaming), poi con fetch nativo di… - [Lab 04-03: Carico e parallelismo](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-04-03-parallelismo/): Misurare con uno script di carico che cosa succede quando 4 client interrogano insieme un server con -np 1, -np 2 e -np 4: latenza della singola richiesta,… - [Lab 04-04: Tool calling](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-04-04-tool-calling/): Costruire un agente minimo: il modello riceve la descrizione di una funzione getweather, decide di chiamarla, tu la esegui in Python e gli rimandi il… - [Lab 05-01 · Benchmark riproducibili](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-05-01-benchmark/): Misurare prompt processing (pp) e token generation (tg) con llama bench al variare del numero di thread e della quantizzazione, salvare i risultati in JSON… - [Lab 05-02 · Offload ibrido CPU+GPU](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-05-02-offload-ibrido/): Prendere un modello più grande della VRAM disponibile, trovare sperimentalmente il valore di -ngl che dà la generazione più veloce, e poi recuperare VRAM… - [Lab 05-03 · Decodifica speculativa](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-05-03-speculativa/): Misurare quanto un modello bozza accelera un modello target su due tipi di testo (prosa e codice), capire da cosa dipende il tasso di accettazione e provare… - [Lab 05-04 · Cluster RPC](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-05-04-rpc/): Far girare un modello usando la memoria (e, se c'è, la GPU) di un'altra macchina attraverso il backend RPC di ggml: avviare ggml-rpc-server sull'host… - [Lab 06-01: Scrivere una grammatica](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-06-01-gbnf/): Scrivere da zero una grammatica GBNF per un formato tuo, comandi domotici del tipo accendi luce cucina / imposta termostato soggiorno 22, e provarla con… - [Lab 06-02: Estrazione dati in JSON](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-06-02-estrazione-json/): Trasformare tre annunci immobiliari scritti a mano libera in oggetti JSON con campi tipizzati, usando responseformat con un JSON Schema su… - [Lab 07-01: Descrivere e interrogare immagini](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-07-01-visione/): Far "vedere" un'immagine a un modello con llama.cpp in tre modi: da riga di comando (--image), in chat (/image) e via API (imageurl con data URI base64).… - [Lab 07-02: Audio e voce](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-07-02-audio/): Dare un file audio in ingresso a un modello (trascrizione e comprensione) da cli e via API, e generare un file WAV parlato con llama-tts. Il flusso è lo… - [Lab 08-01: Un programma C++ con libllama](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-08-01-c-api/): Scrivere un generatore di testo minimo in C++ senza passare dal server: aprire un GGUF con la C API di libllama, tokenizzare un prompt, far girare… - [Lab 08-02: RAG minimo](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-08-02-rag-minimo/): Costruire un RAG (Retrieval-Augmented Generation) completo ma minuscolo, con solo due endpoint di llama serve e due librerie Python (numpy, requests):… - [Lab 09-01: Il server come servizio](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-09-01-servizio/): Installare llama serve come servizio systemd che parte al boot, riparte da solo se cade, gira con un utente senza privilegi e in un sandbox, legge la chiave… - [Lab 09-02: Proxy e monitoraggio](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-09-02-proxy-monitoraggio/): Mettere llama serve dietro Caddy con HTTPS e chiave API, raccogliere le metriche con Prometheus, costruire una dashboard Grafana e usarla per leggere cosa… - [Lab 10-01 · Un grafo ggml a mano](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-10-01-grafo-ggml/): Scrivere (anzi: leggere riga per riga, compilare ed eseguire) due programmi C che moltiplicano due matrici con ggml. Il primo, matmul.c, usa l'API "a… - [Lab 10-02 · Control vector](https://corso-llamacpp.giuseppebosi.com/laboratori/lab-10-02-control-vector/): Generare un control vector "allegro ↔ triste" per Qwen3.5-0.8B a partire da cinque coppie di prompt, ispezionare il GGUF prodotto e applicarlo a llama cli… - [Modulo 00: Introduzione a llama.cpp](https://corso-llamacpp.giuseppebosi.com/moduli/00-introduzione/): Questo modulo ti dà la mappa: cos'è llama.cpp, com'è fatto dentro, che cosa c'è in un file GGUF e come capire prima di scaricare se un modello sta nella… - [Modulo 01: Installazione su varie piattaforme](https://corso-llamacpp.giuseppebosi.com/moduli/01-installazione/): Ci sono cinque modi per avere llama.cpp: l'installer di llama.app, un gestore di pacchetti, i binari precompilati della pagina release, Docker, la… - [Modulo 02: Primi passi: llama cli](https://corso-llamacpp.giuseppebosi.com/moduli/02-primi-passi/): Prerequisito: llama installato (modulo 01). Su Ubuntu con il binario dell'installer ricorda export SSLCERTFILE=/etc/ssl/certs/ca-certificates.crt,… - [Modulo 02b: Scegliere il modello per la tua macchina](https://corso-llamacpp.giuseppebosi.com/moduli/02b-scegliere-modello/): Hai fatto girare il primo modello (modulo 02) e ti stai chiedendo: quale modello scarico adesso? Questo modulo risponde con una regola semplice, una tabella… - [Modulo 03: Modelli, GGUF e quantizzazione](https://corso-llamacpp.giuseppebosi.com/moduli/03-modelli-gguf-quantizzazione/): Nel modulo 00 hai visto che cos'è un GGUF e che cosa significa quantizzare; nel modulo 02 hai scaricato un GGUF già pronto. Qui chiudi il cerchio: come si… - [Modulo 04: llama serve: server e API](https://corso-llamacpp.giuseppebosi.com/moduli/04-server-api/): 1. Scarica (o prende dalla cache HF) il modello e ascolta su http://127.0.0.1:8080; web UI su /. 2. File locale, contesto 8192, tutti i layer su GPU (-ngl è… - [Modulo 05: Prestazioni e ottimizzazione](https://corso-llamacpp.giuseppebosi.com/moduli/05-prestazioni/): Un modello che "gira" non basta: deve girare abbastanza in fretta per l'uso che ne fai. In questo modulo impari a misurare le prestazioni in modo… - [Modulo 06: Output strutturato: grammatiche GBNF e JSON Schema](https://corso-llamacpp.giuseppebosi.com/moduli/06-output-strutturato/): Un modello di linguaggio produce testo libero. Quando quel testo deve essere letto da un programma (un JSON da decodificare, un comando da eseguire, un… - [Modulo 07: Multimodalità: visione, audio, voce](https://corso-llamacpp.giuseppebosi.com/moduli/07-multimodale/): Fino a qui i modelli hanno letto e scritto solo testo. In questo modulo apri il modello anche a immagini, audio e video con il sottosistema mtmd di… - [Modulo 08: Integrare llama.cpp nelle applicazioni](https://corso-llamacpp.giuseppebosi.com/moduli/08-integrazione-sviluppo/): Finora hai usato llama.cpp "da fuori": cli, server, curl. Questo modulo lo porta dentro la tua applicazione. Ci sono due strade, il server HTTP e la… - [Modulo 09: Messa in produzione](https://corso-llamacpp.giuseppebosi.com/moduli/09-deploy-produzione/): Nei moduli precedenti hai avviato llama serve a mano, in un terminale, e lo hai chiuso con ++ctrl+c++. In produzione il server deve partire da solo,… - [Modulo 10: Approfondimenti: dentro ggml e llama.cpp](https://corso-llamacpp.giuseppebosi.com/moduli/10-approfondimenti/): Nei moduli precedenti hai usato llama.cpp come uno strumento. In questo lo apri: vedi come ggml rappresenta tensori e calcoli, come un grafo passa dallo… - [Progetti di fine corso](https://corso-llamacpp.giuseppebosi.com/progetti-finali/): Lo studente (o un gruppo di 2-3 persone) sceglie un progetto e lo porta a termine in tre settimane. Ogni progetto combina più moduli, produce qualcosa di… - [P1: Assistente documentale locale (RAG)](https://corso-llamacpp.giuseppebosi.com/progetti-finali/P1-assistente-rag-locale/): Un assistente che risponde a domande su un archivio di documenti tuoi (PDF, Markdown, pagine HTML: appunti del corso, manuali, regolamenti, contratti)… - [P2: Server di inferenza in produzione](https://corso-llamacpp.giuseppebosi.com/progetti-finali/P2-server-inferenza-produzione/): Mettere in produzione un endpoint compatibile OpenAI su una macchina Linux (VM, VPS o server di laboratorio): HTTPS, autenticazione con chiavi API, avvio… - [P3: Agente con strumenti](https://corso-llamacpp.giuseppebosi.com/progetti-finali/P3-agente-tool-calling/): Un agente locale che risolve compiti a più passi usando strumenti reali: leggere e cercare nei file, consultare il web o un'API pubblica, fare calcoli,… - [P4: Inferenza su dispositivo edge](https://corso-llamacpp.giuseppebosi.com/progetti-finali/P4-edge-offline/): Portare un modello linguistico su un dispositivo piccolo (Raspberry Pi 4/5, smartphone Android via Termux, mini PC ARM o x86 a basso consumo, un vecchio… - [P5: Pipeline di conversione e valutazione](https://corso-llamacpp.giuseppebosi.com/progetti-finali/P5-pipeline-quantizzazione/): Una pipeline automatica e riproducibile che, dato il nome di un modello Hugging Face (safetensors), produce le sue quantizzazioni GGUF, le valuta per… - [P6: Estrazione dati da documenti e immagini](https://corso-llamacpp.giuseppebosi.com/progetti-finali/P6-estrazione-documenti-multimodale/): Un servizio che riceve scansioni, foto di scontrini e fatture, moduli compilati, tabelle fotografate e restituisce dati strutturati (JSON valido secondo uno… - [Glossario](https://corso-llamacpp.giuseppebosi.com/risorse/glossario/): I termini che incontri nei log, nella documentazione e in questo corso, in ordine alfabetico. Le voci in inglese restano in inglese perché è così che le… - [Link utili](https://corso-llamacpp.giuseppebosi.com/risorse/link/): Guida e corso pratico su llama.cpp, dall'installazione alla produzione. Aggiornato a settembre 2026. - [Modelli consigliati per i laboratori](https://corso-llamacpp.giuseppebosi.com/risorse/modelli-consigliati/): Per capire quale di questi scegliere in base alla tua macchina (RAM, GPU, Mac, Raspberry Pi): Modulo 02b. - [Strumenti del corso](https://corso-llamacpp.giuseppebosi.com/risorse/strumenti/): Due script bash nella cartella scripts/ del repository del corso: uno per controllare che la macchina sia pronta, uno per scaricare in anticipo i modelli… - [Versione di riferimento](https://corso-llamacpp.giuseppebosi.com/versione/): llama.cpp pubblica più build al giorno. Per non inseguirle, il corso usa una versione precisa: ## Pages (English) - [Home](https://corso-llamacpp.giuseppebosi.com/en/): Install llama.cpp on your machine and run your first model in 10 minutes. - [About](https://corso-llamacpp.giuseppebosi.com/en/informazioni/): A hands-on llama.cpp course, from installation to production. - [Lab 00-01: Estimating the memory of a model](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-00-01-stima-memoria/): Calculate, first by hand and then with the stimamemoria.py script, the memory needed by three models in three quantizations and with different contexts;… - [Lab 00-02: Anatomy of a GGUF file](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-00-02-anatomia-gguf/): Open a GGUF file with the official Python tools (pip install gguf), read metadata, tokenizer and chat template, count tensors by type and derive the real… - [Lab 01-01: Installing from binaries/packages](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-01-01-binari-precompilati/): Install llama.cpp without building on your platform with two methods (installer or package manager + release tarball), check the version, backends and… - [Lab 01-02: Building from source (CPU)](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-01-02-build-sorgenti-cpu/): Clone llama.cpp, pin the course reference build, build the CPU backend with CMake, measure how long it takes and how much you save with Ninja and ccache. At… - [Lab 01-03: Building with a GPU backend](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-01-03-build-gpu/): Build llama.cpp with the backend of your GPU (one of four paths: CUDA, Metal, Vulkan, HIP), check that the model really ends up in GPU memory and measure… - [Lab 01-04: llama.cpp in Docker](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-01-04-docker/): Run llama-cli and llama-server from the official ghcr.io/ggml-org/llama.cpp images, mounting the model cache you already downloaded (without tripping over… - [Lab 02-01: The first model](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-02-01-primo-modello/): Download the course test model from Hugging Face, find it in the cache, chat with llama cli using the built-in commands, give a system prompt, ask a… - [Lab 02-02: Sampling experiments](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-02-02-campionamento/): Isolate the effect of each sampling parameter: same model, same prompt, same seed, only one flag changed at a time. At the end you have a table of real… - [Lab 02-03: Chat template and system prompt](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-02-03-chat-template/): See with your own eyes the text that the chat template builds from the messages, understand why the wrong template destroys the answers, and measure how… - [Lab 03-01: From Hugging Face to GGUF](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-03-01-conversione/): Take a model published in safetensors, convert it to GGUF F16 with converthftogguf.py, check that the file is complete (metadata, tokenizer, chat template),… - [Lab 03-02: The quantization ladder](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-03-02-scala-quantizzazioni/): Use llama quantize to produce three quantizations of the same model (Q4KM, Q40, Q2K) starting from the Q80 already in cache, and measure for each one size,… - [Lab 03-03: Quantization with imatrix](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-03-03-imatrix/): Compute an importance matrix with llama-imatrix on an Italian text, use it to produce a Q2K and compare it with the "blind" Q2K from lab 03-02 using… - [Lab 04-01: Server and web UI](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-04-01-server-e-webui/): Start llama serve with a small model, read the startup logs, use the web UI from the browser (attachments, branching, JSON schema) and query the main… - [Lab 04-02: OpenAI-compatible clients](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-04-02-client-openai/): Talk to llama serve from your own program, without curl: first with the official openai SDK in Python (full response and streaming), then with native… - [Lab 04-03: Load and parallelism](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-04-03-parallelismo/): Use a load script to measure what happens when 4 clients query a server together with -np 1, -np 2 and -np 4: latency of the single request, aggregate… - [Lab 04-04: Tool calling](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-04-04-tool-calling/): Build a minimal agent: the model receives the description of a getweather function, decides to call it, you run it in Python and send it the result back,… - [Lab 05-01 · Reproducible benchmarks](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-05-01-benchmark/): Measure prompt processing (pp) and token generation (tg) with llama bench while varying the number of threads and the quantization, save the results as JSON… - [Lab 05-02 · Hybrid CPU+GPU offload](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-05-02-offload-ibrido/): Take a model larger than the available VRAM, find experimentally the -ngl value that gives the fastest generation, and then win back VRAM with a quantized… - [Lab 05-03 · Speculative decoding](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-05-03-speculativa/): Measure how much a draft model speeds up a target model on two kinds of text (prose and code), understand what the acceptance rate depends on, and try the… - [Lab 05-04 · RPC cluster](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-05-04-rpc/): Run a model using the memory (and, if present, the GPU) of another machine through the ggml RPC backend: start ggml-rpc-server on the remote host, connect… - [Lab 06-01: Writing a grammar](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-06-01-gbnf/): Write a GBNF grammar from scratch for a format of your own, home automation commands such as accendi luce cucina / imposta termostato soggiorno 22, and test… - [Lab 06-02: Extracting data as JSON](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-06-02-estrazione-json/): Turn three free-form real estate listings into JSON objects with typed fields, using responseformat with a JSON Schema on /v1/chat/completions. Compare with… - [Lab 07-01: Describing and querying images](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-07-01-visione/): Make a model "see" an image with llama.cpp in three ways: from the command line (--image), in chat (/image) and through the API (imageurl with a base64 data… - [Lab 07-02: Audio and voice](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-07-02-audio/): Feed an audio file to a model (transcription and understanding) from the cli and through the API, and generate a spoken WAV file with llama-tts. The flow is… - [Lab 08-01: A C++ program with libllama](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-08-01-c-api/): Write a minimal text generator in C++ without going through the server: open a GGUF with the libllama C API, tokenize a prompt, run llamadecode, sample… - [Lab 08-02: Minimal RAG](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-08-02-rag-minimo/): Build a complete but tiny RAG (Retrieval-Augmented Generation) with only two llama serve endpoints and two Python libraries (numpy, requests): split four… - [Lab 09-01: The server as a service](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-09-01-servizio/): Install llama serve as a systemd service that starts at boot, restarts on its own if it crashes, runs as an unprivileged user inside a sandbox, reads the… - [Lab 09-02: Proxy and monitoring](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-09-02-proxy-monitoraggio/): Put llama serve behind Caddy with HTTPS and an API key, collect metrics with Prometheus, build a Grafana dashboard and use it to read what happens under… - [Lab 10-01 · A ggml graph by hand](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-10-01-grafo-ggml/): Write (or rather: read line by line, build and run) two C programs that multiply two matrices with ggml. The first, matmul.c, uses the "context" API and… - [Lab 10-02 · Control vector](https://corso-llamacpp.giuseppebosi.com/en/laboratori/lab-10-02-control-vector/): Generate a "cheerful ↔ sad" control vector for Qwen3.5-0.8B from five prompt pairs, inspect the resulting GGUF and apply it to llama cli with positive and… - [Module 00: Introduction to llama.cpp](https://corso-llamacpp.giuseppebosi.com/en/moduli/00-introduzione/): This module gives you the map: what llama.cpp is, how it is built inside, what a GGUF file contains, and how to tell before downloading whether a model fits… - [Module 01: Installation on different platforms](https://corso-llamacpp.giuseppebosi.com/en/moduli/01-installazione/): There are five ways to get llama.cpp: the llama.app installer, a package manager, the prebuilt binaries from the release page, Docker, and building from… - [Module 02: First steps: llama cli](https://corso-llamacpp.giuseppebosi.com/en/moduli/02-primi-passi/): Prerequisite: llama installed (module 01). On Ubuntu with the installer binary remember export SSLCERTFILE=/etc/ssl/certs/ca-certificates.crt, otherwise -hf… - [Module 02b: Choosing the model for your machine](https://corso-llamacpp.giuseppebosi.com/en/moduli/02b-scegliere-modello/): You have run your first model (module 02) and you are wondering: which model do I download now? This module answers with a simple rule, a table per type of… - [Module 03: Models, GGUF and quantization](https://corso-llamacpp.giuseppebosi.com/en/moduli/03-modelli-gguf-quantizzazione/): In module 00 you saw what a GGUF is and what quantizing means; in module 02 you downloaded a ready-made GGUF. Here you close the loop: how to choose a model… - [Module 04: llama serve: server and API](https://corso-llamacpp.giuseppebosi.com/en/moduli/04-server-api/): 1. Downloads the model (or takes it from the HF cache) and listens on http://127.0.0.1:8080; web UI on /. 2. Local file, context 8192, all layers on GPU… - [Module 05: Performance and optimization](https://corso-llamacpp.giuseppebosi.com/en/moduli/05-prestazioni/): A model that "runs" is not enough: it has to run fast enough for what you use it for. In this module you learn to measure performance reproducibly, to find… - [Module 06: Structured output: GBNF grammars and JSON Schema](https://corso-llamacpp.giuseppebosi.com/en/moduli/06-output-strutturato/): A language model produces free text. When that text has to be read by a program (a JSON to decode, a command to run, a "yes/no" to compare), free text is a… - [Module 07: Multimodality: vision, audio, voice](https://corso-llamacpp.giuseppebosi.com/en/moduli/07-multimodale/): So far, models have read and written only text. In this module you open the model up to images, audio and video with llama.cpp's mtmd subsystem, and you… - [Module 08: Integrating llama.cpp into applications](https://corso-llamacpp.giuseppebosi.com/en/moduli/08-integrazione-sviluppo/): So far you have used llama.cpp "from the outside": cli, server, curl. This module brings it inside your application. There are two paths, the HTTP server… - [Module 09: Going to production](https://corso-llamacpp.giuseppebosi.com/en/moduli/09-deploy-produzione/): In the previous modules you started llama serve by hand, in a terminal, and closed it with ++ctrl+c++. In production the server must start on its own,… - [Module 10: Deep dives: inside ggml and llama.cpp](https://corso-llamacpp.giuseppebosi.com/en/moduli/10-approfondimenti/): In the previous modules you used llama.cpp as a tool. In this one you open it up: you see how ggml represents tensors and computations, how a graph goes… - [Final projects](https://corso-llamacpp.giuseppebosi.com/en/progetti-finali/): You (or a group of 2-3 people) choose one project and complete it in three weeks. Each project combines several modules, produces something usable, and must… - [P1: Local document assistant (RAG)](https://corso-llamacpp.giuseppebosi.com/en/progetti-finali/P1-assistente-rag-locale/): An assistant that answers questions about an archive of your own documents (PDF, Markdown, HTML pages: course notes, manuals, regulations, contracts)… - [P2: Inference server in production](https://corso-llamacpp.giuseppebosi.com/en/progetti-finali/P2-server-inferenza-produzione/): Put an OpenAI-compatible endpoint into production on a Linux machine (VM, VPS or lab server): HTTPS, API key authentication, automatic startup, monitoring… - [P3: Agent with tools](https://corso-llamacpp.giuseppebosi.com/en/progetti-finali/P3-agente-tool-calling/): A local agent that solves multi-step tasks using real tools: reading and searching files, querying the web or a public API, doing calculations, querying a… - [P4: Inference on an edge device](https://corso-llamacpp.giuseppebosi.com/en/progetti-finali/P4-edge-offline/): Bring a language model to a small device (Raspberry Pi 4/5, Android smartphone via Termux, low-power ARM or x86 mini PC, an old laptop) and build a useful… - [P5: Conversion and evaluation pipeline](https://corso-llamacpp.giuseppebosi.com/en/progetti-finali/P5-pipeline-quantizzazione/): An automatic and reproducible pipeline that, given the name of a Hugging Face model (safetensors), produces its GGUF quantizations, evaluates them for… - [P6: Data extraction from documents and images](https://corso-llamacpp.giuseppebosi.com/en/progetti-finali/P6-estrazione-documenti-multimodale/): A service that receives scans, photos of receipts and invoices, filled-in forms, photographed tables and returns structured data (valid JSON according to a… - [Glossary](https://corso-llamacpp.giuseppebosi.com/en/risorse/glossario/): The terms you meet in the logs, in the documentation and in this course, in alphabetical order. They match the names you find in --help and in the program's… - [Useful links](https://corso-llamacpp.giuseppebosi.com/en/risorse/link/): A hands-on llama.cpp course, from installation to production. - [Recommended models for the labs](https://corso-llamacpp.giuseppebosi.com/en/risorse/modelli-consigliati/): To understand which of these to choose for your machine (RAM, GPU, Mac, Raspberry Pi): Module 02b. - [Course tools](https://corso-llamacpp.giuseppebosi.com/en/risorse/strumenti/): Two bash scripts in the scripts/ folder of the course repository: one to check that your machine is ready, one to download the lab models in advance. Both… - [Reference version](https://corso-llamacpp.giuseppebosi.com/en/versione/): llama.cpp publishes several builds a day. To avoid chasing them, the course uses one precise version: ## Altri corsi dello stesso autore / Other courses by the same author - [Corso JSON & API](https://corso-api-json.giuseppebosi.com/) - [Costruisci la tua memoria AI (corso RAG)](https://corso-rag.giuseppebosi.com/)