How vv176/week1_ai_engineering works
This repository is a collection of standalone AI-engineering teaching scripts, not one integrated application. Its lessons cover model behavior and generation, API-based techniques, and application patterns such as structured output, streaming, and concurrency. There is no documented end-to-end workflow, so the graph preserves these as separate learning branches rather than implying a runtime pipeline. External model-service calls are shown only where sampled source demonstrates them; several unsampled lessons are represented by their exact enclosing directories.
Main entry points: streaming_demo Streaming Demos · GPT2_workflow.py GPT-2 Workflow · 03_rlhf_preference.py RLHF Preferences · 02_topk_topp_minp.py Sampling Filters
Components 25
Model Fundamentals
- GPT-2 Workflow
GPT2_workflow.py - Tokenization
tokenizer.py - Vocabulary Printing
vocabulary_printing.py - Embedding Visualization
basic_embedding.py - Base Model
pretraining_sft_rlhf/01_base_model.py - SFT Effects
pretraining_sft_rlhf/02_sft_effect.py - RLHF Preferences
pretraining_sft_rlhf/03_rlhf_preference.py - Temperature Sampling
sampling_deep_dive/01_temperature_visualization.py - Sampling Filters
sampling_deep_dive/02_topk_topp_minp.py - Deterministic vs Creative
sampling_deep_dive/03_deterministic_vs_creative.py
LLM API Patterns
- Token Embeddings API
token_embeddings_api_call.py - Raw Logprobs
logprobs/01_raw_logprobs.py - Confidence Scoring
logprobs/02_confidence_scoring.py - Logprob Classification
logprobs/03_classification_free.py
Application Patterns
- Structured Outputs
structured_outputs - Streaming Demos
streaming_demo - Yield and Generators
streaming_demo/yields
Concurrency Lessons
- Threading Basics
threading_demo - Parallel LLM Calls
threading_demo/08_parallel_llm_calls.py - Parallel Tool Calls
threading_demo/09_parallel_tool_calls.py - Parallel RAG Search
threading_demo/10_divide_and_conquer_rag.py - Streaming with Threads
threading_demo/11_streaming_plus_threading.py
Other components
- Learner
- OpenAI API
- Hugging Face GPT-2
Connections 31
- Learner → GPT-2 Workflow: runs lesson
GPT2_workflow.py - Learner → Tokenization: runs lesson
tokenizer.py - Learner → Vocabulary Printing: runs lesson
vocabulary_printing.py - Learner → Embedding Visualization: runs lesson
basic_embedding.py - Learner → Token Embeddings API: runs lesson
token_embeddings_api_call.py - Learner → Raw Logprobs: runs lesson
logprobs/01_raw_logprobs.py - Learner → Confidence Scoring: runs lesson
logprobs/02_confidence_scoring.py - Learner → Logprob Classification: runs lesson
logprobs/03_classification_free.py - Learner → Base Model: runs lesson
pretraining_sft_rlhf/01_base_model.py - Learner → SFT Effects: runs lesson
pretraining_sft_rlhf/02_sft_effect.py - Learner → RLHF Preferences: runs lesson
pretraining_sft_rlhf/03_rlhf_preference.py - Learner → Temperature Sampling: runs lesson
sampling_deep_dive/01_temperature_visualization.py - Learner → Sampling Filters: runs lesson
sampling_deep_dive/02_topk_topp_minp.py - Learner → Deterministic vs Creative: runs lesson
sampling_deep_dive/03_deterministic_vs_creative.py - Learner → Structured Outputs: runs lesson
structured_outputs/01_naive_approach.py - Learner → Streaming Demos: runs lesson
streaming_demo/client_sse.py - Learner → Yield and Generators: runs lesson
streaming_demo/yields/06_file_processing.py - Learner → Threading Basics: runs lesson
threading_demo/03_thread_pool.py - Learner → Parallel LLM Calls: runs lesson
threading_demo/08_parallel_llm_calls.py - Learner → Parallel Tool Calls: runs lesson
threading_demo/09_parallel_tool_calls.py - Learner → Parallel RAG Search: runs lesson
threading_demo/10_divide_and_conquer_rag.py - Learner → Streaming with Threads: runs lesson
threading_demo/11_streaming_plus_threading.py - GPT-2 Workflow → Hugging Face GPT-2: loads model
- Sampling Filters → Hugging Face GPT-2: loads GPT-2
sampling_deep_dive/02_topk_topp_minp.py - Token Embeddings API → OpenAI API: requests embeddings
token_embeddings_api_call.py - Logprob Classification → OpenAI API: requests completion
logprobs/03_classification_free.py - RLHF Preferences → OpenAI API: requests completion
pretraining_sft_rlhf/03_rlhf_preference.py - Structured Outputs → OpenAI API: requests completion
structured_outputs/01_naive_approach.py - Parallel LLM Calls → OpenAI API: requests completion
threading_demo/08_parallel_llm_calls.py - Streaming Demos → OpenAI API: streams completion
streaming_demo/client_openai_stream.py - Streaming Demos → OpenAI API: requests completion
streaming_demo/client_openai_normal.py