Developers · Run it yourself

Use your own audio.cpp build

Point Mirli at an audio.cpp binary you built or downloaded, and force a backend.

This guide points Mirli at an audio.cpp binary you built or downloaded, such as a ROCm build or a CUDA build for Linux, and forces the backend it runs with.

Before you begin

  • Get an audiocpp_cli for your system from one of these sources:

    Source How
    Prebuilt packages The audio.cpp releases page
    Homebrew on macOS brew tap 0xShug0/audio-cpp, then brew install audio-cpp
    Source, for Linux with an NVIDIA card scripts/build_linux.sh --backend cuda --target audiocpp_cli in audio.cpp's repository. Upstream's Linux packages include no CUDA audiocpp_cli.

    The CUDA Docker image is another way to get CUDA on Linux.

Point Mirli at the binary

  1. Set MIRLI_AUDIOCPP_BIN to the binary's absolute path in the server's environment:

    Terminal
    export MIRLI_AUDIOCPP_BIN=/opt/audiocpp/audiocpp_cli

    Alternatively, put audiocpp_cli on your PATH. A Homebrew install is found without either.

  2. Check which binary Mirli resolved:

    Terminal
    soundbox model status audiocpp

    It reports external (env) for the variable, or external (PATH) for a binary on PATH.

  3. Restart the server.

The prompt-assistant engine works the same way through MIRLI_LLAMA_SERVER_BIN; check it with soundbox model status llm. The order Mirli searches in is listed in Resolution order.

Choose a backend

Mirli detects a backend and falls back to CPU. To override the guess, or to compare backends:

  1. Set MIRLI_AUDIOCPP_BACKEND in the server's environment:

    Terminal
    export MIRLI_AUDIOCPP_BACKEND=cuda

    The values are cpu, cuda, vulkan, metal, hip and best.

  2. Restart the server.

  3. Check the device field of GET /api/health. It shows the backend in force.

soundbox model status audiocpp shows the detected backend and ignores this variable. The variable does not change which build is downloaded; for that, pass --backend to soundbox model install audiocpp.

What's next