Posts

Showing posts with the label Artificial Intelligence

Spring AI with Open Ai

Image
🔄 Updated: September 2026  ·  Rewritten for Spring AI 2.0.1 The starter artifact, the configuration properties and the client class have all changed since 2024 Integrating OpenAI ChatGPT with Spring AI Spring AI gives Java developers a clean, Spring-idiomatic way to call OpenAI's models — chat, streaming, structured output, tool calling and embeddings — without hand-rolling HTTP clients or JSON mapping. This guide walks through the whole setup, from getting an API key to building endpoints that do real work. Contents [ hide ] Getting Started: Obtaining an OpenAI API Key You need an API key before anything else: Sign up at platform.openai.com (note: the API dashboard, not the ChatGPT consumer site). Add a payment method and some credit. API access is billed separately from a ChatGPT Plus subscription — having Plus does not give you API credit. Go to the API Keys page and create a new secret key. Copy it immediately. OpenAI shows the key...

Spring AI with Ollama

Image
🔄 Updated: September 2026  ·  Rewritten for Spring AI 2.0.1 Artifact IDs, properties and the response API have all changed since this guide was first published in 2024 Introduction to Spring AI with Ollama Welcome to a comprehensive guide on leveraging Spring AI with Ollama to build AI-powered applications in Java — running large language models entirely on your own machine, with no API key and no per-token cost. This tutorial covers installing Ollama, wiring it into a Spring Boot project, and building endpoints for chat, streaming, structured output, reasoning models and tool calling. Contents [ hide ] Setting Up Ollama Installing Ollama Download and install Ollama for your OS from the official download page . It runs as a background service on http://localhost:11434 — no Docker required. The source lives on the official GitHub page . Pulling a model Once Ollama is installed, pull a model. The original version of this guide used mistral , which still...