Learn R Programming

localLLM (version 1.3.0)

install_localLLM: Install localLLM Backend Library

Description

This function downloads and installs the pre-compiled C++ backend library required for the localLLM package to function.

Usage

install_localLLM(force_cpu = FALSE, force_reinstall = FALSE)

Value

Returns NULL invisibly. Called for side effects.

Arguments

force_cpu

Logical. If TRUE, always download the CPU-only build even when a GPU is detected. Default FALSE.

force_reinstall

Logical. If TRUE, remove any existing installation and re-download. Useful for switching from a CPU build to a GPU build after installing a GPU driver. Default FALSE.

Details

This function downloads platform-specific pre-compiled binaries from GitHub releases. The backend library is stored in the user's data directory and loaded at runtime. Internet connection is required for the initial download.

On Windows and Linux, GPU support is auto-detected: if a Vulkan-capable GPU driver is found, the GPU-accelerated build is downloaded automatically. Use force_cpu = TRUE to override this and install the CPU build instead.

macOS always downloads the Metal-enabled build (both Apple Silicon and Intel).

See Also

lib_is_installed, get_lib_path

Examples

Run this code
if (FALSE) {
# Standard install (auto-detects GPU)
install_localLLM()

# Force CPU build
install_localLLM(force_cpu = TRUE)

# Reinstall after adding a GPU driver
install_localLLM(force_reinstall = TRUE)
}

Run the code above in your browser using DataLab