eth-sri/lmql
A programming language and runtime for constraining and efficiently interacting with large language models.

Velocity · 7d
+3.2
★ / day
Trend
→steady
star history
LMQL is a Python-based programming language designed for LLM interaction that interprets top-level strings as query strings passed to LLMs. It provides constraint mechanisms (where clauses) to guide model outputs, with automatic template variable completion. The language integrates LLM calls natively into program code and supports various backends including Hugging Face and OpenAI.