Discover off-PATH native engine binaries via AIMA_ENGINE_DIR#80
Open
rjckkkkk wants to merge 1 commit into
Open
Discover off-PATH native engine binaries via AIMA_ENGINE_DIR#80rjckkkkk wants to merge 1 commit into
rjckkkkk wants to merge 1 commit into
Conversation
Engine scan only looked in ~/.aima/dist/{os-arch}/ and PATH for native
engine binaries, so engines installed in arbitrary dirs off the system
drive (e.g. Windows D:\tools\llama-b9180-win-hip-radeon-x64\llama-server.exe)
were invisible and `aima engine scan` returned [].
Add ScanOptions.ExtraDirs, fed from a new AIMA_ENGINE_DIR OS-path-list env
var (mirrors AIMA_MODEL_DIR), and extract scanDirForEngineBinaries so
distDir / extra dirs / PATH share one scan path with consistent dedup and
ID semantics. Once discovered, the existing local-engine overlay reinjects
the binary path as a preinstalled probe, so native deploy resolves the
absolute binary with no further changes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 8, 2026
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.
Problem
AIMA's engine scanner (
internal/engine/scanner.goScanNative) only enumerated~/.aima/dist/{os-arch}/andPATHfor native engine binaries. Engines pre-installed in arbitrary directories off the system drive — e.g. the Strix Halo rig's llama.cpp build atD:\tools\llama-b9180-win-hip-radeon-x64\llama-server.exe— are in neither, soaima engine scan/engine listreturned[]and no native engine could be deployed.This is the engine-side analogue of the model-scan gap fixed in #79.
Fix
ScanOptions.ExtraDirs, populated from a newAIMA_ENGINE_DIROS-path-list env var incmd/aima/main.go(scanEnginesCore), mirroringAIMA_MODEL_DIR.scanDirForEngineBinariesso distDir / extra dirs / PATH share one flat-scan path with consistent dedup + ID semantics (dir-salted IDs for non-dist dirs).source.binary/ profilestartup.command[0]).Once a pre-installed binary is discovered, the existing local-engine overlay (
cmd/aima/resolve.go) reinjects its path as apreinstalledprobe →BinarySource.ProbePaths→ native runtime resolves the absolute binary. So this scan change alone unblocks native deploy end-to-end.Test
TestScanNativeFindsBinaryInExtraDirs.AIMA_ENGINE_DIR=D:\tools\llama-b9180-win-hip-radeon-x64,aima engine scanregisters thellamacppnative engine, andaima deploy Qwen3.5-9B-Q4_K_M --engine llamacppstartsllama-serveron the iGPU (all layers offloaded), serving the OpenAI API at ~33 t/s decode.🤖 Generated with Claude Code