
This course overview covers generative ai with Python, large language models, and multimodal reasoning via link chain, with exploration of vector databases, data ingestion, retrieval augmented generation, and rack systems.
Bert Gornick, founder of Gornick Data Solutions, blends aerospace engineering, economics, and data science to train more than 50,000 students online in generative AI with Python.
Install python, pick an ide, and clone or download the course materials from git; then create isolated environments with specific python versions and packages using uv for speed.
Install Python from python.org/downloads by selecting a 3.12 version for Windows, run the installer, and add Python to the path so you can run it from any location.
Choose a proper IDE, download Visual Studio Code from its official page, and install it; also download and install Cursor for your system.
Open a project from a defined folder, then use the extensions tab to install the Python extension and Jupyter for your IDE, noting VSCode's left-hand extensions bar.
Install visual C++ build tools on Windows to enable desktop development with C++, download the build tools, run the installer, and complete the setup.
Install uv and run uv sync to create the environment from the pyproject.toml file, then activate it in the workspace and install packages like pandas.
Understand API keys, authentication, and authorization for services, plus usage tracking and basic security. Learn about providers like OpenAI, Google Gemini, and grok, and how to create keys for services.
Set up api keys for grok, openai, google, and anthropic, then store them in a dot env file as environment variables to enable authentication and testing of AI services.
Explore large language models, built on transformers, capable of translating, summarizing, and generating text, and learn their training with deep learning and the training loop.
Contrast classical NLP models with large language models, highlighting task-specific training versus a model trained on unlabeled data. Covers text classification, translation, fill-mask, generation, and vector databases for sentence similarity.
Trace narrow AI milestones from Deep Blue's chess win to AlphaGo's self-improving Go mastery, then OpenAI Five and Cicero showing cooperative and top-tier performance, all via reinforcement learning.
Examine how model performance evolves with increasing difficulty, from data handling and scikit-learn to deep learning and large language models, then to vector databases and retrieval augmented generation.
Explore the end-to-end training pipeline for large language models, from pre-training with data and next-token prediction to instruction fine-tuning, safety modeling, human-aligned evaluation, and iterative improvement.
Improve model output in generative AI with Python by refining prompts through direct prompting and prompt engineering, and by applying retrieval augmented generation with external data sources.
Compare proprietary closed-source models accessed by API keys—OpenAI, Gemini, grok, Claude 3.7, sonnet—and open weight models like meta's llama and mistral, noting data and training disclosures.
Benchmark models including Gemini 2.5 Pro and OpenAI using a la Marina and Vallamai benchmarks to test mathematical capabilities, latency, and context size.
Learn to build Python code that interacts with a large language model by loading API keys from an environment file, configuring LangChain packages, and invoking the model with a query.
Learn to connect to a grok llm from python by loading env vars, selecting llama 3.3 70b, creating a model instance, and invoking it to fetch the content response.
Explore integrating OpenAI with Python using the link chain OpenAI package, creating a chat OpenAI model instance, and seamlessly switching models while preserving the code interface.
Learn to interact with Gemini in Python using a starter script, import the Google Generative AI package, and create a model instance to generate responses.
Practice crafting system and user messages in a hands-on exercise, adopting the perspective of an 11-year-old student presenting on photosynthesis, using OpenAI's playground or grok.
Learn how system prompts and user prompts shape a model's behavior, scope, and friendly output style. Tailor responses for different ages and audiences and explore per slide presentation outputs.
Explore how generative AI models use temperature, top p, and max tokens to steer output, balancing determinism and creativity with top p and top k examples.
Experiment with LLM parameters by adjusting temperature, top p, and max tokens for a persona of an 11-year-old presenting on photosynthesis, using Grok Playground to observe the results.
Explore tuning large language model parameters in the playground, from temperature and max completion tokens to streaming and json mode, and understand moderation and seed controls for safe, structured outputs.
Explore how to select the best language model for your use case by evaluating price, performance, knowledge cutoff, deployment options, and context window, then balance cost and latency.
Explore model capabilities and cost trends, from affordable language models to inference efficiency, and map artificial narrow intelligence and AGI along the Gartner hype cycle.
Learn to run a local model on your system with the llama framework, download and select a model, and interact with it directly from Python without internet access.
Discover how to run language models locally with the ulama framework, pull and load 4 billion parameter models, and configure output and thinking steps for offline privacy.
Explore large multimodal models that process text, audio, images, and videos, and learn how they can output text, audio, images, or videos.
Explore large multimodal models and learn to interact with them from Python using Grok, including encoding locally saved images with base64 and sending them to a rest api for analysis.
Explore large video models (LVMs) and Google Genie two, where the next frame is predicted from a current image and user input, enabling real-time gameplay in model-generated ego shooter world.
Explore how tokenization breaks text into tokens, mapping words to token ids in a dictionary for model understanding. Learn how tokenization differs from embedding and see subword tokenization in action.
Reasoning models generate intermediate steps with train of thought, evaluate them via a process reward model, and iterate toward a converged solution.
Explore how small language models, with curated data and distillation from larger models, rival big models while prioritizing inference and local GPU deployment.
Explores jailbreaking prompts that trick generative AI models, including R prompt and math prompt, and examines model weaknesses, Trojan horse concepts, and safety implications.
Explore how prompt templates form chains with a model, using an output parser and placeholders that are replaced by real values, guided by system and user messages.
Explore prompt templates in coding by building a prompt template from the chain core package, using system and user messages, placeholders, and invoking for translation tasks.
Explore prompt hub concepts and meta prompting by pulling prompt templates from link chain hub, applying lazy prompts, and refining them with a model to achieve better outputs.
Explore chains as sequences of processing steps from user input and prompt templates to invocation and language model outputs, including parallel chains, router chains, and loops.
Explore chaining in generative ai with Python by building a simple sequential chain that passes a prompt through a model and the str output parser to translate text into German.
Build a sequential chain that processes user input through a prompt template, a model, and parameters. Replace placeholders for a character and location at runtime when the train is invoked.
Showcase a sequential chain solution using a chat prompt template with system prompt and placeholders, choose OpenAI or grok, apply an output parser, and analyze cost via token usage.
Extend a story-generation exercise by setting up multiple chains that run in parallel, produce outputs concurrently, and collect results afterward, illustrating parallel processing in generative artificial intelligence with Python.
Learn to run the same chain with different inputs in parallel using runnable parallel in LangChain core, building a story prompt, mapping inputs, and retrieving parallel results.
Explore chains with structured output and a json output parser to generate destination details and daily activity schedules, highlighting benefits for database storage and next model invocation.
Learn to produce structured JSON outputs from language models using a JSON output parser and a Pydantic defined translation response, enabling reliable business-context LLM workflows.
Execute a router chain to classify user input into cooking, travel, or coding using embeddings and cosine similarity; embed documents and queries, and route to the highest similarity chain.
Practice building a semantic router by selecting a domain—medical triage, customer support, or coffee orders—and implement the appropriate routing chain, then compare with the solution in the next lecture.
Explore the data ingestion pipeline for vector databases, converting diverse sources—markdown file, GitHub repo, Wikipedia article—into chunks and embeddings, then storing them in a unified vector database using link chain.
Explore how diverse data sources feed the data loading process, standardizing inputs into long chain documents with metadata and page content. Learn that link chain already supports many data sources.
Load data from internet or files in python using a pdf loader to convert pdf pages into documents, extract metadata and markdown content, and save lang chain docs to json.
Split large text into smaller, semantically meaningful chunks to optimize cost and context window limits. Explore fixed, structure-based, and semantic chunking with overlaps and embeddings for efficient data ingestion.
Apply data chunking to clean text with regex, remove URLs and emails, then use a recursive character text splitter to create 1000-character chunks with 10% overlap, saved as JSON.
Explore the embedding phase of the data ingestion pipeline by converting text into low-dimensional numeric vectors that capture semantic and syntactic meaning, using word and sentence embeddings.
Explore embeddings from one-hot to neural models, capturing semantic meaning in low-dimensional vectors for similarity, with word2vec CBOW and skip-gram, and learn how TF-IDF and co-occurrence inform embedding design.
Compare embedding models and large language models, highlighting transformers architecture, vector outputs versus text generation, and key applications like semantic search and question answering.
Explore different embedding model types, compare sentence and word embeddings, understand vector sizes from 384 to 1536, and evaluate performance, price, speed, and deployment options (on premise or cloud).
Learn how embeddings translate movie sentences into numerical vectors and compare their semantic similarity using Google generative AI embeddings, numpy, and seaborn to visualize correlations.
Import required packages, load page contents from documents, and create embeddings with OpenAI, using embed_documents, producing 72 document embeddings of 1536 elements each.
Learn to store data in a vector database, use embeddings for fast similarity search, and enable clustering and real-time analytics on unstructured data such as text, images, and audio.
Create and persist a vector database with chroma db by loading documents from JSON, using an OpenAI embeddings model, and storing the vector store in a chroma db folder.
Query databases with embedding-based prompts and vector similarity searches to fetch relevant documents. Leverage multi-modal embeddings to retrieve text and image results, including clip-based text-to-image retrieval.
Explore how similarity search uses embeddings in a vector database to rank documents with cosine similarity and maximum marginal relevance.
Explore querying a ChromaDB vector store using embeddings, retrieval with MMR and cosine similarity, and invoking retrievers to fetch top documents.
Learn to store and query a vector database with FAISS using link chain, create embeddings with OpenAI text-embedding-3, persist to disk, and perform similarity or MMR retrieval.
Learn how baseline retrieval augmented generation (RAG) operates by embedding text chunks and queries, retrieving relevant documents from a vector database, and generating an answer with a large language model.
Explore the retrieval, augmentation, and generation phases of RAC, where a retriever fetches relevant documents via similarity ranking from an external data source and guides the LLM.
Explore four rack system levels, from explicit facts to hidden rational queries, illustrating rag improvements. Enhance pre retrieval indexing with vector databases, retrieval, and post retrieval queries.
Explore improvements in the pre retrieval phase of a vector database pipeline, including data ingestion optimization, metadata enhancement, data cleaning, chunk size, context enrichment, and embedding model fine-tuning.
Learn context enrichment in the data trunking phase, adding company and year context to balance sheet chunks for accurate comparisons via contextual retrieval and vector databases.
Explore corrective retrieval augmented generation to reduce hallucinations by validating retrieved documents with a router and, if needed, augmenting with internet search results from external knowledge sources.
Introduce hybrid rag by combining dense vector search and sparse keyword search, then apply reciprocal rank fusion to merge ranked results into a final list.
Learn to boost retrieval relevance with query expansion in generative AI with Python, expanding queries with synonyms, related terms, conceptual and contextual expansion, phrase variation, temporal, and entity-based approaches.
Apply prompt compression to shorten post-retrieval context by using a small language model to compress the prompt, then pass the compressed query to a larger language model for cost-efficient results.
Explore retrieval augmented thought read, a post retrieval phase method that starts with a zero shot thought, generates subtasks, queries a vector database for relevant documents, and iteratively refines answers.
Learn how multimodal RAC uses a joint text-and-image embedding model to store text and images in a vector database and fetch the most relevant visuals.
Explore table rac by using a language model with the table schema to generate sql, query the database, and produce a nicely formatted answer to user questions.
Implement Tabarak and table rag workflow by creating a sqlite sql database for coffee sales, performing data prep, and building a sql query generation chain with a sql expert model.
Learn how agentic systems perceive environments, select tools, and autonomously pursue goals with planning and learning, driven by llm. Overview the task-to-output workflow and levels from zero to five.
Compare popular agentic frameworks for multi-agent systems, including Landgraf, CRI, OpenAI agents, ag2, and Google ADK, and analyze autonomy versus reliability trade-offs.
Map and connect agents.yaml, tasks.yaml, cradle.py and main.py to wire a news analysis workflow, linking agent configs, task definitions, and topic inputs through the News analysis class.
Learn to set up a crew of agents—researcher, analyst, and writer—who collaborate in a sequential process within CRI framework, using predefined and customizable tools to gather and assemble the report.
Learn to install QE by setting up a clean python environment, choosing a compatible python version, creating a venv, and installing QE tools to manage dependencies.
Create a sample project for travel planner development. Configure a grok llm model, set up a virtual environment, install from pyproject.toml, and run the crew to generate a final report.
Create a travel planner with a city selector, local expert, and concierge to identify cities, gather city information, and plan detailed itineraries from inputs like location, time period, and duration.
Leads learners through configuring travel planner agents and tasks using an LLM to generate YAML definitions with inputs like location, period, and duration.
Integrate and modify agents and tasks yaml files for the travel planner, configuring city selector, concierge, and local expert agents from language model outputs.
Test the travel planner crew by running the city selector agent, reviewing the markdown output, and exploring constraints for a multi-country trip; then add web search tools.
Debug a travel planner with a generative ai workflow by handling syntax errors, api keys, rate limits, and multi-agent task orchestration to generate a December 2025 itinerary.
Unlock the transformative power of Generative AI with Python! This comprehensive course equips you with the essential knowledge and practical Python skills to master the core technologies driving this revolution, enabling you to build intelligent applications that understand, generate, and interact with language remarkably.
You'll delve into the fundamentals of Large Language Models (LLMs) and the crucial role of Vector Databases for efficient information retrieval. Discover the power of Retrieval-Augmented Generation (RAG), which allows your AI to answer complex questions using your own data, making it smarter and more contextually aware.
Furthermore, you'll explore the exciting domain of Agentic Systems, learning how to design and build autonomous AI agents capable of performing tasks and making decisions.
In my course I will teach you:
Large-Language Models
Classical NLP vs. LLM
Narrow AI Achievements
Model Performance and Achievements
Model Training Process
Model Improvement Options
Model Providers
Model Benchmarking
Interaction with LLMs
Message Types
LLM Parameters
Local Use of Models
Large Multimodal Models
Tokenization
Reasoning Models
Small Language Models
JailBreaking
Working with Chains
Parallel Chains, Router Chains, ...
Vector Databases
Data Ingestion Pipeline
Data source and data loading
data chunking
embeddings
data storage
data querying
Retrieval-Augmented Generation
Baseline RAG
Context Enrichment
Corrective RAG
Hybrid RAG
Query Expansion
Speculative RAG
Agentic RAG
Agentic Systems
crewAI
Google ADK
OpenAI Agents SDK
AG2
LangGraph (coming soon)
Agent Interactions
MCP
ACP
A2A