Outlines is a Python library for making language models generate predictable, structured outputs. Instead of repairing malformed responses afterward, it constrains generation to match a requested type or format. Developers can require predefined choices, primitive Python types, Pydantic models, JSON schemas, regular expressions, function signatures, or custom grammars. The same interface works with local models, inference servers, and hosted APIs from several providers. Supported...