LMQL
lmql.aiA programming language for robust, modular LLM interaction
Dev Toolsllmprompt-engineeringpythonlanguage-modelconstraintsopen-sourceai-programming

About
LMQL (Language Model Query Language) is a programming language designed for interacting with large language models. It allows developers to write prompts using Python control flow, typed variables, and hard constraints enforced at runtime. The project is created by the SRI Lab at ETH Zurich and supports multiple LLM backends.
Problem
Writing reliable, modular, and portable prompts for LLMs is difficult without type safety, constraints, or structured control flow.
For
software developers and researchers working with large language models
How it works
Developers write query functions in Python-like syntax with special prompt strings, typed variables, and constraint expressions that the LMQL runtime enforces during LLM generation.
Business model
open-source
Status
launched
Company
SRI Lab @ ETH Zurich