Skip to content

dlwhyte/GenAI_foundry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

146 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GenAI Foundry
GenAI Badge

Open in Colab License: MIT Beginner Friendly API Key Optional

πŸ“’ About GenAI Foundry

This repository was created to make the world of Generative AI accessible, simple, and hands-on.

Our mission:

  • πŸš€ Empower learners to experiment with LLMs and RAG pipelines.
  • 🧠 Provide clear, beginner-friendly tutorials.
  • πŸ“š Foster creativity and exploration with GenAI tools.

Feel free to fork, adapt, and expand these examples! 🎯


πŸ“₯ New Here? Start With This ⬇️

Download the Student Quick Start Guide (PDF)

The Quick Start Guide walks you through everything with screenshots β€” how to get the code, which setup path to choose, and what you should see when it's working. Download this before doing anything else.


πŸ—ΊοΈ Learning Path

Follow this sequence for the best experience:

β‘  Tokens & Embeddings β†’ β‘‘ Semantic Similarity β†’ β‘’ Search with Embeddings β†’ β‘£ Model Tradeoffs
β†’ β‘€ Simple Chatbot β†’ β‘₯ Temperature & Tokens β†’ ⑦ Prompt Engineering β†’ β‘§ Few-Shot / Zero-Shot
β†’ ⑨ Simple RAG β†’ β‘© LangChain Basics β†’ β‘ͺ What is an Agent?
β†’ πŸŽ“ Interactive Demos (Streamlit) β†’ πŸš€ AgenticAI Foundry

πŸ’‘ Notebooks marked βœ… No API Key run entirely in Google Colab for free. Notebooks marked πŸ”‘ API Key require an OpenAI key.


πŸ“š Tutorials and Notebooks

Welcome to the GenAI Foundry learning series! All notebooks can be opened directly in Google Colab β€” no local setup required.

Part 1: LLM Mechanics (No API Key Required)

# πŸ““ Notebook πŸ“ Description πŸ”‘ API Key πŸš€ Colab
1 Tokens and Embeddings How LLMs break text into tokens and represent meaning as vectors βœ… Free Colab
2 Semantic Similarity How embeddings capture meaning and measure similarity between text βœ… Free Colab
3 Search with Embeddings Keyword vs. semantic search, chunking, and the foundations of RAG βœ… Free Colab
4 Model Selection & Tradeoffs Capability, speed, cost, and context β€” how to choose the right model βœ… Free Colab

Part 2: Introductory Concepts (OpenAI API Key Required)

# πŸ““ Notebook πŸ“ Description πŸ”‘ API Key ⏱️ Time πŸš€ Colab
5 Simple Chatbot Build your first LLM-powered chatbot πŸ”‘ Required ~15 min Colab
6 Temperature & Token Explorer See how temperature and max tokens change LLM output πŸ”‘ Required ~20 min Colab
7 Prompt Engineering Basics Zero-shot prompting, system messages, and output formatting πŸ”‘ Required ~25 min Colab
8 Few-Shot / Zero-Shot Prompting Teaching the model with examples vs. instructions alone πŸ”‘ Required ~20 min Colab
9 Simple RAG Application Retrieval-Augmented Generation end-to-end πŸ”‘ Required ~30 min Colab
10 LangChain Basics Chains, prompts, and memory with LangChain πŸ”‘ Required ~25 min Colab
11 Fine-Tuning Basics Intro to fine-tuning foundation models πŸ”‘ Required ~30 min Open In Colab

Part 3: Bridge to Agentic AI

# πŸ““ Notebook πŸ“ Description πŸ”‘ API Key ⏱️ Time πŸš€ Colab
12 What is an Agent? From chatbots to agents β€” the Observeβ†’Thinkβ†’Act loop explained βœ… Free ~20 min Colab

πŸŽ“ Applied Generative AI β€” Interactive Demos

These demos let you see the concepts from the notebooks in action β€” no coding required. They are a multi-page Streamlit application running in a single Docker container.

πŸ“Œ Notebooks β†’ Demos connection: The RAG Visual Explorer (below) visualises exactly what happens in notebooks 3 and 9. The RAG Chat demo is the production version of what you build in notebook 9.

πŸ” RAG Visual Explorer β€” No API key required

Connects to: Notebooks 1, 2, 3, 9

See how Retrieval-Augmented Generation works under the hood:

  • Chunking β€” Watch documents split into searchable pieces
  • Embeddings β€” See text transform into numerical vectors
  • Vector Space β€” Visualise how similar content clusters together
  • Semantic Search β€” Compare keyword vs. meaning-based search

🧠 Ontology & Counterfactual Reasoning β€” OpenAI API key required for AI features

Connects to: Notebooks 7, 8 (prompt engineering concepts)

Explore structured knowledge and "what if" analysis:

  • Ontology Explorer β€” Interactive knowledge graph of cybersecurity risks
  • Counterfactual Analysis β€” Test what happens when controls fail
  • LLM Validation β€” Verify AI outputs against ground truth

πŸ€– RAG Chat with Estel β€” OpenAI API key required

Connects to: Notebooks 9, 10 (RAG + LangChain)

A complete document-grounded chat assistant powered by RAG:

  • Upload β€” Load your own PDF or TXT documents
  • Index β€” Documents are chunked, embedded, and stored in a FAISS vector database
  • Chat β€” Ask questions and get answers grounded in your uploaded content
  • Learn β€” See RAG in action as a complete end-to-end pipeline

πŸ“– How RAG Chat Works β€” Deep Dive Guide


🐳 Running the Demos (Docker Required)

πŸ“– Detailed Docker Guide for Beginners

Step Command
1. Clone this repo git clone https://github.com/dlwhyte/GenAI_foundry.git
2. Navigate to repo cd GenAI_foundry
3. Build container docker build -t genai-foundry .
4. Run demos docker run -p 8501:8501 genai-foundry
5. Open browser http://localhost:8501

With an OpenAI API key (required for Ontology demo + RAG Chat):

docker run -p 8501:8501 -e OPENAI_API_KEY=sk-your-key-here genai-foundry

πŸ’‘ Without the -e flag, you can still enter your API key in the sidebar on any page that requires it.

πŸ”‘ How to Get an OpenAI API Key

πŸ’‘ Don't have Docker? Download it from docker.com/products/docker-desktop


πŸ›  How to Get Started

New to all of this? Follow these 3 steps:

  1. Start with a free notebook β€” Click any Colab badge in the Part 1 table above. No account or setup needed.
  2. Get an API key when ready β€” Create an OpenAI key to unlock the Part 2 notebooks. Costs pennies per session.
  3. Run the interactive demos β€” Install Docker Desktop, then follow the 5-step table above.
Action Description
πŸ“₯ New here? Download the Student Quick Start Guide (PDF)
βœ… New to GitHub? Start here
βœ… Docker setup Learn how to install and use Docker for running demos
βœ… Open notebooks Open and run the notebooks directly in Google Colab β€” click any badge above
βœ… Get an API key Create your OpenAI API key to enable model access

πŸ“ License

This project is licensed under the MIT License β€” free to use, modify, and share! See the LICENSE file for more details.


πŸš€ Ready for the Next Level?

This repo covers the foundations of Generative AI β€” how LLMs work, how to prompt them, and how to build RAG pipelines.

When you're ready to build AI systems that take action in the world, continue to the companion course:

πŸ‘‰ AgenticAI Foundry β€” Multi-agent systems, tool use, MCP, and agent security

GenAI Foundry covers... AgenticAI Foundry covers...
Tokens, embeddings, and how LLMs work How agents observe, think, and act
Prompt engineering and few-shot learning Multi-agent orchestration with CrewAI
RAG pipelines and vector search Connecting agents to real tools via MCP
LangChain basics Agent security and prompt injection defense
Recommended first βœ… Take after GenAI Foundry ➑️

About

GenAI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors