llm4s-scala

Provide functional LLM interfaces for Scala with ZIO and Cats Effect.

1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/HermeticOrmus/hermetic-claude --skill llm4s-scala-hermeticormus
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: llm4s-scala
Source: https://github.com/HermeticOrmus/hermetic-claude/tree/main/claude/skills/llm4s-scala
Command: npx skills add https://github.com/HermeticOrmus/hermetic-claude --skill llm4s-scala-hermeticormus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill simplifies building LLM applications in Scala by providing functional interfaces and integrating with effect systems like ZIO and Cats Effect, enabling type-safe AI pipelines and robust applications.

Core Features & Use Cases

  • Functional LLM Interfaces: Define LLM interactions as effectful operations using ZIO or Cats Effect.
  • Type-Safe Pipelines: Compose LLM calls and data transformations using monadic structures and Kleisli composition.
  • Structured Output: Leverage JSON codecs for guaranteed structured responses from LLMs.
  • Streaming Support: Handle LLM responses token-by-token using FS2 and ZStream.
  • Use Case: Develop a Scala application that takes user input, generates a summary using an LLM, extracts keywords from the summary, and then elaborates on those keywords, all within a type-safe, effectful pipeline.

Quick Start

Use the llm4s-scala skill to generate a summary from the provided text.

Frequently Asked Questions about llm4s-scala

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build type-safe LLM pipelines in Scala using ZIO or Cats Effect?

Type-safe LLM pipelines in Scala are built by defining LLM interactions as effectful operations using ZIO or Cats Effect. This enables composable prompt systems and robust applications leveraging Scala's type system, supporting monadic composition and error handling.

Can I handle LLM streaming responses token-by-token with FS2 and ZStream in Scala?

LLM streaming responses are handled token-by-token using FS2 and ZStream. This provides effect safety and allows developers to process continuous text generation within functional programming pipelines without blocking operations.

What is the best way to compose multiple LLM calls and data transformations in Scala?

Composing multiple LLM calls and data transformations is best achieved using monadic structures and Kleisli composition. This method ensures type safety and effect safety throughout the entire AI application pipeline.

How do I guarantee structured JSON output from LLM responses in a functional Scala application?

Structured JSON output from LLM responses is guaranteed by leveraging JSON codecs. This ensures type-safe parsing of generated content directly into Scala case classes within your AI pipelines.

Does llm4s-scala support building complex AI workflows like summarizing text and extracting keywords?

llm4s-scala supports complex AI workflows such as taking user input, generating a summary, extracting keywords, and elaborating on them. This is achieved within a type-safe, effectful pipeline using functional interfaces.

Why should I use functional programming for AI applications instead of standard Scala LLM interfaces?

Functional programming for AI applications provides effect safety, robust error handling, and type-safe pipelines. Using ZIO and Cats Effect ensures composable prompt systems that prevent runtime failures common in standard interfaces.