title | slug | description | keywords | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Build From Source |
/build-from-source |
Install Nitro manually |
|
This guide provides step-by-step instructions for building Nitro from source on Linux, macOS, and Windows systems.
First, you need to clone the Nitro repository:
git clone --recurse https://github.com/janhq/nitro
If you don't have git, you can download the source code as a file archive from Nitro GitHub. Each release also has source snapshots.
Next, let's install the necessary dependencies.
-
On MacOS with Apple Silicon:
./install_deps.sh
-
On Windows:
cmake -S ./nitro_deps -B ./build_deps/nitro_deps cmake --build ./build_deps/nitro_deps --config Release
This creates a build_deps
folder.
Now, let's generate the build files.
-
On MacOS, Linux, and Windows:
mkdir build && cd build cmake ..
-
On MacOS with Intel processors:
mkdir build && cd build cmake -DLLAMA_METAL=OFF ..
-
On Linux with CUDA:
mkdir build && cd build cmake -DLLAMA_CUDA=ON ..
Time to build Nitro!
-
On MacOS:
make -j $(sysctl -n hw.physicalcpu)
-
On Linux:
make -j $(nproc)
-
On Windows:
make -j $(%NUMBER_OF_PROCESSORS%)
Finally, let's start Nitro.
-
On MacOS and Linux:
./nitro
-
On Windows:
cd Release copy ..\..\build_deps\_install\bin\zlib.dll . nitro.exe
To verify if the build was successful:
curl http://localhost:3928/healthz