Generative AI for Beginners - Java Edition


Time Commitment: The entire workshop can be completed online without local setup. The environment setup takes 2 minutes, with exploring the samples requiring 1-3 hours depending on exploration depth.
Quick Start
- Fork this repository to your GitHub account
- Click Code → Codespaces tab → ... → New with options...
- Use the defaults – this will select the Development container created for this course
- Click Create codespace
- Wait ~2 minutes for the environment to be ready
- Jump straight to The first example
Supported via GitHub Action (Automated & Always Up-to-Date)
French | Spanish | German | Russian | Arabic | Persian (Farsi) | Urdu | Chinese (Simplified) | Chinese (Traditional, Macau) | Chinese (Traditional, Hong Kong) | Chinese (Traditional, Taiwan) | Japanese | Korean | Hindi | Bengali | Marathi | Nepali | Punjabi (Gurmukhi) | Portuguese (Portugal) | Portuguese (Brazil) | Italian | Polish | Turkish | Greek | Thai | Swedish | Danish | Norwegian | Finnish | Dutch | Hebrew | Vietnamese | Indonesian | Malay | Tagalog (Filipino) | Swahili | Hungarian | Czech | Slovak | Romanian | Bulgarian | Serbian (Cyrillic) | Croatian | Slovenian | Ukrainian | Burmese (Myanmar)
Course Structure & Learning Path
Chapter 1: Introduction to Generative AI
- Core Concepts: Understanding Large Language Models, tokens, embeddings, and AI capabilities
- Java AI Ecosystem: Overview of Spring AI and OpenAI SDKs
- Model Context Protocol: Introduction to MCP and its role in AI agent communication
- Practical Applications: Real-world scenarios including chatbots and content generation
- → Start Chapter 1
Chapter 2: Development Environment Setup
- Multi-Provider Configuration: Set up GitHub Models, Azure OpenAI, and OpenAI Java SDK integrations
- Spring Boot + Spring AI: Best practices for enterprise AI application development
- GitHub Models: Free AI model access for prototyping and learning (no credit card required)
- Development Tools: Docker containers, VS Code, and GitHub Codespaces configuration
- → Start Chapter 2
Chapter 3: Core Generative AI Techniques
- Prompt Engineering: Techniques for optimal AI model responses
- Embeddings & Vector Operations: Implement semantic search and similarity matching
- Retrieval-Augmented Generation (RAG): Combine AI with your own data sources
- Function Calling: Extend AI capabilities with custom tools and plugins
- → Start Chapter 3
Chapter 4: Practical Applications & Projects
- Pet Story Generator (petstory/): Creative content generation with GitHub Models
- Foundry Local Demo (foundrylocal/): Local AI model integration with OpenAI Java SDK
- MCP Calculator Service (calculator/): Basic Model Context Protocol implementation with Spring AI
- → Start Chapter 4
Chapter 5: Responsible AI Development
- GitHub Models Safety: Test built-in content filtering and safety mechanisms (hard blocks and soft refusals)
- Responsible AI Demo: Hands-on example showing how modern AI safety systems work in practice
- Best Practices: Essential guidelines for ethical AI development and deployment
- → Start Chapter 5