Reverse engineered prompt

Build me a small Java backend that acts like a secure wrapper around a local Ollama setup using the llama3.1 model. I want to be able to send a prompt to an API endpoint and get the generated response back, so it feels like a simple service I can call from other apps. Please include interactive API docs so I can test requests in the browser, and protect the endpoints with login based access so only authenticated users can use it.

I also want this to be easy to run locally with containers, including Ollama and the app together, plus anything needed to initialize the model. If Keycloak is the simplest way to handle auth here, wire that up too and make the basic flow work end to end. Keep the setup straightforward, with sensible defaults and a README that explains how to start everything, get a token, and try a sample request. If you need to, look up current docs online so the integration works with recent versions.

Want more depth? Deep Reverse