Install Sonar
Sonar supports Linux and macOS. Use WSL 2 to run Sonar on Windows. Native Windows builds are not supported.
Automatic installer
The installer detects the operating system, CPU architecture, and accelerator. It selects a release or nightly wheel for that platform.
curl -LsSf https://sonar.dphn.ai/install.sh | shThe installer can create ~/.sonar_venv with CPython 3.13. You can also select
an existing virtual environment. The installer checks its Python version and
architecture before it changes the environment.
Use explicit options for unattended installation.
curl -LsSf https://sonar.dphn.ai/install.sh | sh -s -- \ --yes \ --channel release \ --venv ~/.sonar_venvUse --backend to override hardware detection. Accepted values are cuda,
rocm, xpu, metal, and cpu. Run the installer with --help to see all
options.
Linux CPU wheels require the libnuma runtime library. The installer supports
APT, DNF, YUM, Zypper, and Pacman. It asks before it uses sudo. If sudo is
not available, it prints the required package-manager command and exits.
NVIDIA CUDA
The published wheel supports Linux x86-64, Python 3.10-3.13, and NVIDIA GPUs with compute capability 8.0 or newer.
Install uv. Then create an environment and install Sonar.
uv venv --python 3.12 --seedsource .venv/bin/activateuv pip install aphrodite-engine --torch-backend=cu130The package name remains aphrodite-engine. The command name remains
aphrodite.
Use a nightly build when you need the latest commit.
uv pip install aphrodite-engine \ --extra-index-url https://sonar.dphn.ai/nightlyDevelop with precompiled extensions
Use the per-commit nightly wheel when you change Python files only. Sonar takes the native extensions from the wheel for the current Git commit and installs the Python source in editable mode.
git clone https://github.com/dphnAI/sonar.gitcd sonaruv venv --python 3.12 --seedsource .venv/bin/activateAPHRODITE_USE_PRECOMPILED=1 \ uv pip install --editable . --torch-backend=cu130The commit must have a compatible wheel at
https://sonar.dphn.ai/commits/<commit>/. Build the native extensions when you
change csrc/, CMake, Rust, or a bundled native dependency.
Build native extensions incrementally
Install the development environment first. Then generate a CMake preset from the active virtual environment.
python tools/generate_cmake_presets.pycmake --preset releasecmake --build --preset release --target installThe generator detects Python, CUDA, Ninja, the available CPU cores, and
ccache or sccache. It stores the configuration in
CMakeUserPresets.json. CMake stores the build state in
cmake-build-release/.
After you change native code, run only the build command:
cmake --build --preset release --target installNinja recompiles the affected files and reuses the other objects. The
install target places the updated extensions in the source tree.
Use uv pip install --editable . to create the development environment. Do not
use it as the normal native-code rebuild command. It runs the Python packaging
backend and repeats package build work. A direct CMake build keeps one
configured build tree, exposes incremental build output, and gives more
consistent rebuild times.
Docker
Build the serving image from the current source tree.
git clone https://github.com/dphnAI/sonar.gitcd sonardocker build -f docker/Dockerfile -t sonar .docker run --rm --gpus all --ipc=host \ -p 2242:2242 \ sonar \ --model Qwen/Qwen3-0.6BAMD ROCm
ROCm support is source-based. Use the ROCm requirements and select the ROCm target.
git clone https://github.com/dphnAI/sonar.gitcd sonaruv venv --python 3.12 --seedsource .venv/bin/activateuv pip install -r requirements/build.txt -r requirements/rocm.txtAPHRODITE_TARGET_DEVICE=rocm uv pip install . --no-build-isolationInstall a compatible ROCm and PyTorch build before this procedure. The supported
GPU architectures follow the versions pinned in requirements/rocm.txt.
Intel XPU
Install the Intel GPU driver and oneAPI. Then build with the XPU requirements.
git clone https://github.com/dphnAI/sonar.gitcd sonarsource /opt/intel/oneapi/setvars.shuv venv --python 3.12 --seedsource .venv/bin/activateuv pip install -r requirements/build.txt -r requirements/xpu.txtAPHRODITE_TARGET_DEVICE=xpu uv pip install . --no-build-isolationCPU
The CPU backend supports Linux x86-64 and Arm64. Build it from source.
git clone https://github.com/dphnAI/sonar.gitcd sonaruv venv --python 3.12 --seedsource .venv/bin/activateuv pip install -r requirements/build/cpu.txt -r requirements/cpu.txtAPHRODITE_TARGET_DEVICE=cpu uv pip install . --no-build-isolationSet APHRODITE_CPU_KVCACHE_SPACE to the KV cache size in GiB. Start with a
conservative value if other processes use the same host.
Apple silicon
The Metal backend requires an Apple silicon Mac.
git clone https://github.com/dphnAI/sonar.gitcd sonaruv venv --python 3.12 --seedsource .venv/bin/activateuv pip install -r requirements/metal.txtAPHRODITE_TARGET_DEVICE=metal uv pip install . --no-build-isolationGoogle TPU
TPU support requires a TPU VM and a compatible PyTorch XLA installation.
git clone https://github.com/dphnAI/sonar.gitcd sonaruv venv --python 3.12 --seedsource .venv/bin/activateuv pip install -r requirements/tpu.txtAPHRODITE_TARGET_DEVICE=tpu uv pip install . --no-build-isolationUse the PyTorch XLA installation procedure for your TPU image before you build Sonar.