eth-sri/lmql

A language for constraint-guided and efficient LLM programming.

46
/ 100
Emerging

Embeds LLM calls natively within Python syntax while applying declarative constraints via `where` clauses to guide model output—enabling control over token length, stopping phrases, and datatypes at the language level. Executes programs using advanced decoding strategies (beam search, best_k, argmax, sample) with optimizations like speculative execution and tree-based caching for faster inference. Supports OpenAI, Azure OpenAI, and Hugging Face Transformers models with async/parallel execution, plus integrations with LangChain and LlamaIndex.

4,161 stars. No commits in the last 6 months.

Stale 6m No Package No Dependents
Maintenance 2 / 25
Adoption 10 / 25
Maturity 16 / 25
Community 18 / 25

How are scores calculated?

Stars

4,161

Forks

219

Language

Python

License

Apache-2.0

Last pushed

May 22, 2025

Commits (30d)

0

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/llm-tools/eth-sri/lmql"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.