Video overview: Watch "Practical Applications & Projects" on YouTube.
In this section we'll demo three practical applications that showcase generative AI development patterns with Java:
- Create a multi-modal Pet Story Generator combining client-side and server-side AI
- Implement local AI model integration with the Foundry Local Spring Boot demo
- Develop a Model Context Protocol (MCP) service with the Calculator example
This chapter showcases sample projects that demonstrate generative AI development patterns with Java. Each project is fully functional and demonstrates specific AI technologies, architectural patterns, and best practices that you can adapt for your own applications.
The Foundry Local Spring Boot Demo demonstrates how to integrate with local AI models using the OpenAI Java SDK. It showcases connecting to the Phi-3.5-mini model running on Foundry Local, allowing you to run AI applications without relying on cloud services.
The Pet Story Generator is an engaging Spring Boot web application that demonstrates multi-modal AI processing to generate creative pet stories. It combines client-side and server-side AI capabilities using transformer.js for browser-based AI interactions and the OpenAI SDK for server-side processing.
The MCP Calculator Service is a simple demonstration of the Model Context Protocol (MCP) using Spring AI. It provides a beginner-friendly introduction to MCP concepts, showing how to create a basic MCP Server that interacts with MCP clients.
These projects are designed to build upon concepts from previous chapters:
- Start Simple: Begin with the Foundry Local Spring Boot Demo to understand basic AI integration with local models
- Add Interactivity: Progress to the Pet Story Generator for multi-modal AI and web-based interactions
- Learn MCP Basics: Try the MCP Calculator Service to understand Model Context Protocol fundamentals
Nice work! You've now explored some real applications:
- Multi-modal AI experiences that work both in the browser and on the server
- Local AI model integration using modern Java frameworks and SDKs
- Your first Model Context Protocol service to see how tools integrate with AI
