https://github.com/drissiomar98/spring-ai-webflux-streaming
Example project demonstrating how to stream LLM tokens reliably using Spring AI, WebFlux, and NDJSON instead of SSE. Includes backpressure handling, error recovery, and a Vaadin client consuming the NDJSON stream.
https://github.com/drissiomar98/spring-ai-webflux-streaming
docker docker-compose java llms multi-stage-docker ollama spring-ai spring-boot streaming vaadin vaadin-flow webflux
Last synced: 2 months ago
JSON representation
Example project demonstrating how to stream LLM tokens reliably using Spring AI, WebFlux, and NDJSON instead of SSE. Includes backpressure handling, error recovery, and a Vaadin client consuming the NDJSON stream.
- Host: GitHub
- URL: https://github.com/drissiomar98/spring-ai-webflux-streaming
- Owner: drissiOmar98
- Created: 2026-03-06T22:47:24.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2026-03-07T20:44:31.000Z (3 months ago)
- Last Synced: 2026-04-04T08:00:02.044Z (2 months ago)
- Topics: docker, docker-compose, java, llms, multi-stage-docker, ollama, spring-ai, spring-boot, streaming, vaadin, vaadin-flow, webflux
- Language: Java
- Homepage:
- Size: 921 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spring AI Streaming Demo
Project for demonstrating the approach to streaming AI responses with NDJSON.
## Project Structure
The project consists of two main modules:
1. **frontend**: provides the Vaadin-based UI
2. **backend**: provides AI-powered responses using Ollama
## Prerequisites
- Java 25
- Docker and Docker Compose
## Running the Application
### Using Docker Compose
1. Build and start the containers:
```bash
docker-compose up -d
```
2. Access the frontend at http://localhost:8081
### Running Locally
1. Start Ollama:
```bash
docker-compose up -d ollama
```
Alternatively, you can run Ollama locally:
```bash
ollama pull llama3.2:3b
ollama serve
```
2. Build and run the frontend module:
```bash
cd frontend
./mvnw spring-boot:run
```
3. Build and run the backend module:
```bash
cd backend
./mvnw spring-boot:run
```