AI and LLMs in Scala and on the JVM
Five short pages, each answering one question developers ask before they have heard of LLM4S, with a small piece of compiled code and links into the guides that go deeper.
- An LLM framework for Scala (and the LangChain question): what LLM4S is, how it relates to LangChain and LangChain4j, and a first call.
- Build AI agents in Scala: an agent with a tool, guardrails and streaming.
- RAG in Scala: ingest, embed, store, retrieve and answer, then evaluate.
- An LLM library for Java and Kotlin: the Java facade and the Kotlin coroutine API, with Maven and Gradle coordinates.
- Call OpenAI, Anthropic, Gemini or Ollama from Scala: one client type, the provider chosen by configuration, and the full provider list.
Every Scala block on these pages is compiled in CI, and the ones that call a model are also run there against a
scripted model, so they never reach the network (ScalaAiPagesSpec in modules/samples).