How 23f2005056/lab1aip works
This repository is a hands-on applied GenAI teaching module: students build and measure progressively more capable systems, using a shared Python toolkit. The main workflow moves from structured extraction and prompt/model experiments through search, grounded RAG, failure diagnosis, and a deployed service with evaluation and a regression gate. The graph includes the shared runtime layers and the documented Lab 7 dashboard. Source excerpts are partial, so links for unsampled features are included only where the README or source index supports them; Lab 6 has no source path in the supplied tree.
Main entry points: llm.py Model client · service.py HTTP service · retrieval.py Retrievers · rag.py Grounded answers
Components 22
Shared toolkit
- Model client
aip/llm.py - Output guards
aip/guards.py - Document chunking
aip/chunking.py - Embedding client
aip/embed.py - Retrievers
aip/retrieval.py - RAG reference
aip/rag.py - Evaluation harness
aip/evals.py - Runtime settings
aip/config.py - Response cache
aip/cache.py - Cost ledger
aip/cost.py - Trace writer
aip/tracing.py
Build and measure
- Ticket extractor
labs/lab1/extract.py - Prompt variants
labs/lab2/variants.py - Experiment harness
labs/lab2/grid.py
Retrieval and RAG
- Search sweeps
labs/lab3/search.py - Grounded answers
labs/lab4/rag.py - RAG evaluation
labs/lab4/evaluate.py - Failure diagnosis
labs/lab5/diagnose.py
Ship and observe
- HTTP service
labs/lab7/service.py - Trace dashboard
labs/lab7/dashboard.py - Regression gate
labs/lab7/gate.py
Other components
- Student
Connections 47
- Student → Ticket extractor: builds
README.md - Student → Prompt variants: compares
README.md - Student → Search sweeps: measures
README.md - Student → Grounded answers: builds
README.md - Student → Failure diagnosis: diagnoses
README.md - Student → HTTP service: uses
README.md - Ticket extractor → Model client: calls
labs/lab1/extract.py - Ticket extractor → Output guards: validates
labs/lab1/extract.py - Prompt variants → Ticket extractor: varies
labs/lab2/variants.py - Experiment harness → Prompt variants: runs
labs/lab2/grid.py - Experiment harness → Evaluation harness: scores
labs/lab2/grid.py - Search sweeps → Document chunking: chunks
labs/lab3/search.py - Search sweeps → Retrievers: evaluates
labs/lab3/search.py - Search sweeps → Evaluation harness: measures
labs/lab3/search.py - Grounded answers → Retrievers: retrieves
labs/lab4/rag.py - Grounded answers → Model client: generates
labs/lab4/rag.py - Grounded answers → Output guards: validates
labs/lab4/rag.py - RAG evaluation → Grounded answers: evaluates
labs/lab4/evaluate.py - RAG evaluation → Evaluation harness: scores
labs/lab4/evaluate.py - Failure diagnosis → Search sweeps: inspects
labs/lab5/diagnose.py - Failure diagnosis → RAG evaluation: analyzes
labs/lab5/diagnose.py - Failure diagnosis → Grounded answers: analyzes
labs/lab5/diagnose.py - HTTP service → Retrievers: retrieves
labs/lab7/service.py - HTTP service → Grounded answers: answers with
labs/lab7/service.py - HTTP service → Model client: calls
labs/lab7/service.py - HTTP service → Response cache: reads and writes
labs/lab7/service.py - HTTP service → Cost ledger: accounts
labs/lab7/service.py - HTTP service → Trace writer: records
labs/lab7/service.py - Trace dashboard → Trace writer: reads traces
- Regression gate → HTTP service: checks
- Model client → Response cache: caches calls
aip/llm.py - Model client → Cost ledger: records usage
aip/llm.py - Model client → Trace writer: emits events
aip/llm.py - Model client → Runtime settings: resolves models
aip/llm.py - Embedding client → Response cache: caches vectors
aip/embed.py - Embedding client → Cost ledger: accounts
aip/embed.py - Embedding client → Trace writer: traces calls
aip/embed.py - Retrievers → Document chunking: uses chunks
aip/retrieval.py - Retrievers → Embedding client: embeds text
aip/retrieval.py - Retrievers → Model client: reranks with
aip/retrieval.py - RAG reference → Output guards: validates
aip/rag.py - RAG reference → Model client: generates
aip/rag.py - RAG reference → Retrievers: retrieves
aip/rag.py - Evaluation harness → Model client: judges with
aip/evals.py - Evaluation harness → Cost ledger: accounts
aip/evals.py - Evaluation harness → Trace writer: traces calls
aip/evals.py - Trace writer → Runtime settings: loads settings
aip/tracing.py