-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
.. _how-to-portable-api: | ||
|
||
Portable API | ||
============ | ||
|
||
XGrammar is implemented with a lightweight C++ core that can be integrated into many platforms. | ||
Besides the C++ backend, we also provide ready-to-use Python and JavaScript/TypeScript libraries. | ||
|
||
For the Python library, simply check out the :ref:`Python API Reference <apixgrammar>`. Below | ||
we take a high-level view of the Javascript library. | ||
|
||
.. _how-to-portable-js: | ||
|
||
Javascript SDK for Web-based LLMs | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The JS SDK is designed to be used for LLMs that run in the browser, including | ||
`WebLLM <https://github.com/mlc-ai/web-llm>`__. WebLLM integrated with XGrammar's | ||
JS SDK, ``web-xgrammar``. It uses `emscripten <https://emscripten.org/>`__ to compile | ||
the C++ code into WebAssembly. | ||
|
||
To use this SDK, simply run ``npm install @mlc-ai/web-xgrammar``. For more, see | ||
`here <https://github.com/mlc-ai/xgrammar/tree/main/web>`__. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters