Gen AI Development
Using Python
Module 1: Introduction to Python
1. Python Basics
a. Data types, variables, and operators
b. Conditional statements and loops
c. Functions and modules
d. Lists, tuples, dictionaries, and sets
2. Object-Oriented Programming (OOP) in Python
a. Classes and objects
b. Inheritance and polymorphism
3. Python Libraries for AI and API Development
a. pandas, numpy, requests
Module 2: Introduction to Large Language Models (LLMs)
1. Understanding LLMs and OpenAI APIs
a. What are LLMs? How do they work?
b. OpenAI GPT models overview
c. Applications of LLMs in AI
2. Working with OpenAI API
a. Setting up OpenAI API key
b. Making API requests for text generation
c. Fine-tuning responses and prompt engineering
3. Using Open-Source LLMs with Ollama
a. Introduction to Ollama
b. Setting up and running Ollama locally
c. Replacing OpenAI with Ollama in chatbot development
4. Using Claude AI
a. Introduction to Claude AI
b. Differences between Claude AI and OpenAI models
c. Making API requests to Claude AI
5. Using Hugging Face
a. Introduction to Hugging face
b. Deploy on Hugging Face Spaces
Module 3: FastAPI - Building APIs Efficiently
1. Introduction to FastAPI
a. Why FastAPI?
b. Installing and setting up FastAPI
c. Creating your first FastAPI endpoint
2. SQL Basics & PostgreSQL
a. SQL queries (CRUD operations)
b. Database design basics
c. Connecting FastAPI with PostgreSQL using SQLAlchemy
3. Building REST APIs with FastAPI & PostgreSQL
a. Structuring FastAPI projects
b. Creating models and schemas
c. Implementing authentication (JWT-based authentication)
d. Handling API requests and responses
Module 4: Authentication
1. Implementing JWT Authentication
a. Generating JWT tokens
b. User login & signup APIs
c. Securing endpoints with authentication middleware
Module 5: Building an AI Chatbot API
1. Designing a Chatbot Backend
a. Understanding chatbot architecture
b. Creating API endpoints for chatbot responses
c. Integrating OpenAI API with FastAPI
2. Adding Chat Memory & User Context
a. Storing chat history in PostgreSQL
b. Fetching previous conversations for context
c. Optimizing responses with stored memory
3. Testing & Enhancing Chatbot
a. Handling errors and optimizing responses
b. Caching and rate-limiting techniques
Module 6: Real-time Communication with WebSocket
1. Introduction to WebSockets in FastAPI
a. Difference between WebSockets & REST APIs
b. When to use WebSockets
2. Implementing Real-Time Chat Using WebSockets
a. Setting up WebSocket server in FastAPI
b. Handling real-time messages
c. Storing chat history for WebSocket-based chats
3. User-Specific Chat Memory in WebSocket
a. Identifying and authenticating users in WebSocket
b. Maintaining chat sessions in WebSocket
Module 7: Frontend Basics for Chat Application
1. HTML, CSS, JavaScript, and Bootstrap Basics
a. HTML structure and elements
b. CSS styling and Bootstrap framework
c. JavaScript DOM manipulation
2. Building a Chat Frontend
a. Creating a responsive UI with Bootstrap
b. Adding input fields, buttons, and chat history
3. Integrating Frontend with WebSocket
a. Sending & receiving messages using WebSocket in JS
b. Updating chat history dynamically
Module 8: Integrating Frontend with Backend
1. Connecting Frontend with FastAPI
a. Making API calls from JavaScript (AJAX, Fetch API)
b. Handling real-time chat updates
c. Improving UI/UX with animations
2. Implementing User Authentication in Frontend
a. Login & signup UI
b. Using JWT for authenticated requests
c. Protecting routes based on user authentication
Module 9: Deploying Application to Cloud
1. Preparing FastAPI & WebSocket for Deployment
a. Setting up environment variables
b. Using PostgreSQL in cloud services
2. Deploying on Cloud platform
a. Configuring for FastAPI
b. Deploying Chatbot app frontend and backend
Final Project: AI Chatbot Web Application
At the end of the course, students will build a fully functional AI-powered chatbot with:
• A backend using FastAPI & PostgreSQL
• JWT authentication for user logins
• WebSocket for real-time chat updates
• Chat history storage for personalized conversations
• A frontend built with HTML, CSS, JS, Bootstrap
• Deployment on Cloud platform