
Learn how Spring AI serves as a layer between your enterprise app and large language models, enabling chat, embeddings, image generation, audio transcription, and moderation.
Learn how spring ai provides an abstraction layer to unify access to multiple ai providers, such as OpenAI, Anthropic, Azure OpenAI, and Llama, with Java SDK usage.
Explore spring ai docs to see how it provides an abstraction for ai apps, review chat model docs, and learn about rag with providers like OpenAI, Anthropic, and Vertex AI.
Create a spring boot project with the spring ai module, add spring web and OpenAI starter dependencies, and configure the OpenAI api key in application properties.
Learn how to create an OpenAI API key, manage billing credits, and save a secret key named spring AI demo to paste into your project for running on port 8080.
Test the OpenAI chat model in a Spring AI app by sending a request via an api client, wiring a rest controller with constructor injection, and receiving a text response.
Learn to use a spring-based chat client built on the chat model to send prompts and get content responses. Configure prompt options and fetch structured output via the chat client.
Explore how the chat client sends prompts to the OpenAI server and returns content as a string. Learn to access chat response metadata, results, and model information.
Learn how to use the chat client builder and programmatic setup in spring ai, comparing auto configure for a single model like openai with explicit builder for multiple models.
Explore how Spring AI adapters use advisors to add memory to chat interactions, enabling in-memory chat memory, before/after hooks, and memory retrieval to maintain conversation context.
learn to run large language models locally with Ollama, download and test models like Mistral, and adapt your code with a local controller, while noting ram and gpu needs.
Configure a spring ai application to use llama by adding the llama dependency, creating a llama controller, and setting the chat model via the model option.
Learn why prompt templates optimize AI model responses by collecting user values (movie type, language, decade, IMDb rating) and constructing a tailored prompt for better results.
Explore implementing a reusable prompt template in a spring-based API, filling placeholders with a map of type, lang, and year to generate targeted movie recommendations.
Explore how embeddings convert text and images into high-dimensional vectors stored in vector databases, enabling search, clustering, recommendations, and anomaly detection in AI applications.
Create embeddings using an API client by posting to the OpenAI embedding endpoint, authenticating with an API key, and specifying the model and inputs for 2D dimensions.
Learn to generate embeddings in a Java Spring app via a /api/embeddings post endpoint and a built-in embedding model. Configure model to switch between llama and OpenAI and use text-embedding-3-large.
Learn how embeddings are stored in vector databases and how cosine similarity measures distance between multi-dimensional vectors using dot products and theta.
Learn to implement cosine similarity between two words using embeddings, map an API endpoint to compute dot products and similarity scores, and explore semantic search applications.
Convert text to embeddings, chunk large documents into manageable pieces, and use a simple vector store to perform semantic similarity searches that retrieve relevant products.
Load product data into a simple vector store, break it into chunks, and embed for search using token text splitting in Spring.
Explore building a vector store and implementing similarity search to retrieve documents from text chunks using embedding models like OpenAI and llama, with configurable chunking and top two results.
Introduce pg vector as a vector store for PostgreSQL and show running it with docker compose, then configure index type, distance type, dimensions, and batch size for OpenAI model compatibility.
Learn to set up pgvector with Docker compose and the pgvector image on port 5432, and configure the Spring application's data source in application properties.
Implement PG vector storage in a Spring Boot app by adding PG vector and Docker Compose dependencies, wiring embedding model with JDBC template, and configuring schema and dimensions.
Explore configuring a Redis vector store for Spring apps, including docker-based setup, Jedis client integration, and mapping host, port, index name, and prefix for fast in-memory vector searches.
Implement a Redis vector store by configuring a Jedis pool, embedding model, and product index with schema initialization and proper app properties.
Explore retrieval augmented generation (rag) to provide contextual data from a product document by chunking, embedding, and storing in a vector store, improving accuracy and reducing hallucinations.
Implement rag to answer questions from a product details document using embeddings, a vector store, semantic search, and memory advisor and question answering advisor with document chunks.
Learn to generate images from text using the OpenAI image model (DALL-E), and analyze photos to identify products and details with hands-on code for prompts and responses.
Learn to convert a user query into an image prompt, call the OpenAI image model, and return the image link via an image response, including embedding notes.
Customize generated images with the image options builder, adjusting quality (HD), height (up to 1024), and style (natural or vivid) for DALL‑E 3 outputs.
Describe an image by uploading it through a post request to the image endpoint, providing a query and a multipart file to have the ai model describe or identify objects.
Implement an image describe endpoint that accepts a string query and a multipart image, posts to image/describe, and returns an analyzed description.
Learn how to use audio models for transcription and text-to-speech with OpenAI, converting speech to text for captions and turning text into speech with variable voice and speed.
Build an audio processing rest controller to perform speech-to-text transcription and text-to-speech using a post mapping. Configure an OpenAI audio transcription model and test file uploads with multipart form data.
Implement a speech-to-text workflow that accepts large audio payloads via multipart uploads, processes it with an audio module, and returns transcribed text with timestamps for subtitles.
Explore how to configure audio transcription options for subtitles using the OpenAI audio transcription model, including resource and prompt objects, language settings, and srt timestamp formatting.
Explore text-to-speech using an audio speech model to return a byte array via a post endpoint, export the mp3 in insomnia, and plan future voice and speed controls.
Adjust voice and speed for audio generation by using speech prompt and OpenAI audio speech options, configuring speed and Nova voice to customize text-to-speech output.
Discover how structured output converters transform LLM responses into structured JSON, lists, or maps for existing applications. Leverage bean, list, and map converters with prompts to inject structured data.
Build a list output converter in a movie controller to convert prompt output into a list of movie names, using a prompt template and the default output conversion service.
Create a movie class with name, lead cast, director, and year, and use a bean output converter to return one movie in JSON via the /movie endpoint with actor name.
Learn to convert a list of movies to JSON using the bean output converter, switching from a single movie to a movies list with a parameterized type reference.
Spring AI—Gen AI (TELUSKO)
This comprehensive course on Spring AI is your gateway to building intelligent, AI-powered Java applications. It leverages Spring AI, the official module within the Spring framework, designed to seamlessly integrate Large Language Models (LLMs) and a broad spectrum of AI capabilities into your Spring Boot projects.
You'll develop essential skills for integrating diverse AI models, from popular model-as-a-service provider like OpenAI (GPT-4o) to open-source LLM providers like Ollama (Mistral and Deepseek). This is achieved through Spring AI's standardized API, offering remarkable portability and minimizing vendor lock-in.
A significant portion of the curriculum focuses on developing sophisticated conversational AI systems using the intuitive ChatClient API and ChatModel, enabling dynamic and natural interactions. Furthermore, you'll master Retrieval-Augmented Generation (RAG), a critical technique that empowers LLMs with external, up-to-date, and domain-specific knowledge. This involves deep dives into vector embeddings and practical experience with various vector databases like PgVector, Redis, and Spring AI's SimpleVectorStore, ensuring your AI responses are contextually relevant and accurate.
Beyond conventional text-based AI, the course ventures into multimodal applications, covering capabilities like image and audio processing, including text-to-speech and speech-to-text. This expands the possibilities for creating truly immersive and interactive applications. You'll also learn the art of prompt engineering through templates and advisors for enhanced AI interactions, and crucially, how to transform raw AI outputs into neatly structured Java objects (List, Bean, Map) for seamless integration into your application's logic.
This course is ideally suited for Java developers eager to add cutting-edge AI functionalities to their Spring Boot applications, backend developers exploring modern AI integration patterns, and teams dedicated to building the next generation of intelligent, data-driven applications. A solid foundation in Spring Boot and Java programming is recommended to maximize your learning experience. By completing this course, you will be well-equipped to transform your Spring applications with advanced AI features, ensuring you remain at the forefront of the rapidly evolving AI-driven development landscape.