Deep-dive into llm4s, a production-grade Scala framework for building LLM applications. From type-safe error handling to provider abstraction and context management, it covers agent orchestration and shipping reliable LLM systems in Scala.
Deep-dive guide to effect polymorphism in Scala using F[_] and type classes. Write generic code that works with Cats-Effect or ZIO, then swap runtimes later. Learn EffectSystem patterns, Kleisli composition, and examples from flowforge.
After five major contributions across error handling, type safety, and safety utilities, here are the production patterns that work and the ones that do not. A practical summary of trade-offs, guardrails, and what we kept in llm4s.
Learn Kleisli from first principles to compose effectful data pipelines with Cats or Cats Effect, wiring sources, transforms, and sinks with clear errors, observability, and easy tests. Includes a Scala example you can lift into prod.
Build Scala compile-time data contracts with macros and TypeInspector patterns so schema drift fails at compile time, not midnight in prod. Includes patterns for required vs optional fields and compile errors that block bad data early.
Stop typos from reaching production. Replace string constants with enums, add type classes for effect polymorphism, and let the compiler catch bugs. Real refactor from llm4s prevented message role typos and added type class infra.
Stop runtime exceptions from crashing LLM pipelines. Build type-safe error hierarchies with Scala Either, ADTs, and smart constructors. Real refactor from llm4s turned generic exceptions into 12+ structured error types and debugging.
Build reusable Scala utilities for data engineering on GCP, covering CDC, Delta maintenance, schema evolution, GCS helpers, affected-partition strategies, and error handling. Includes patterns for safe ops and repeatable pipelines.