Native libraries for local AI tools can conflict when several tools share one environment. The community-maintained conda-forge package installs llama.cpp binaries in a named conda environment, keeping their dependencies separate from other projects.

A working conda installation on Windows, macOS, or Linux is required. The package is named llama.cpp, while its installed command-line programs include llama-cli and llama-server.

A conda-forge-only solve keeps the compiler runtime and supporting libraries in the same channel. A separate named environment also keeps these dependencies out of the base conda environment.

Steps to install llama.cpp in a conda environment:

  1. Install llama.cpp in a new environment named llama-cpp from conda-forge.
    $ conda create --yes --name llama-cpp --override-channels --channel conda-forge llama.cpp
    Channels:
     - conda-forge
    Platform: linux-aarch64
    ##### snipped #####
      environment location: /opt/conda/envs/llama-cpp
    ##### snipped #####
      llama.cpp          conda-forge/linux-aarch64::llama.cpp-11860-cpu_openblas_h10e8b54_0
    ##### snipped #####
    Executing transaction: ...working... done

    The llama.cpp value is the package name; llama-cpp is only the local environment name. The selected version and build vary by platform and available packages. A new environment name avoids changing packages in an existing project, and --override-channels applies only to this solve without changing saved channel settings.

  2. Confirm that conda recorded the package in the new environment.
    $ conda list --name llama-cpp llama.cpp
    # packages in environment at /opt/conda/envs/llama-cpp:
    #
    # Name                     Version          Build                    Channel
    llama.cpp                  11860            cpu_openblas_h10e8b54_0  conda-forge
  3. Verify that llama-cli starts from the environment.
    $ conda run --name llama-cpp llama-cli --version
    version: 0.7.0-dev (build 1, commit a553e84)
    built with GNU 15.3.0 for Linux aarch64
  4. Verify that llama-server starts from the same environment.
    $ conda run --name llama-cpp llama-server --version
    version: 0.7.0-dev (build 1, commit a553e84)
    built with GNU 15.3.0 for Linux aarch64

    Both commands should return a version and compiler line without a missing-library error. The package version and binary build number can differ. conda run --name llama-cpp selects the installed environment without activating it in the current shell. The package contains the binaries; model weights come from a separate GGUF file.
    Related: Run a local GGUF model with llama.cpp

Share this guide