<div align="center" id="top">
# XGrammar
[![Documentation](https://img.shields.io/badge/docs-latest-green)](https://xgrammar.mlc.ai/docs/)
[![License](https://img.shields.io/badge/license-apache_2-blue)](https://github.com/mlc-ai/xgrammar/blob/main/LICENSE)
**Efficient, Flexible and Portable Structured Generation**
[Get Started](#get-started) | [Documentation](https://xgrammar.mlc.ai/docs/) | [Blogpost](https://blog.mlc.ai/2024/11/22/achieving-efficient-flexible-portable-structured-generation-with-xgrammar) | [Technical Report](https://arxiv.org/abs/2411.15100)
</div>
## Overview
XGrammar is an open-source library for efficient, flexible, and portable structured generation.
It supports general context-free grammar to enable a broad range of structures while bringing careful system optimizations to enable fast executions.
XGrammar features a minimal and portable C++ backend that can be easily integrated into multiple environments and frameworks,
and is co-designed with the LLM inference engine and enables zero-overhead structured generation in LLM inference.
## Get Started
Please visit our [documentation](https://xgrammar.mlc.ai/docs/) to get started with XGrammar.
- [Installation](https://xgrammar.mlc.ai/docs/start/install)
- [Quick start](https://xgrammar.mlc.ai/docs/start/quick_start)
Raw data
{
"_id": null,
"home_page": "https://github.com/mlc-ai/xgrammar",
"name": "xgrammar",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.8",
"maintainer_email": null,
"keywords": "machine learning inference",
"author": "MLC Team",
"author_email": null,
"download_url": null,
"platform": null,
"description": "<div align=\"center\" id=\"top\">\n\n# XGrammar\n\n[![Documentation](https://img.shields.io/badge/docs-latest-green)](https://xgrammar.mlc.ai/docs/)\n[![License](https://img.shields.io/badge/license-apache_2-blue)](https://github.com/mlc-ai/xgrammar/blob/main/LICENSE)\n\n**Efficient, Flexible and Portable Structured Generation**\n\n\n[Get Started](#get-started) | [Documentation](https://xgrammar.mlc.ai/docs/) | [Blogpost](https://blog.mlc.ai/2024/11/22/achieving-efficient-flexible-portable-structured-generation-with-xgrammar) | [Technical Report](https://arxiv.org/abs/2411.15100)\n\n</div>\n\n## Overview\n\n\nXGrammar is an open-source library for efficient, flexible, and portable structured generation.\nIt supports general context-free grammar to enable a broad range of structures while bringing careful system optimizations to enable fast executions.\nXGrammar features a minimal and portable C++ backend that can be easily integrated into multiple environments and frameworks,\nand is co-designed with the LLM inference engine and enables zero-overhead structured generation in LLM inference.\n\n\n\n## Get Started\n\nPlease visit our [documentation](https://xgrammar.mlc.ai/docs/) to get started with XGrammar.\n- [Installation](https://xgrammar.mlc.ai/docs/start/install)\n- [Quick start](https://xgrammar.mlc.ai/docs/start/quick_start)\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "Efficient, Flexible and Portable Structured Generation",
"version": "0.1.7",
"project_urls": {
"Homepage": "https://github.com/mlc-ai/xgrammar"
},
"split_keywords": [
"machine",
"learning",
"inference"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "607b95b9d937336a93c3d9af69d8b01e5a0d4d514b16a299ea3ad1b7f48d2302",
"md5": "9845c38172ad98791440839f8affe957",
"sha256": "6648fe4cadd8146ca7afcce472422195dd2e123e812b14f81934fcce03bcecdc"
},
"downloads": -1,
"filename": "xgrammar-0.1.7-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "9845c38172ad98791440839f8affe957",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "<4,>=3.8",
"size": 332343,
"upload_time": "2024-12-12T22:41:19",
"upload_time_iso_8601": "2024-12-12T22:41:19.440534Z",
"url": "https://files.pythonhosted.org/packages/60/7b/95b9d937336a93c3d9af69d8b01e5a0d4d514b16a299ea3ad1b7f48d2302/xgrammar-0.1.7-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4d571abf84a45539e31ae290b304a0a7c5cacb61e2993110dae22bed5a7bb5d8",
"md5": "10c1793d30c79c5f01ec88a005b93e2d",
"sha256": "8ac5334dc68754b33a49d2c7cdfb3e379eccb54af378c62fe7a2ee671cb912db"
},
"downloads": -1,
"filename": "xgrammar-0.1.7-cp310-cp310-win_amd64.whl",
"has_sig": false,
"md5_digest": "10c1793d30c79c5f01ec88a005b93e2d",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": "<4,>=3.8",
"size": 268975,
"upload_time": "2024-12-12T22:50:49",
"upload_time_iso_8601": "2024-12-12T22:50:49.797415Z",
"url": "https://files.pythonhosted.org/packages/4d/57/1abf84a45539e31ae290b304a0a7c5cacb61e2993110dae22bed5a7bb5d8/xgrammar-0.1.7-cp310-cp310-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f66066b6da1050014c51ec24021c3b461809dc455ced9dd3565cc79dbb571202",
"md5": "d05c742669ea1a9ffebebd7dc21cedd2",
"sha256": "ac76155d8b630a92bf6aab46a82a3232c5e0b0045b4b38af1d80b3300b8be3ca"
},
"downloads": -1,
"filename": "xgrammar-0.1.7-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "d05c742669ea1a9ffebebd7dc21cedd2",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": "<4,>=3.8",
"size": 333388,
"upload_time": "2024-12-12T22:41:22",
"upload_time_iso_8601": "2024-12-12T22:41:22.616341Z",
"url": "https://files.pythonhosted.org/packages/f6/60/66b6da1050014c51ec24021c3b461809dc455ced9dd3565cc79dbb571202/xgrammar-0.1.7-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "135a14fbf65cdb84813ebebbc8e5732f544c635a83292e7eb7182c21cc97058d",
"md5": "6246fdf9168a1dd022cad5de2af5cc1e",
"sha256": "f54c1ecd00d1e26167764a543b4c2570b86aac3203b5b4b8dfc3054c62ff3c64"
},
"downloads": -1,
"filename": "xgrammar-0.1.7-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "6246fdf9168a1dd022cad5de2af5cc1e",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": "<4,>=3.8",
"size": 270299,
"upload_time": "2024-12-12T22:50:51",
"upload_time_iso_8601": "2024-12-12T22:50:51.447999Z",
"url": "https://files.pythonhosted.org/packages/13/5a/14fbf65cdb84813ebebbc8e5732f544c635a83292e7eb7182c21cc97058d/xgrammar-0.1.7-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4c4ed4278a83b28fc17eec28f19e85a88a02d1a4361009359f9792e59614dfd5",
"md5": "d5c71ca49ef0110d48168b73d4b2fb95",
"sha256": "bd74696c140959dd09b9f26d94a7a44246de5bcd2806b0be9a0b1ddb38bc7460"
},
"downloads": -1,
"filename": "xgrammar-0.1.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "d5c71ca49ef0110d48168b73d4b2fb95",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": "<4,>=3.8",
"size": 333192,
"upload_time": "2024-12-12T22:41:25",
"upload_time_iso_8601": "2024-12-12T22:41:25.338683Z",
"url": "https://files.pythonhosted.org/packages/4c/4e/d4278a83b28fc17eec28f19e85a88a02d1a4361009359f9792e59614dfd5/xgrammar-0.1.7-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cf3d62f24dece18ce5ffba1456d8f426ebbd83e00e79d97ef37d9a4438daa48a",
"md5": "0144aa5f9f429f9e97bb38edd0340f28",
"sha256": "7aa67f7a738255d95beaf554fbeabb7c683ff97d9a42ae0e78913001696c751b"
},
"downloads": -1,
"filename": "xgrammar-0.1.7-cp312-cp312-win_amd64.whl",
"has_sig": false,
"md5_digest": "0144aa5f9f429f9e97bb38edd0340f28",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": "<4,>=3.8",
"size": 270806,
"upload_time": "2024-12-12T22:50:54",
"upload_time_iso_8601": "2024-12-12T22:50:54.567330Z",
"url": "https://files.pythonhosted.org/packages/cf/3d/62f24dece18ce5ffba1456d8f426ebbd83e00e79d97ef37d9a4438daa48a/xgrammar-0.1.7-cp312-cp312-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "73e97f06dd06140f41fa65b07ab367fa22288b9eee9edc9fc406c0a5fe8d3515",
"md5": "fc68f9a4182b3d97256ad8271fe253ff",
"sha256": "ef212a1fc3eedc0badbf33cf273c7a113f6dbae6dbc8ec4089e1c7be0052b7b0"
},
"downloads": -1,
"filename": "xgrammar-0.1.7-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"has_sig": false,
"md5_digest": "fc68f9a4182b3d97256ad8271fe253ff",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": "<4,>=3.8",
"size": 332361,
"upload_time": "2024-12-12T22:41:26",
"upload_time_iso_8601": "2024-12-12T22:41:26.977400Z",
"url": "https://files.pythonhosted.org/packages/73/e9/7f06dd06140f41fa65b07ab367fa22288b9eee9edc9fc406c0a5fe8d3515/xgrammar-0.1.7-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "16b1c3ed209ce12d9866886fba53974d2dcfcf3309cbaf82f63139bc931e1223",
"md5": "4d38e069e58c9ff63139da981b563966",
"sha256": "295bd0e0f7c55e13c63bbac21ff0d487105d49e0b4ff77dbcf2161c2e0be5395"
},
"downloads": -1,
"filename": "xgrammar-0.1.7-cp39-cp39-win_amd64.whl",
"has_sig": false,
"md5_digest": "4d38e069e58c9ff63139da981b563966",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": "<4,>=3.8",
"size": 267516,
"upload_time": "2024-12-12T22:50:56",
"upload_time_iso_8601": "2024-12-12T22:50:56.943320Z",
"url": "https://files.pythonhosted.org/packages/16/b1/c3ed209ce12d9866886fba53974d2dcfcf3309cbaf82f63139bc931e1223/xgrammar-0.1.7-cp39-cp39-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-12 22:41:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mlc-ai",
"github_project": "xgrammar",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "xgrammar"
}