LMQL
the six Ws · specification
Maintained by the SRI Lab at ETH Zurich.
A programming language that blends prompting with constraints, control flow, and typed outputs.
A Python-embedded library and runtime targeting local or API models.
Reach for it when you want declarative, constraint-driven prompts with guaranteed shapes.
Expresses prompting logic and constraints as code for reliable generation.
Works with Hugging Face Transformers, llama.cpp, and OpenAI models.
Maintained by ETH Zurich's SRI Lab; open-source (Apache-2.0), self-hostable, no hosted service. Local backends run entirely on your infrastructure.