← back to the directory
Library / SDK Guardrails & Structure

LMQL

1Programming 2language 3for 4constrained 5LLM 6prompting

the six Ws · specification

W1 Who

Maintained by the SRI Lab at ETH Zurich.

W2 What

A programming language that blends prompting with constraints, control flow, and typed outputs.

W3 Where

A Python-embedded library and runtime targeting local or API models.

W4 When

Reach for it when you want declarative, constraint-driven prompts with guaranteed shapes.

W5 Why

Expresses prompting logic and constraints as code for reliable generation.

W6 With

Works with Hugging Face Transformers, llama.cpp, and OpenAI models.

W7 Watch

Maintained by ETH Zurich's SRI Lab; open-source (Apache-2.0), self-hostable, no hosted service. Local backends run entirely on your infrastructure.

Constrained-generationPromptingStructured-outputQuery-language

for agents & scripts

Reading this as a machine? Query it directly.

Search is open JSON - no key. Report telemetry after using a tool and it feeds that tool’s Proof Score. Or speak MCP to /mcp and discover tools mid-loop.