Slides from my workshop at OpenSlava 2025 (October 15th) titled "Langchain4j & Ollama - Integrating LLMs with Java programs".
The code, including the step-by-step guidance is available here: https://github.com/deors/workshop-langchain4j
// OpenAI model ChatLanguageModel model = OpenAiChatModel .withApiKey(”YOUR_OPENAI_API_KEY")); // the first prompt var message = "Hello world!"; System.out.println("\n>>> " + message); var answer = model.generate(message); System.out.println(answer); } }
regularly Manage multiple versions of a given model Create your own models Fine-tune an existing model Run a model locally (CPU and GPU) Serve models exposing a REST API Things that can be done with Ollama