Skip to main content

Module llama_cpp

Module llama_cpp 

Source
Expand description

llama.cpp-turboquant-hip installer — native Rust CMake source build.

Clones the private fork scooter-lacroix/llama.cpp-turboquant-hip, builds with HIP/ROCm CMake flags per channel policy, and installs binaries to ~/.mlstack/components/llama-cpp/bin/.

§Detection Contract

Detection and verification both operate on the same binary contract: llama-cli --help must succeed (exit code 0). This ensures:

  • Partial clone artifacts do not count as installed
  • Broken executables do not count as installed
  • Detection and verification use the same executable

§ROCm Channel Policy

ChannelGPU TargetsWMMA FANotes
Legacygfx1030NoRDNA2 only
Stablegfx1030;gfx1100;gfx1101YesRDNA2+RDNA3
Latestgfx1030;gfx1100;gfx1101;gfx1200YesRDNA2+RDNA3+RDNA4

§Validation Assertions

  • VAL-INTEGRATION-002: Native installer route accepts llama-cpp
  • VAL-INTEGRATION-003: Installed detection succeeds with functional command
  • VAL-INTEGRATION-004: Installed detection fails when command is absent
  • VAL-INTEGRATION-005: Broken executable does not count as installed
  • VAL-INTEGRATION-006: Partial filesystem artifacts do not count as success
  • VAL-CROSS-001: Channel selection determines llama.cpp build flags
  • VAL-CROSS-003: Install path and detection strategy are consistent
  • VAL-CROSS-012: Detection and verification operate on the same binary contract

Structs§

LlamaCppConfig
Configuration for the llama.cpp installer.
LlamaCppInstaller
The llama.cpp installer.
PostInstallVerification
Result of stronger-than—help post-install verification.
PrebuiltInstallPlan
ReleaseArchs
ReleaseAsset
ReleaseManifest
ShellCommand
A constructed shell command.
SourceInstallPlan

Enums§

HipArchs
GPU architecture specification for HIP builds.
InstallStrategy
RocmChannel
ROCm channel for CMake flag selection.

Constants§

DETECTION_BINARY
The primary detection binary.
DETECTION_SUBCOMMAND
The detection subcommand that must succeed for installed status.

Functions§

ensure_default_gguf_model
Ensure the canonical verification/benchmark GGUF model exists at ~/.mlstack/models/<FILENAME>, downloading it from the canonical URL if absent. Shared by the llama.cpp installer verification AND the benchmark runner so there is one download path and one model URL. Validates with is_gguf and removes any corrupt/error file left behind. curl -s keeps it silent so it does not corrupt the TUI’s alternate screen.
has_partial_artifacts
Check if partial artifacts exist (clone/build dirs) without a functional binary.
is_llama_cli_functional
Check if the llama-cli binary is functional at the expected install path.
is_llama_cli_on_path
Check if llama-cli is on PATH and functional.
resolve_install_bin_dir
Resolve the install bin directory for llama-cpp.
verify_installed_binary