Chapter 2: Project setup

Create a Spring Boot 4.1.1 project with Java 17 or later. Add the Spring AI BOM 2.0.1, the Session BOM 0.6.0, the Temporal starter, and the OpenAI starter for LM Studio.

Figure 2.1. The project and the local model server. The OpenAI starter reaches LM Studio through the base URL below. The figure leaves out PostgreSQL and the Temporal dev server, which later chapters connect.
spring.ai.openai.base-url=http://localhost:1234
spring.ai.openai.api-key=lm-studio
spring.ai.openai.chat.options.model=YOUR-GEMMA-IDENTIFIER
spring.ai.openai.embedding.options.model=YOUR-BGE-M3-IDENTIFIER

Before the course, send one request with a tool definition to the Gemma model. Confirm the response contains a tool call.

Figure 2.2. The pre-flight check. Every chapter from Chapter 4 on depends on the model returning tool calls.
docs