llm4s  by llm4s

Agentic and LLM programming framework for Scala

Created 1 year ago
250 stars

Top 100.0% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

LLM4S provides a robust, scalable Scala framework for building reliable LLM applications. It targets Scala and JVM developers, leveraging type safety, functional programming, and the JVM ecosystem to enhance AI development.

How It Works

LLM4S utilizes Scala's type safety and functional paradigms for predictable AI systems. Its architecture features multi-provider connectors, an agent framework, RAG engine, and observability. A key innovation is using ScalaMeta for automatic tool definition generation from Scala methods, enabling secure, containerized execution and dynamic mapping.

Quick Start & Requirements

  • Install/Run: Use giter8 template: sbt new llm4s/llm4s.g8 --name=<your.project.name> --package=<your.organization> --version=<your.project.version> --llm4s_version=0.3.2 --scala_version=3.7.1 --munit_version=1.1.1 --directory=<your.project.name> --force. Run examples with sbt "samples/runMain org.llm4s.samples.basic.BasicLLMCallingExample".
  • Prerequisites: JDK 21+, SBT, Docker.
  • Environment: Configure LLM provider API keys (e.g., OPENAI_API_KEY).
  • Links: Teaser Talk: https://www.youtube.com/watch?v=SXybj2P3_DE, Discord: https://discord.gg/4uvTPn6qww.

Highlighted Details

  • Multi-Provider: Supports OpenAI, Anthropic, Gemini, DeepSeek, Cohere, Mistral, Ollama, and more.
  • Agent Framework: Enables single/multi-agent workflows with standardized interfaces.
  • RAG: Built-in tools for search, embedding, retrieval, and RAGAS evaluation.
  • Observability: Detailed tracing, token usage, multi-backend output (Langfuse, console), and agent state visualization.
  • Tool Calling: ScalaMeta-driven auto-generation from Scala methods for secure, containerized execution.
  • Multimodal: Handles text, image, and voice.

Maintenance & Community

An active community gathers for weekly "LLM4S Dev Hour" sessions on Discord. The project participated in Google Summer of Code 2025 under Scala Center, offering mentorship opportunities. A partnership with Scalac is producing an AI-focused blog series.

Licensing & Compatibility

Licensed under the permissive MIT License, ensuring broad compatibility and commercial use. Designed for seamless JVM ecosystem integration.

Limitations & Caveats

LLM4S is a "broad pre-1.0 Scala AI framework" prioritizing production readiness. It exclusively targets Scala 3.7.1.

Health Check
Last Commit

3 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
0
Star History
0 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.