Get AI agent and LLM programming in Scala with llm4s, for startup founders, 249 GitHub stars
249 stars108 forksScalaQuality 8/10Updated 7/19/2026100% free ยท open source
What it does
Llm4s allows startup founders to program AI agents and Large Language Models (LLMs) using the Scala programming language
Install / run
Add the llm4s library to your Scala project by including the following dependency in your build.sbt file: libraryDependencies += "io.llm4s" %% "llm4s" % "0.1.0"
When to use it
โขWhen building a conversational interface that requires complex reasoning and decision-making
โขWhen integrating LLMs into an existing Scala application to improve text analysis and generation
โขWhen creating custom AI agents that interact with users or other systems in a Scala-based environment
Quick start
1Create a new Scala project using sbt and add the llm4s library as a dependency
2Import the llm4s package in your Scala file: import io.llm4s._
3Define an AI agent using the Agent class: val agent = new Agent"
4Configure the agent with a specific LLM and task: agent.configure(llm = "transformer", task = "text-generation")
5Use the agent to generate text based on a prompt: val output = agent.generate("Write a short story about AI")
Ready-to-paste prompt
agent.generate("Explain the concept of artificial intelligence in 100 words")
Heads up: Make sure you have Scala 2.13 or later installed, as llm4s is not compatible with earlier versions of the Scala runtime
Saves to your device
What's inside โ free to inspect
No purchase needed
Read the entire source before you build โ unlike paid marketplaces that hide it behind a buy button.