[Bug]: llama.cpp not detected when installed as the single llama binary (llama.cpp 0.5.0)
Bug description
Newer llama.cpp releases ship one llama binary with subcommands (llama serve, llama cli, …) instead of separate llama-server / llama-cli executables. llmfit only looks for the old names, so it reports llama.cpp as not installed even when it is on PATH.
The lookup is in llmfit-core/src/providers.rs. LlamaCppProvider::default() calls find_binary("llama-cli") and find_binary("llama-server"). find_binary checks the --llama-cpp-path override, LLAMA_CPP_PATH, /usr/local/bin, /opt/llama.cpp/build/bin, ~/.local/bin and finally PATH, but only ever for those two exact names.
Setting LLAMA_CPP_PATH or --llama-cpp-path to the directory that holds llama doesn't help, because llama-server and llama-cli still don't exist there. A symlink named llama-server doesn't work either: the binary doesn't pick its mode from the name it was called by, so llama-server --help just prints the list of subcommands.
I'm happy to send a PR for this.
Expected behavior
llmfit detects the unified llama binary and treats it as a llama.cpp runtime. For llmfit run it calls llama serve … / llama cli … in place of llama-server … / llama-cli ….
Actual behavior
The llama.cpp runtime shows as not available ("not in PATH, set LLAMA_CPP_PATH"). The only way it gets detected is through the health probe, and only if a server is already running on LLAMA_SERVER_PORT (default 8080).
Steps to reproduce
- Install a llama.cpp release that ships the unified binary (here: version: 0.4.1-dev (build 11046, commit 60081bb2b)) to ~/.local/bin/llama.
- Make sure ~/.local/bin is on PATH and llama --help lists serve / cli.
- Optionally set LLAMA_CPP_PATH=~/.local/bin.
- Run llmfit: llama.cpp is not detected.
llmfit version
1.1.16 (Homebrew), and the current main has the same code path
Diagnostic report (llmfit doctor)
# llmfit doctor report
Paste this whole report into a GitHub issue at https://github.com/AlexsJones/llmfit/issues — the raw tool output below is what lets detection bugs become regression tests. It contains hardware model names and driver info only.
- llmfit version: 1.1.16
- OS: macos (aarch64)
## Detected by llmfit
SystemSpecs {
total_ram_gb: 24.0,
available_ram_gb: 19.248382568359375,
total_cpu_cores: 8,
cpu_name: "Apple M3",
has_gpu: true,
gpu_vram_gb: Some(
24.0,
),
total_gpu_vram_gb: Some(
24.0,
),
gpu_available_gb: Some(
17.760009765625,
),
gpu_name: Some(
"Apple M3",
),
gpu_count: 1,
unified_memory: true,
backend: Metal,
gpus: [
GpuInfo {
name: "Apple M3",
vram_gb: Some(
24.0,
),
backend: Metal,
count: 1,
unified_memory: true,
free_vram_gb: None,
},
],
cluster_mode: false,
cluster_node_count: 0,
}
## nvidia-smi (extended query)
(not available: No such file or directory (os error 2))
## nvidia-smi (standard query)
(not available: No such file or directory (os error 2))
## rocm-smi --showmeminfo vram
(not available: No such file or directory (os error 2))
## rocm-smi --showproductname
(not available: No such file or directory (os error 2))
## system_profiler SPDisplaysDataType
Graphics/Displays:
Apple M3:
Chipset Model: Apple M3
Type: GPU
Bus: Built-In
Total Number of Cores: 10
Vendor: Apple (0x106b)
Metal Support: Metal 4
Displays:
Color LCD:
Display Type: Built-in Liquid Retina Display
Resolution: 2560 x 1664 Retina
Main Display: Yes
Mirror: Off
Online: Yes
Automatically Adjust Brightness: Yes
Connection Type: Internal
## vulkaninfo --summary
(not available: No such file or directory (os error 2))
## npu-smi info
(not available: No such file or directory (os error 2))
## Provider app installs
LM Studio installed: false
Docker Desktop installed: false
ollama on PATH: falsellmfit version
llmfit 1.1.16 (Homebrew)
Operating system
macOS (Apple Silicon)
Affected component
Provider detection (Ollama, llama.cpp, MLX, Docker)
Mode used
TUI (default)
GPU details (if relevant)
Additional context
Suggested fix: if neither llama-server nor llama-cli is found, fall back to find_binary("llama") using the same search order. When that matches, record that it's the unified binary and add the serve / cli subcommand in front of the arguments when launching. It would probably be worth checking that the binary really is the unified one first, e.g. that llama --help lists serve, since llama is a very generic name to find on PATH.
Related: #295 (added --llama-cpp-path) and #178 (PATH detection on Windows).
Source: AlexsJones/llmfit