|
| 1 | +.. _install-mlc-packages: |
| 2 | + |
| 3 | +Install MLC LLM Python Package |
| 4 | +============================== |
| 5 | + |
| 6 | +.. contents:: Table of Contents |
| 7 | + :local: |
| 8 | + :depth: 2 |
| 9 | + |
| 10 | +MLC LLM Python Package can be installed directly from a prebuilt developer package, or built from source. |
| 11 | + |
| 12 | +Option 1. Prebuilt Package |
| 13 | +-------------------------- |
| 14 | + |
| 15 | +We provide nightly built pip wheels for MLC-LLM via pip. |
| 16 | +Select your operating system/compute platform and run the command in your terminal: |
| 17 | + |
| 18 | +.. note:: |
| 19 | + ❗ Whenever using Python, it is highly recommended to use **conda** to manage an isolated Python environment to avoid missing dependencies, incompatible versions, and package conflicts. |
| 20 | + |
| 21 | +.. tabs:: |
| 22 | + |
| 23 | + .. tab:: Linux |
| 24 | + |
| 25 | + .. tabs:: |
| 26 | + |
| 27 | + .. tab:: CPU |
| 28 | + |
| 29 | + .. code-block:: bash |
| 30 | +
|
| 31 | + conda activate your-environment |
| 32 | + python3 -m pip install --pre --force-reinstall -f https://mlc.ai/wheels mlc-chat-nightly mlc-ai-nightly |
| 33 | +
|
| 34 | + .. tab:: CUDA 11.7 |
| 35 | + |
| 36 | + .. code-block:: bash |
| 37 | +
|
| 38 | + conda activate your-environment |
| 39 | + python3 -m pip install --pre --force-reinstall -f https://mlc.ai/wheels mlc-chat-nightly-cu117 mlc-ai-nightly-cu117 |
| 40 | +
|
| 41 | + .. tab:: CUDA 11.8 |
| 42 | + |
| 43 | + .. code-block:: bash |
| 44 | +
|
| 45 | + conda activate your-environment |
| 46 | + python3 -m pip install --pre --force-reinstall -f https://mlc.ai/wheels mlc-chat-nightly-cu118 mlc-ai-nightly-cu118 |
| 47 | +
|
| 48 | + .. tab:: CUDA 12.1 |
| 49 | + |
| 50 | + .. code-block:: bash |
| 51 | +
|
| 52 | + conda activate your-environment |
| 53 | + python3 -m pip install --pre --force-reinstall -f https://mlc.ai/wheels mlc-chat-nightly-cu121 mlc-ai-nightly-cu121 |
| 54 | +
|
| 55 | + .. tab:: CUDA 12.2 |
| 56 | + |
| 57 | + .. code-block:: bash |
| 58 | +
|
| 59 | + conda activate your-environment |
| 60 | + python3 -m pip install --pre --force-reinstall -f https://mlc.ai/wheels mlc-chat-nightly-cu122 mlc-ai-nightly-cu122 |
| 61 | +
|
| 62 | + .. tab:: ROCm 5.6 |
| 63 | + |
| 64 | + .. code-block:: bash |
| 65 | +
|
| 66 | + conda activate your-environment |
| 67 | + python3 -m pip install --pre --force-reinstall -f https://mlc.ai/wheels mlc-chat-nightly-rocm56 mlc-ai-nightly-rocm56 |
| 68 | + |
| 69 | + .. tab:: ROCm 5.7 |
| 70 | + |
| 71 | + .. code-block:: bash |
| 72 | +
|
| 73 | + conda activate your-environment |
| 74 | + python3 -m pip install --pre --force-reinstall -f https://mlc.ai/wheels mlc-chat-nightly-rocm57 mlc-ai-nightly-rocm57 |
| 75 | +
|
| 76 | + .. tab:: Vulkan |
| 77 | + |
| 78 | + Supported in all Linux packages. |
| 79 | + |
| 80 | + .. note:: |
| 81 | + |
| 82 | + If encountering issues with GLIBC not found, please install the latest glibc in conda: |
| 83 | + |
| 84 | + .. code-block:: bash |
| 85 | +
|
| 86 | + conda install -c conda-forge libgcc-ng |
| 87 | +
|
| 88 | + .. tab:: macOS |
| 89 | + |
| 90 | + .. tabs:: |
| 91 | + |
| 92 | + .. tab:: CPU + Metal |
| 93 | + |
| 94 | + .. code-block:: bash |
| 95 | +
|
| 96 | + conda activate your-environment |
| 97 | + python3 -m pip install --pre --force-reinstall -f https://mlc.ai/wheels mlc-chat-nightly mlc-ai-nightly |
| 98 | +
|
| 99 | + .. note:: |
| 100 | + |
| 101 | + Always check if conda is installed properly in macOS using the command below: |
| 102 | + |
| 103 | + .. code-block:: bash |
| 104 | +
|
| 105 | + conda info | grep platform |
| 106 | +
|
| 107 | + It should return "osx-64" for Mac with Intel chip, and "osx-arm64" for Mac with Apple chip. |
| 108 | + |
| 109 | + .. tab:: Windows |
| 110 | + |
| 111 | + .. tabs:: |
| 112 | + |
| 113 | + .. tab:: CPU + Vulkan |
| 114 | + |
| 115 | + .. code-block:: bash |
| 116 | +
|
| 117 | + conda activate your-environment |
| 118 | + python3 -m pip install --pre --force-reinstall -f https://mlc.ai/wheels mlc-chat-nightly mlc-ai-nightly |
| 119 | +
|
| 120 | + .. note:: |
| 121 | + If encountering the error below: |
| 122 | + |
| 123 | + .. code-block:: bash |
| 124 | +
|
| 125 | + FileNotFoundError: Could not find module 'path\to\site-packages\tvm\tvm.dll' (or one of its dependencies). Try using the full path with constructor syntax. |
| 126 | +
|
| 127 | + It is likely `zstd`, a dependency to LLVM, was missing. Please `download <https://github.com/facebook/zstd/releases/tag/v1.5.5>`__ the precompiled binary, rename it to `zstd.dll` and copy to the same folder as `tvm.dll`. |
| 128 | + |
| 129 | + |
| 130 | +Option 2. Build from Source |
| 131 | +--------------------------- |
| 132 | + |
| 133 | +Upcoming. |
0 commit comments