Java and Kotlin
LLM4S from a JVM language other than Scala: llm4s-java-api and the modules built on it.
The Java API
- Java - Call a model from Java with
llm4s-java-api: a client, a conversation and failures you can read without Scala - Java AI services - Declare an annotated interface and let
llm4s-java-apiimplement it (experimental) - Java RAG - Ingest documents and ask questions from Java with
llm4s-java-rag: answers with their sources - Java Reactor - Stream a reply as a Reactor
Flux<String>withllm4s-reactor - Java Threading and Cancellation - Which thread a call blocks, sharing one client, virtual threads, interrupts and timeouts
- Moving a Java app from LangChain4j or Spring AI - Each LangChain4j and Spring AI concept in
llm4s-java-apiterms, with compiled before-and-after Java
JVM frameworks
- Spring Boot -
llm4s-spring-boot-starter: properties, anLLM4STemplatebean, asynchronous calls and a health indicator - Spring AI - Any llm4s client as a Spring AI
ChatModelorEmbeddingModel, and a Spring AIChatModelas an llm4s client - Quarkus - The
quarkus-llm4sextension:JLlmClientbeans fromapplication.properties, checked at build time - Micronaut - A
@Factorybean forJLlmClientconfigured fromapplication.yml, blocking and streamed endpoints and tests - Helidon - Helidon SE 4: the client built from
application.yaml, routes on virtual threads, a health check and tests
Kotlin
- Kotlin -
llm4s-kotlin-api: suspend functions,Flowstreaming, agents with tools and the Kotlin DSL (experimental)
Building with Maven, Gradle or JBang? See Build Tools and Playgrounds.