LMQL
Verified Oct 16, 2026 ActiveQuery language and runtime for constrained LLM prompting, built at ETH Zurich's SRI Lab.
Listed on EffectHub ·
Pricing
- Pricing model
- 100% Free
Free and open source under Apache-2.0. There is no hosted paid tier and no commercial edition — you pay only for whatever model backend you point it at. The browser playground is free to use.
Use tool ↗About LMQL
LMQL treats a prompt as a program. You write Python-flavoured queries with typed holes, templates and declarative constraints on the output, and the runtime enforces those constraints during decoding rather than retrying after the fact — so a field that must be one of five values comes back as one of five values instead of a parse error. It also caches and batches to cut token spend on repeated structure. It runs against OpenAI, Azure, Replicate, Hugging Face transformers and llama.cpp, ships as an Apache-2.0 Python package and has a browser playground for experimenting. It was built by the SRI Lab at ETH Zurich. Development has stalled: the last release is v0.7.3 from October 2023 and the last commit landed in May 2025.
- Platforms
- Web
- API
- Not confirmed
- Last verified
- Oct 16, 2026
Verified sources
- Programming language for LLM interaction with types, templates, constraints and an optimising runtime; created by SRI Lab at ETH Zurich; Apache-2.0 on GitHublmql.ai ↗
- Backend support for Hugging Face transformers, llama.cpp, OpenAI, Azure and Replicate; local install and browser playgroundlmql.ai ↗
- Repository not archived but last push 2025-05-22, last release v0.7.3 on 2023-10-14, 4,206 stars, Apache-2.0github.com ↗
Is LMQL legit?
We don’t label tools safe or unsafe. Below are the records we checked ourselves, each with the date we read it.
- Domain registered
- Nov 24, 2022 (3 years ago)Registry record (RDAP), registrar NameCheap, Inc., looked up Sep 6, 2026
- TLS certificate
- Issued by Let's Encrypt, valid until Nov 26, 2026Seen in our own connection to the site on Oct 16, 2026
- Last checked
- Oct 16, 2026The site answered
- On the market since
- 2023The vendor's own material, read by us
- Operated by
- SRI Lab, ETH Zurich, SwitzerlandOur research, card verified Aug 23, 2026
Pros & cons of LMQL
An academically serious take on making LLM output conform to a shape: constraints are enforced during decoding instead of validated afterwards, which is both faster and more reliable than the retry loops most libraries use. Worth reading even if you do not adopt it. The problem is maintenance — nothing has shipped since 2023 and the repository has been quiet since May 2025.
Pros
- Declarative constraints enforced during decoding, not by post-hoc validation
- Backend-agnostic: OpenAI, Azure, Replicate, Hugging Face transformers and llama.cpp
- Caching and batching to reduce token spend on repeated prompt structure
- Apache-2.0 licensed with 4.2k GitHub stars and a browser playground
- Backed by a university research lab rather than a startup runway
Cons
- No release since v0.7.3 in October 2023
- No repository commits since May 2025, so it is effectively dormant
- Learning a query language is a real cost against plainer libraries
- No hosted service, no commercial support, no SLA
Best for
- Researchers and engineers who want output constraints enforced at decode time
- Structured extraction where retry-and-validate loops are too expensive
- Learning how constrained decoding works before picking a maintained equivalent
Not for
- Production systems that need an actively maintained dependency
- Teams wanting managed hosting or commercial support
Watch out: The repository is not archived, but the last release is from October 2023 and the last commit from May 2025 — treat it as a research artefact you may end up maintaining yourself, not a supported dependency.
Alternatives to LMQL
LMQL head-to-head
Side-by-side fact sheets against the competitors our research or their makers name — pricing, platforms, API and both verdicts on one page.