Case & CodeA FIELD GUIDE TO AI
Start learning

Sources worth spending time with.

Choose a resource for the next question you need to answer. The lessons stand on their own; external reading is a way to deepen them. Links do not imply affiliation or endorsement.

Books and courses

Al Sweigart · Book

Automate the Boring Stuff with Python

Start here for useful small scripts. Read the basics before the file and automation chapters. Use the examples to learn the operations; do not run unfamiliar file-changing code on an original collection.

Jay Alammar · Visual article

The Illustrated Transformer

A deeper visual explanation of attention. Begin after the tokens lesson. Its original encoder–decoder model is a historical starting point; modern language-model architectures vary.

Jay Alammar & Maarten Grootendorst · Book

Hands-On Large Language Models

For readers ready for an illustrated technical treatment and code. The linked author site describes the book and provides companion resources; the full paid text was not the basis for these lessons.

Free course

Hugging Face LLM Course

Use selected explanations for deeper understanding. The full course expects good Python knowledge and is better approached after introductory deep learning; it is not the first step for a nontechnical reader.

fast.ai · Free course and companion book

Practical Deep Learning for Coders

A practical route into building models, starting from working examples. The course states a coding prerequisite. Choose it after you can read and modify small programs, rather than expecting a no-code introduction.

Free web-development curriculum

The Odin Project

Useful if you want to build interfaces and understand web applications. Its ordered projects teach a broader development skill set; the legal AI library does not require completing it.

Sources behind the lessons

88 references

Each lesson identifies what its links support. Labels distinguish official material from commentary and teaching resources. A link is not a whole-page verification. Check the current text and the scope of each source before relying on it.

Hugging Face · How do Transformers work?Course

Language-model training, inference, and the distinction between pretraining and further training.

Suggested depth: Technical

Read the source
Jay Alammar · The Illustrated TransformerVisual explanation

An intuitive introduction to numerical representations and attention. The original encoder–decoder architecture is historical; modern models vary.

Suggested depth: Intermediate

Read the source
Hugging Face · TokenizersCourse

Tokenization, numerical IDs, and subword representations.

Suggested depth: Intermediate

Read the source
Anthropic · Effective context engineering for AI agentsEngineering article

Selecting and maintaining context, rather than merely accumulating conversation and tool outputs.

Suggested depth: Intermediate

Read the source
Liu et al. · Lost in the Middle (2023)Research paper

Position-sensitive performance in the specific long-context tasks and models studied; not a current benchmark for all models.

Suggested depth: Technical

Read the source
Hugging Face · Bias and limitationsCourse

Limitations of pretrained models and the persistence of bias.

Suggested depth: Beginner

Read the source
Anthropic · Prompting best practicesDocumentation

Clear instructions, examples, and separating instructions from context. Consult the current linked guidance for model-specific details.

Suggested depth: Practical

Read the source
Chacon & Straub · Pro Git: About Version ControlBook chapter

Recording changes, comparing versions, and restoring prior states.

Suggested depth: Beginner

Read the source
Anthropic · Effective harnesses for long-running agentsEngineering article

Explicit progress records and recoverable artifacts across sessions.

Suggested depth: Intermediate

Read the source
Lewis et al. · Retrieval-Augmented Generation (2020)Research paper

The original research architecture combining retrieval with generation. Modern application pipelines may differ.

Suggested depth: Technical

Read the source
PyMuPDF · Text extraction recipesDocumentation

Text extraction, reading-order limitations, layout, and tables.

Suggested depth: Practical

Read the source
Anthropic · Building effective agentsEngineering article

Distinguishing workflows from agents and decomposing tasks into controlled stages. Architectural concepts are more durable than its tool examples.

Suggested depth: Intermediate

Read the source
Harvey · Official release notesProduct documentation

Review Table functionality and changes. Feature availability depends on the account and current product.

Suggested depth: Practical

Read the source
Hugging Face Audio Course · Speech recognition modelsCourse

Speech recognition as a separate model task from subsequent rewriting.

Suggested depth: Intermediate

Read the source
Anthropic · Equipping agents with Agent SkillsEngineering article

Packaging reusable instructions and resources, with information loaded as needed.

Suggested depth: Intermediate

Read the source
OWASP · LLM01 Prompt InjectionSecurity guidance

Direct and indirect prompt injection and layered mitigation concepts.

Suggested depth: Intermediate

Read the source
OCRmyPDF · CookbookDocumentation

OCR commands, rotation, deskew, sidecar limitations, and precautions around image processing and signed PDFs.

Suggested depth: Practical

Read the source
Sentence Transformers · Semantic SearchDocumentation

Embedding-based passage retrieval and similarity search.

Suggested depth: Intermediate

Read the source
Sentence Transformers · Retrieve & Re-RankDocumentation

A candidate-retrieval stage followed by a more focused relevance-ranking stage.

Suggested depth: Intermediate

Read the source
LangChain · RetrievalDocumentation

Retrieval in application and agent architectures; inspect the implementation actually used.

Suggested depth: Technical

Read the source
SQLite · Foreign Key SupportDocumentation

Referential relationships and enabling foreign-key enforcement.

Suggested depth: Technical

Read the source
PyTorch · TensorsCourse

Numerical arrays, tensor operations, and device placement.

Suggested depth: Technical

Read the source
Hugging Face · Quantization overviewDocumentation

Lower-precision numerical representations and memory tradeoffs.

Suggested depth: Intermediate

Read the source
Ollama · Context lengthDocumentation

Configured context and its relationship to memory requirements.

Suggested depth: Practical

Read the source
Ollama · QuickstartDocumentation

Installation entry point and basic local inference workflow.

Suggested depth: Practical

Read the source
Ollama · CLI referenceDocumentation

Running, listing, and inspecting local models.

Suggested depth: Practical

Read the source
Ollama · FAQOfficial documentation

ollama ps and the PROCESSOR column, model storage locations, and disabling cloud features.

Suggested depth: Technical

Read the source
ggml-org · llama.cppProject documentation

Local inference implementation, formats, and supported hardware backends.

Suggested depth: Technical

Read the source
Python · pathlibDocumentation

Filesystem paths, file traversal, and file metadata.

Suggested depth: Practical

Read the source
Python · csvDocumentation

CSV writing and quoting values correctly.

Suggested depth: Practical

Read the source
Al Sweigart · Automate the Boring Stuff: Reading and Writing FilesBook chapter

Further study of paths and file operations through practical programming examples.

Suggested depth: Practical

Read the source
MDN · Overview of HTTPDocumentation

Client–server requests and responses.

Suggested depth: Beginner

Read the source
Python · jsonDocumentation

Encoding and decoding JSON data.

Suggested depth: Practical

Read the source
Python · urllib.requestDocumentation

Constructing and sending HTTP requests from Python.

Suggested depth: Practical

Read the source
Ollama · API usageDocumentation

Local API usage; the linked API documentation covers endpoint payloads and streaming.

Suggested depth: Practical

Read the source
Python · sqlite3Documentation

In-memory databases, parameterized statements, and Python's SQLite interface.

Suggested depth: Practical

Read the source
Hugging Face PEFT · LoRADocumentation

Parameter-efficient adaptation using trainable update matrices with frozen original weights.

Suggested depth: Technical

Read the source
Docker · What is a container?Documentation

Containers and their role in packaging and running applications.

Suggested depth: Beginner

Read the source
Docker · VolumesDocumentation

Persistence beyond a container's lifecycle; backup and restore require deliberate design.

Suggested depth: Practical

Read the source
Anthropic · Demystifying evals for AI agentsEngineering article

Defined tasks, graders, repeated trials, traces, and evaluating actual outcomes.

Suggested depth: Intermediate

Read the source
Law Society of Ontario · Using technologyProfessional guidance

Entry point to current professional technology and generative-AI guidance. Linked resource listing located 15 October 2026; the page blocked automated full-text access.

Suggested depth: Practical

Read the source
PyTorch · Optimizing model parametersCourse

Loss, gradients, and optimization in a training loop.

Suggested depth: Technical

Read the source
Hugging Face · Text generation inferenceCourse

Decoding, sampling, and generation settings.

Suggested depth: Intermediate

Read the source
Claude Code · How Claude remembers your projectDocumentation

Persistent project instructions and their distinction from enforced configuration. Reviewed 15 October 2026.

Suggested depth: Intermediate

Read the source
Law Society of Ontario · Licensee use of generative artificial intelligence (white paper, April 2024)Professional guidance

How the Rules of Professional Conduct apply to generative-AI-assisted work: competence, confidentiality, supervision, and candour. The paper is guidance, not a rule.

Suggested depth: Practical

Read the source
Ontario Bar Association · Recent amendments to the Rules of Civil Procedure (O. Reg. 384/24)Professional commentary

The 1 December 2024 amendments adding certification of the authenticity of authorities for factums (r. 4.06.1) and expert reports (r. 53.03), and the presumption for authorities from recognized sources. Confirm the current rule text before filing.

Suggested depth: Practical

Read the source
Osler · Artificial advocacy: how Canadian courts and legislators are responding to generative AIProfessional commentary

A survey of certification and disclosure requirements across Canadian courts and of early decisions on fabricated citations, including Zhang v. Chen, 2024 BCSC 285. Requirements change; verify the current notice for the relevant court.

Suggested depth: Practical

Read the source
Torkin Manes · AI gone awry: the unauthorized use of AI in courts (Ko v. Li, 2025 ONSC 2766)Professional commentary

A summary of Ko v. Li, 2025 ONSC 2766, and of the Federal Court notice on the use of AI in court proceedings (updated May 2024). Read the decision itself before relying on any proposition from it.

Suggested depth: Practical

Read the source
Gowling WLG · Artificial intelligence in public decision-making: guidelines, jurisprudence and open questionsProfessional commentary

Summaries of the Canadian Judicial Council Guidelines for the Use of Artificial Intelligence in Canadian Courts (24 October 2024) and the Federal Court interim principles on its own use of AI (September 2025).

Suggested depth: Practical

Read the source
American College of Trial Lawyers · Canadian cases involving improper use of AI in court proceedings (compilation)Reference compilation

A compilation of Canadian decisions in which courts addressed fabricated or unverified AI-generated material. Useful as a catalogue of fact patterns; read each decision before citing it.

Suggested depth: Practical

Read the source
llama.cpp · README (quick start, supported backends)Official documentation

Install routes, the llama cli and llama serve quick start, supported backends, and CPU+GPU hybrid inference.

Suggested depth: Technical

Read the source
llama.cpp · Install pre-built version (docs/install.md)Official documentation

winget, Homebrew, and conda-forge install commands.

Suggested depth: Technical

Read the source
llama.cpp · Build llama.cpp locally (docs/build.md)Official documentation

CMake build commands for CPU, CUDA, Vulkan, HIP, and Metal, and the Metal --n-gpu-layers 0 note.

Suggested depth: Technical

Read the source
llama.cpp · CLI options (tools/cli/README.md)Official documentation

Flags including -hf, -ngl (auto or all), --list-devices, --offline, --cpu-moe, and KV cache types.

Suggested depth: Technical

Read the source
llama.cpp · Server (tools/server/README.md)Official documentation

llama-server defaults (host 127.0.0.1, port 9931) and the LLAMA_CACHE model cache.

Suggested depth: Technical

Read the source
llama.cpp · llama-bench (tools/llama-bench/README.md)Official documentation

Benchmark syntax: prompt-processing (pp) and text-generation (tg) tests.

Suggested depth: Technical

Read the source
llama.cpp · Releases (build b11687, 16 October 2026)Official documentation

Pre-built binaries for Windows CUDA, Vulkan, ROCm, and CPU, macOS, and Linux.

Suggested depth: Technical

Read the source
Ollama · README (install and run)Official documentation

Install commands for macOS, Linux, and Windows and the ollama run command.

Suggested depth: Technical

Read the source
Ollama · WindowsOfficial documentation

Windows requirements: NVIDIA driver 551.61+, AMD ROCm v7 or Vulkan; OLLAMA_MODELS.

Suggested depth: Technical

Read the source
Ollama · Hardware supportOfficial documentation

Supported NVIDIA compute capabilities and AMD Radeon models by platform.

Suggested depth: Technical

Read the source
LM Studio · System requirementsOfficial documentation

Apple Silicon and macOS 14+; Windows x64 with AVX2 or ARM; 16 GB RAM and 4 GB VRAM recommended.

Suggested depth: Technical

Read the source
LM Studio · lms CLIOfficial documentation

lms ls, lms ps, lms load --gpu, and lms server start.

Suggested depth: Technical

Read the source
LM Studio · Import modelsOfficial documentation

The ~/.lmstudio/models directory structure.

Suggested depth: Technical

Read the source
Apple ML Explore · mlx-lm READMEOfficial documentation

pip install mlx-lm, mlx_lm.generate and mlx_lm.chat on Apple silicon.

Suggested depth: Technical

Read the source
Open WebUI · READMEOfficial documentation

pip install open-webui (Python 3.11) and open-webui serve on localhost:8080.

Suggested depth: Technical

Read the source
AnythingLLM · READMEOfficial documentation

Desktop app for Mac, Windows, and Linux; built-in local engine; connects to Ollama and LM Studio.

Suggested depth: Technical

Read the source
vLLM · READMEOfficial documentation

uv pip install vllm; serving-oriented engine.

Suggested depth: Technical

Read the source
Microsoft Learn · New-NetFirewallRuleOfficial documentation

Creating outbound block rules by program in Windows Firewall with PowerShell.

Suggested depth: Technical

Read the source
NVIDIA · Compare GeForce graphics cardsOfficial documentation

Memory size, bus width, and memory bandwidth for the GeForce RTX 50 series.

Suggested depth: Technical

Read the source
NVIDIA · GeForce RTX 5090 specificationsOfficial documentation

575 W total graphics power, 1,000 W required system power, power connector options.

Suggested depth: Technical

Read the source
AMD · Radeon AI PRO R9700 specificationsOfficial documentation

32 GB GDDR6, 256-bit, 640 GB/s, 300 W, 750 W PSU recommendation.

Suggested depth: Technical

Read the source
Apple Canada · Mac Studio technical specificationsOfficial documentation

Unified memory options and memory bandwidth for M5 Max and M5 Ultra.

Suggested depth: Technical

Read the source
Apple Canada · Mac mini technical specificationsOfficial documentation

Unified memory options and memory bandwidth for M6 and M5 Pro.

Suggested depth: Technical

Read the source
AMD · Ryzen AI Max+ 395 specificationsOfficial documentation

256-bit LPDDR5x-8000 memory, up to 128 GB, Radeon 8060S graphics.

Suggested depth: Technical

Read the source
NVIDIA · DGX Spark specificationsOfficial documentation

64 or 128 GB unified LPDDR5x, 256-bit, 273 GB/s.

Suggested depth: Technical

Read the source
Hugging Face · Mistral Small 3.2 24B config and GGUF filesModel card

40 layers, 8 KV heads, head dimension 128; GGUF Q4_K_M 14.33 GB and Q8_0 25.05 GB in the lmstudio-community repository.

Suggested depth: Technical

Read the source
Hugging Face · Qwen3.6-35B-A3B model cardModel card

35B total, 3B activated, 256 experts with 8 routed and 1 shared; Apache 2.0.

Suggested depth: Technical

Read the source
Hugging Face · gpt-oss model cardModel card

gpt-oss-20b: 21B parameters with 3.6B active; gpt-oss-120b: 117B with 5.1B active; Apache 2.0.

Suggested depth: Technical

Read the source
Hugging Face · Gemma 4 model cardModel card

Dense and mixture-of-experts sizes; 26B A4B with 3.8B active; Apache 2.0.

Suggested depth: Technical

Read the source
Hugging Face · Qwen3.5-0.8B GGUF (ggml-org)Model card

The small model used for the measured benchmark in lesson 9.9.

Suggested depth: Technical

Read the source
Ontario SCJ — Consolidated Civil Provincial Practice Direction, Part J.12, paras122–128Official court direction

AI oversight and verification; paragraph125 reproduces factum certification rule. Updated March17 2026; civil scope excludes Divisional and Small Claims proceedings. Primary page checked16 October2026.

Suggested depth: Practical

Read the source
Federal Court — AI notice, May7 2024, pp1–2Official court notice

Declaration for directly AI-generated litigation content; suggestions/critique distinction and separate treatment of tribunal records/expert reports. Primary notice checked16 October2026; recheck before filing.

Suggested depth: Practical

Read the source
Ontario Rules of Civil Procedure — r4.06.1Primary legislation — current text to check

Factum authenticity certification and listed-source presumption. Direct e-Laws access was blocked in this review; relevant rule wording checked in official SCJ practice direction para125.

Suggested depth: Practical

Read the source
Federal Court — interim principles for its own AI useOfficial court policy

Court-specific policy, distinct from the notice to litigants. Do not treat it as permission for another court or as legal advice.

Suggested depth: Practical

Read the source
OpenAI · A practical guide to building agentsPrimary documentation

Conceptual foundations and starting with a bounded agent. Webpage dated January 15, 2026. Legal examples and illustrative traces are independent Case & Code additions, not executed SDK examples.

Suggested depth: Technical

Read the source
OpenAI Agents SDK · Running agentsPrimary documentation

Runner loop, tool results, handoffs, final output, and maximum turns. A terminated run does not establish task correctness. Reviewed October 16, 2026.

Suggested depth: Technical

Read the source
OpenAI Agents SDK · Human-in-the-loopPrimary documentation

Configured approval interruptions before tool execution; not a guarantee that every platform or tool requests approval. Reviewed October 16, 2026.

Suggested depth: Technical

Read the source
OpenAI Agents SDK · HandoffsPrimary documentation

Transfer of control, configurable history, and distinction from agents used as tools. Reviewed October 16, 2026.

Suggested depth: Technical

Read the source

Lessons, terms, practical guides and sources ESC