Welcome to Week 1 of the Intro to AI Course! This week, you’ll learn the fundamentals of working with Large Language Models using LiteLLM, a unified API that lets you call any LLM provider with the same code.
What You’ll Learn This Week
By the end of Week 1, you’ll be able to:
- ✅ Understand why LiteLLM is essential for modern AI development
- ✅ Make API calls to multiple LLM providers (Gemini, OpenAI, Ollama, etc.)
- ✅ Stream responses for better user experience
- ✅ Control AI creativity with temperature
- ✅ Use prompt engineering and few-shot learning techniques
- ✅ Build multi-turn conversations with context
- ✅ Combine techniques to create complex AI personalities
- ✅ Control costs and manage computational resources
Course Structure
This week is divided into 7 lessons, each focusing on a specific concept:
Lesson 1.0 - Introduction to LiteLLM
Learn what LiteLLM is, why it’s better than using individual provider APIs, and how to set up your API keys.
Time: 10-15 minutes
Key Concepts: Unified APIs, vendor independence, environment setup
Lesson 1.1 - Your First API Call
Make your first LiteLLM call and learn the basic message structure. Practice switching between cloud and local models.
Time: 15-20 minutes
Key Concepts: Message format, model naming, provider switching
Lesson 1.2 - Streaming Responses
Learn how to stream AI responses token-by-token for a better user experience.
Time: 10-15 minutes
Key Concepts: Streaming, iterators, real-time display
Lesson 1.3 - Temperature Control
Master the temperature parameter to control creativity and randomness in AI responses.
Time: 15-20 minutes
Key Concepts: Temperature, determinism vs creativity, use case selection
Lesson 1.4 - System Prompts and Context
Learn how to use system prompts to define AI behavior and build multi-turn conversations.
Time: 20-25 minutes
Key Concepts: Prompt engineering, system prompts, message roles, conversation context, few-shot learning
Lesson 1.5 - Controlling Costs and Compute
Learn how to manage API costs and computational resources effectively.
Time: 15-20 minutes
Key Concepts: Token limits, stop sequences, cost tracking, resource optimization
Lesson 1.6 - Putting It All Together
Combine everything you’ve learned to build a complex AI personality. Complete hands-on exercises.
Time: 30-40 minutes
Key Concepts: Prompt engineering techniques, few-shot learning, integration, practical application, exercises
Prerequisites
Before starting, make sure you have:
- ✅ Completed Lesson 0 - Setting up your environment
- ✅ Basic Python knowledge (variables, functions, loops)
- ✅ Your GitHub Codespace or local environment ready
Materials Needed
lesson1-litellm-exercise.ipynb- Exercise notebook (in your workspace)lesson1-litellm-solutions.ipynb- Solutions notebook (reference)
Estimated Time
Total time for Week 1: 2.5-3.5 hours (including exercises)
You can complete this at your own pace - feel free to take breaks between lessons!
Getting Help
If you get stuck:
- Check the LiteLLM documentation
- Review the Python concept links provided in each lesson
- Ask questions in the course discussion forum
- Experiment in the notebooks - the best way to learn is by doing!
Ready to Start?
Begin with the first lesson:
→ Lesson 1.0 - Introduction to LiteLLM
Previous: Lesson 0 - Setting up your environment
Course Index: Intro to AI Development Course
