Added Nov 5, 2026
LMQL
FreeProgramming language for prompting LLMs with types and constraints
What is LMQL?
LMQL is an open-source query language that mixes Python with prompts, letting developers constrain and type what a language model generates. It was created by the SRI Lab at ETH Zurich for people building dependable LLM pipelines.
Query programs are written as Python functions in which plain strings are prompts and bracketed variables are filled in by the model. You can attach constraints such as maximum length or stop phrases, and typed variables like integers guarantee the output format. An optimizing runtime handles decoding.
Nested queries let you split prompts into reusable modules with local instructions. The project offers documentation, research papers and a browser playground for trying queries, and the maintainers are surveying developers about the next major version.
Features
- Constrained generation
- Typed output variables
- Python integration
- Nested queries
- Online playground
Tags
Releases
+ Submit new release- Listed
LMQL was added to the directory.
Organization
SRI Lab, ETH Zurich
🇨🇭 Switzerland
Listed by kitio.ai · unverified owner
Pricing
- Pricing model
- Free
- Paid options from
- 100% free
Sponsored
Your AI tool here
A Featured launch puts your tool in this spot and on the home page for a week.
Top LMQL alternatives
View allModels & APIs
Python and AI development platform with vetted packages and models
Models & APIs
Open-source deep learning library that runs on JAX, PyTorch and TF
Models & APIs
Open-source Python framework for ML and AI workflows
Models & APIs
Free Python library for topic modelling and text embeddings
If you liked LMQL
Type-safe Python agent framework from the Pydantic team
FreeAgents & automation4 views2 clicks to the websiteMade in United Kingdom- LLMNew
Command-line tool and Python library for working with any LLM
FreeModels & APIsMade in United States - spaCyNew
Open-source Python library for production natural language processing
FreeModels & APIsMade in Germany Open-source Python library for building web demos of ML models
FreeModels & APIs1 viewsMade in United States
Pros and cons
Pros
- Free and open source
- Guarantees output formats
- Backed by academic research
Cons
- New syntax to learn
- Smaller community than mainstream frameworks
- Release pace has been slow
Prompts & results
No prompts yet. Add your own prompt and output to help others use this tool.
Share a prompt
Reviews
Q&A
What is LMQL?
LMQL is an open-source query language that mixes Python with prompts, letting developers constrain and type what a language model generates. It was created by the SRI Lab at ETH Zurich for people building dependable LLM pipelines.
Can I call LMQL queries from regular Python code?
Yes. LMQL queries are defined as Python functions and can be called like any other function.
Can I try LMQL without installing it?
Yes. The project hosts a browser playground for writing and running queries.
How much does LMQL cost?
LMQL is 100% free.
Is there a free version of LMQL?
Yes. LMQL is completely free to use.
What are the main features of LMQL?
Constrained generation, Typed output variables, Python integration, Nested queries, Online playground.
Who makes LMQL?
LMQL is made by SRI Lab, ETH Zurich.
What are the best alternatives to LMQL?
Popular alternatives include Anaconda, Keras, Metaflow.