-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
||
<img width="504" alt="vaadin-spring-ai-open-ai-chat" src="https://github.com/samie/spring-ai-chat/assets/991105/d7216455-f28e-4d34-8cd0-f7f1074f6087"> | ||
|
||
## 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=<your api key here> 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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters