eth-sri/lmql
A language for constraint-guided and efficient LLM programming. observed · 2026-08-28
Health v2 · maintenance only
32/100
- Activity 22
- Release rhythm 8
- Longevity 98
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 1378
- days_rel: n/a
- days_push: 468
- n_releases_24m: 0
Adoption not part of the score
4208 stars · 221 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
LMQL is a query/programming language for large language models, implemented as a Python-based superset that lets developers interleave prompts, control flow, and constraints in normal code. It supports multiple inference backends (OpenAI, HuggingFace Transformers, llama.cpp) with an optimizing runtime that enforces constraints during generation.
Use cases
- write llm programs with constraints on generated output
- constrain llm responses to a format or length
- build multi-step prompting pipelines with control flow
- run the same prompt code across openai and local models
- serve a local huggingface or llama.cpp model for prompting
- modularize reusable prompt components with nested queries
When to choose
- you need token-level constraints or typed outputs from an llm
- you want portable prompt programs across multiple model backends
- you prefer declarative prompting embedded in python code
When to avoid
- you only need simple one-off api calls to a chat model
- you rely heavily on chat-only apis with limited constraint support
- you need a production framework with agents and tooling beyond prompting
Facets
library · maturity active
programming-language llm-inference prompt-engineering sdk cli large-language-models programming-languages artificial-intelligence developer-tools python cli cross-platform dsl constrained-decoding llm-prompting llama-cpp openai huggingface-transformers query-language natural-language-processing gpu
7 sources
- readme: https://github.com/eth-sri/lmql · fetched 2026-08-28 · 490f2188debc
- homepage: https://lmql.ai · fetched 2026-08-29 · cfb312c99dab
- site_page: https://lmql.ai/docs · fetched 2026-08-29 · 0c275d9601ca
- site_page: https://lmql.ai/docs/language/nestedqueries.html · fetched 2026-08-29 · 270dfbb09e93
- site_page: https://lmql.ai/docs/models/llama.cpp.html · fetched 2026-08-29 · 9496f989bf8f
- site_page: https://lmql.ai/docs/models/openai.html · fetched 2026-08-29 · cd942c35ec67
- site_page: https://lmql.ai/docs/models/hf.html · fetched 2026-08-29 · 2b9c89085a13
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| eth-sri/lmql | main | 32 |
For agents
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem