LMQL is a query language designed specifically for large language models (LLMs). It combines the natural language prompts with the expressiveness of Python to facilitate the interaction with LLMs. The tool provides various features such as constraints, debugging, retrieval, control flow, and support for Transformers, which make it easier to prompt responses from the LLM.
LMQL offers a broad range of pre-built prompts for tasks such as telling a joke, generating a packing list, searching Wikipedia, and chatting with a bot. In addition to providing high-level constraints, LMQL also allows users to control the generation process programmatically by supporting regular Python control flow statements.