Technology · Agentic → Structured Output · Open Source · wiki:deep
LMQL (Language Model Query Language) is a programming language for LLMs — a Python superset where top-level query strings prompt models, template variables are completed under where constraints (stopping phrases, token/character rules, datatypes), and control flow/decoding (argmax, sample, beam, best_k) are first-class. Supports OpenAI/Azure and Hugging Face Transformers, async batching, playground IDE, and VS Code tooling. Apache-2.0 (ETH SRI). Primary map push ~2025-05 — treat as research-strong; verify maintenance before production lock.
Useful when agents need declarative constraints and scripted prompting beyond simple JSON schemas. Prefer Instructor for day-to-day Pydantic extraction; prefer Outlines/Guidance for active structured-generation stacks with clearer recent momentum.
Author .lmql or embedded programs: prompt strings with [VARS], attach where constraints, branch with Python control flow, run via lmql run / playground / Python API. Local HF models may need lmql serve-model.
pip install lmql; GPU extras as needed). Related: guidance · instructor · outlines · topics/12-central-nervous-system
Scroll inside the canvas to pan
Catalog backlinks — what points here (wiki “what links here”).
Claims below are backed by science sources on disk.
Language / constraints role
eth-sri/lmql · MODERATE
“A language for constraint-guided and efficient LLM programming.”
Paper / research framing
Prompting Is Programming: A Query Language for Large Language Models · MODERATE
“LMQL is a programming language for large language models (LLMs) based on a superset of Python.”
Contrast vs Outlines
Outlines contrast · MODERATE
“LMQL offers a novel way of interweaving traditional programming with the ability to call LLMs in your code.”
Features and peers linked from the catalog map — not a second product surface.
No DM vendor crosswalk edges yet.
Primary repo github.com/eth-sri/lmql · Open Source
technologies/lmql/README.md
9 tags · 7 out · 8 in · 3 artifacts · 1 gaps · 27 corpus docs
map_edge · 4
tech_features · 1
tech_quote · 8
tech_readme · 1
tech_science_source · 3
tech_section · 10