feat: add --llama-cpp-path global CLI flag mirroring LLAMA_CPP_PATH env var#583
feat: add --llama-cpp-path global CLI flag mirroring LLAMA_CPP_PATH env var#583mvanhorn wants to merge 1 commit into
Conversation
b042330 to
61348e6
Compare
three-foxes-in-a-trenchcoat
left a comment
There was a problem hiding this comment.
Flag itself is good. Two things to fix before this lands, inline.
| let specs = detect_specs(&overrides); | ||
| if cli.json { | ||
| display::display_json_system(&specs); | ||
| if llama_cpp_path_configured { |
There was a problem hiding this comment.
This makes the --json system output schema depend on whether --llama-cpp-path was passed. Two scripts running the same --json system will see different shapes based on flag presence, which is a surprising contract. The flag's job is setting an env var. If we want a providers block in the JSON, always include it, or add an explicit --providers flag. Right now this looks reverse-engineered from what the test needs to observe.
| return false; | ||
| }; | ||
|
|
||
| if path.is_dir() { |
There was a problem hiding this comment.
Silently dropping the flag when the directory does not exist is a footgun. Typo the path and you get no signal, just the wrong llama.cpp picked up later. Warn to stderr, or exit non-zero. The test asserting silent ignore is baking in the wrong contract.
Summary
Add a global
--llama-cpp-pathCLI flag that mirrors the existingLLAMA_CPP_PATHenv var. Requested by @NTShop in issue #295.Why this matters
LLAMA_CPP_PATHalready exists for users who keep llama.cpp in a non-standard location. A matching CLI flag is more discoverable than an env var and is the usual ergonomic for one-shot overrides ("just this run, point at my custom build").Changes
In
llmfit-tui/src/main.rs, added--llama-cpp-pathas a global flag onCli. When present, the value is exported toLLAMA_CPP_PATHearly inmain(), before the binary lookup runs, so the existingfind_binarychain inllmfit-core/src/providers.rs:1346picks it up without any further plumbing.No change to the env-var behavior; the flag stacks on top.
Testing
llmfit-tui/tests/cli_smoke.rscovers the flag-present case (env var set, lookup uses provided path) and the flag-absent case (existing env var behavior unchanged). README updated to mention the new flag alongside the env var.Closes #295
AI was used for assistance.