Let Lemonade auto-select its llama.cpp backend - #3
Closed
rominf wants to merge 1 commit into
Closed
Conversation
The Lemonade adapter forced `lemonade load --llamacpp rocm` with no fallback. On GPUs the bundled ROCm build does not support (e.g. the Radeon 780M / gfx1103 iGPU), Lemonade reports `llamacpp:rocm` as "Unsupported GPU", so every managed load returned a body-less 500 and spun in a load/evict/unload loop. Standalone Lemonade serves the same model fine because it falls back to Vulkan. Now query `lemonade backends`, choose the best supported llama.cpp backend (rocm > vulkan > cpu), install it on demand, and load with it instead of hardcoding rocm. The backend is resolved at install and re-resolved at serve time, so existing installs self-heal without a reinstall. Verification, state, and adapter messaging follow the selected backend rather than assuming rocm. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lemonade load --llamacpp rocmwith no fallback. On GPUs the bundled ROCm build does not support (e.g. the Radeon 780M / gfx1103 iGPU), Lemonade reportsllamacpp:rocmas "Unsupported GPU", so every managed load returned a body-less 500 and spun in a load/evict/unload loop. Standalone Lemonade serves the same model because it falls back to Vulkan.lemonade backends, pick the best supported llama.cpp backend (rocm>vulkan>cpu), install it on demand, and load with it instead of hardcoding rocm.Changes (
engines/lemonade/src/lib.rs)run_lemonade_backends_list+parse_llamacpp_backend_statusesparse thelemonade backendstable for thellamacpprecipe.select_best_llamacpp_backendchooses the highest-priority supported backend (LLAMACPP_BACKEND_PRIORITY).ensure_best_llamacpp_backendinstalls the chosen backend if needed; used by both install (install_best_llamacpp_backend) andserve_http.lemonade_model_load_args/run_lemonade_model_loadpass the selected backend;--forcedropped from backend install so only supported backends install.health_has_loaded_model/lemonade_backend_matches), state fields, and detect/install/resolve copy reflect the selected backend.Test plan
cargo test -p rocm-engine-lemonade(15 passing, incl. new parser/selection tests)cargo build --release -p rocmInstalling backend: llamacpp:vulkan,Using LlamaCpp Backend: vulkan, model loaded onAMD Radeon 780M Graphics, chat smoke200 OK(~10.5 tok/s);services listreportsready.🤖 Generated with Claude Code