{"library":"lm-format-enforcer","type":"library","category":null,"description":"LM Format Enforcer is a Python library designed to constrain the output of large language models (LLMs) to specific formats like JSON Schema or Regular Expressions. It integrates with popular LLM frameworks such as Hugging Face Transformers and vLLM. The current version is 0.11.3, and it typically releases minor updates frequently to support new integrations or fix compatibility issues.","language":"python","status":"active","version":"0.11.3","tags":["LLM","format enforcement","JSON Schema","Regex","transformers","vLLM","generation constraints"],"last_verified":"Wed May 20","install":[{"cmd":"pip install lm-format-enforcer","imports":["from lm_format_enforcer.json_schema_parser import JsonSchemaParser","from lm_format_enforcer.regex_parser import RegexParser","from lm_format_enforcer.integrations.transformers import build_transformers_prefix_allowed_tokens_fn","from lm_format_enforcer.integrations.vllm import build_vllm_prefix_allowed_tokens_fn"]},{"cmd":"pip install lm-format-enforcer[vllm]","imports":[]}],"homepage":null,"github":"https://github.com/noamgat/lm-format-enforcer","docs":"https://github.com/noamgat/lm-format-enforcer","changelog":null,"pypi":"https://pypi.org/project/lm-format-enforcer/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"3.10–3.9","success_rate":50,"avg_install_s":3.5,"avg_import_s":null,"wheel_type":"wheel"},"url":"https://checklist.day/v1/registry/lm-format-enforcer/compatibility"}}