2025-05-23 11:09:53 +02:00
# --8<-- [start:installation]
2025-01-08 05:35:49 -03:00
2025-01-13 12:27:36 +00:00
vLLM has experimental support for macOS with Apple silicon. For now, users shall build from the source vLLM to natively run on macOS.
2025-01-08 05:35:49 -03:00
Currently the CPU implementation for macOS supports FP32 and FP16 datatypes.
2025-05-23 11:09:53 +02:00
!!! warning
There are no pre-built wheels or images for this device, so you must build vLLM from source.
2025-01-31 23:38:35 +00:00
2025-05-23 11:09:53 +02:00
# --8<-- [end:installation]
# --8<-- [start:requirements]
2025-01-08 05:35:49 -03:00
2025-01-13 12:27:36 +00:00
- OS: `macOS Sonoma` or later
- SDK: `XCode 15.4` or later with Command Line Tools
2025-04-05 19:51:51 +08:00
- Compiler: `Apple Clang >= 15.0.0`
2025-01-13 12:27:36 +00:00
2025-05-23 11:09:53 +02:00
# --8<-- [end:requirements]
# --8<-- [start:set-up-using-python]
2025-01-08 05:35:49 -03:00
2025-05-23 11:09:53 +02:00
# --8<-- [end:set-up-using-python]
# --8<-- [start:pre-built-wheels]
2025-01-08 05:35:49 -03:00
2025-05-23 11:09:53 +02:00
# --8<-- [end:pre-built-wheels]
# --8<-- [start:build-wheel-from-source]
2025-01-08 05:35:49 -03:00
After installation of XCode and the Command Line Tools, which include Apple Clang, execute the following commands to build and install vLLM from the source.
2025-06-23 18:59:09 +01:00
```bash
2025-01-12 03:17:13 -05:00
git clone https://github.com/vllm-project/vllm.git
cd vllm
2025-03-08 17:44:35 +01:00
pip install -r requirements/cpu.txt
2025-06-23 18:59:09 +01:00
pip install -e .
2025-01-08 05:35:49 -03:00
```
2025-05-23 11:09:53 +02:00
!!! note
On macOS the `VLLM_TARGET_DEVICE` is automatically set to `cpu` , which currently is the only supported device.
2025-01-08 05:35:49 -03:00
2025-01-13 12:27:36 +00:00
#### Troubleshooting
2025-01-08 05:35:49 -03:00
2025-01-12 03:17:13 -05:00
If the build has error like the following snippet where standard C++ headers cannot be found, try to remove and reinstall your
2025-01-08 05:35:49 -03:00
[Command Line Tools for Xcode ](https://developer.apple.com/download/all/ ).
2025-01-12 03:17:13 -05:00
```text
2025-01-08 05:35:49 -03:00
[...] fatal error: 'map' file not found
1 | #include <map>
| ^~~~~
1 error generated.
[2/8] Building CXX object CMakeFiles/_C.dir/csrc/cpu/pos_encoding.cpp.o
[...] fatal error: 'cstddef' file not found
10 | #include <cstddef>
| ^~~~~~~~~
1 error generated.
```
2025-01-13 12:27:36 +00:00
2025-05-23 11:09:53 +02:00
# --8<-- [end:build-wheel-from-source]
# --8<-- [start:pre-built-images]
2025-01-13 12:27:36 +00:00
2025-05-23 11:09:53 +02:00
# --8<-- [end:pre-built-images]
# --8<-- [start:build-image-from-source]
2025-01-13 12:27:36 +00:00
2025-05-23 11:09:53 +02:00
# --8<-- [end:build-image-from-source]
# --8<-- [start:extra-information]
# --8<-- [end:extra-information]