diff --git a/README.md b/README.md index 31ef3bf..2c096fb 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,38 @@ # Minimal Chat application using Spring AI -This project is a Spring Boot application that integrates a Chat UI powered by OpenAI using Vaadin. It provides a responsive interface for interacting with OpenAI's conversational models. +This project is a Java application that integrates a Chat UI powered by Ollama using Vaadin UI. It provides a responsive interface for interacting with Ollama's conversational models. vaadin-spring-ai-open-ai-chat ## Features - Full-stack application with Vaadin frontend and Spring Boot backend. -- Real-time chatting capability using OpenAI. +- Real-time chatting capability using local Ollama in Docker container. - Dynamic message streaming and display of Markdown. ## Prerequisites +- Docker container for running ollama models - JDK 17 or later - Maven 3.6 or later ## Running the Application +Install and run ollama in localhost:11434 ``` -OPENAI_API_KEY= mvn spring-boot:run +docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama +``` + +Install ollama 'mistral' model (used by the web app by default) +``` +docker exec ollama ollama pull mistral +``` + +Optional: check that everything works using curl: +``` +curl http://localhost:11434/api/chat -d '{"model": "mistral", "messages": [{"role": "user", "content": "is black darker than white?"}], "stream":false}' +``` + + +Run the web application in [localhost:8080](http://localhost:8080/): +``` +mvn spring-boot:run ``` diff --git a/pom.xml b/pom.xml index d6ba27d..9b895e0 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ org.springframework.ai - spring-ai-openai-spring-boot-starter + spring-ai-ollama-spring-boot-starter 0.8.1