Skip to content

Langium AIAI toolbox for grounding LLMs on Langium DSLs

Build, evaluate, and refine AI-powered tooling for your Langium DSL — provider-agnostic, and grounded in your DSL's grammar.

Langium

What is Langium AI? ​

npm - langium-ai-toolsnpm - langium-ai

Langium AI is a suite of tools that make it easier to build AI applications with Langium DSLs.

It provides a core library (langium-ai-tools), a CLI tool (langium-ai), and a set of agent skills that work together to allow you to build, evaluate, refine, and repeat. This makes it easy to measure whether changes to your AI application (model, prompt, context management, MCP, tools, and more) are actually improving your results, rather than just guessing.

We created Langium AI out of a desire to do this very kind of checking on Langium DSLs, and to really codify it in a way that's both effective and easy to use.

These problems are at the core of what we try to solve with Langium AI:

  • Model selection: Figuring out which models are best suited for your DSL, factoring in price, performance, and speed.
  • Context management: Determining what techniques, new and old, give consistently great results for your DSL.
  • Evaluating DSL output: Scoring performance on evaluation cases against your parser, validations, type checker, and more, and recording your results.
  • Processing DSL programs as data: Exposing tools to generically process Langium-based DSL programs as data, making it easy to define syntactic rules for splitting, chunking, and analyzing documents in a DSL-respecting fashion.
  • Developing natural-language interfaces for DSLs: Grounding an AI assistant on your language's implementation so it generates valid code with a high degree of trust.

Nothing is 100% with LLMs, which is both quite valuable from a flexibility standpoint, and immensely problematic. With Langium AI, we want to make it feasible to tame that non-determinism, and have greater trust and transparency in how you develop exceptional AI applications with Langium DSLs.

If you're interested, and new to this project, you can check out our Quickstart guide to get going quickly. This will walk you through installing lai (the langium-ai CLI) in your existing Langium project and getting evaluations set up.

For some background, you can also read Langium AI: The fusion of DSLs and LLMs, which first introduced this project.