An open API service indexing awesome lists of open source software.

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.

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
```