Skip to content
Part 2: Working with your data

Part 2: Working with your data

Part 2 runs from 06:10 to 08:00 UTC, 110 minutes. You move from typing into a chat window to calling the same model from Python, with notebooks that you run, change and keep.

Part 2 runs on Ollama. If you installed only LM Studio, install Ollama now (10 minutes) or follow as a listener. The steps are on Install Ollama.

Learning outcomes

After Part 2 you can:

  • call a local model from Python, set its options yourself, and record which model and settings each call used;
  • get structured output (an answer that must follow a fixed format, usually JSON), validate it and handle missing values;
  • embed vocabulary concepts (turn each one into a list of numbers that stands for its meaning) and search them by meaning across languages;
  • build a small RAG pipeline that cites its sources and says so when the documents do not answer (RAG means fetching the relevant passages first and giving them to the model with the question);
  • let a model propose a tool call (a request for your program to run a function, such as an authority lookup or a SPARQL query) and approve or correct it before anything runs;
  • explain the limits of small local models from evidence they produced themselves.

Timeline

Minutes are counted from 06:10 UTC. Type-along means we run the notebook cells together. An exercise means you work on your own or in a small breakout room.

Minutes Segment Mode Notebook Site pages
0-10 Re-entry check: environment, server, model type-along 00_check_setup Environment
10-28 Python and Ollama: chat, system prompt, options, streaming, the OpenAI-client switch, provenance logging type-along 01_python_and_ollama Python and Ollama
28-50 Structured output and validation exercise 02_structured_output Structured output
50-72 Embeddings and semantic search over a controlled vocabulary exercise 03_vocabulary_search Embeddings
72-90 RAG over your own documents exercise 04_rag RAG
90-105 Tool use with a human in the loop demo then exercise 05_tool_use Tool use
105-110 Wrap-up: provenance checklist, next steps demo Wrap-up

If Part 2 runs late, we cut the Stretch tiers of RAG and tool use first. They stay in the notebooks for self-study.

From manual to automated

In Part 1 you worked by hand:

  • typing one prompt at a time into a chat window;
  • reading each answer yourself;
  • copying and pasting data in and out.

In Part 2 you work with code:

  • a script handles hundreds of records;
  • a run can be repeated and checked, because the model, options and prompt are recorded;
  • every call is logged, so any result can be traced.

Three ways to take part

  • GUI only. You work in a graphical chat app and write no code. That covers all of Part 1. In Part 2 you follow as a listener and watch the notebooks run.
  • Run the notebooks. You need the environment from the next page, and the model must already be downloaded.
  • Read afterwards. Every notebook is saved with its outputs, so you can read it later without running anything.

Each exercise has three tiers: GUI (do the task in your chat window), Run and change (change one thing and compare) and Stretch (go one step further).

The pages