LMQL is a programming language for LLMs. Robust and modular LLM prompting using types, templates, constraints and an optimizing runtime. @lmql.query def meaning_of_life(): '''lmql # top-level strings are prompts "Q: What is the answer to life, the \ universe and everything?" # generation via (constrained) variables "A: [ANSWER]" where \ len(ANSWER) < 120 and STOPS_AT(ANSWER, ".") # results are dir