Skip to content

Discover off-PATH native engine binaries via AIMA_ENGINE_DIR#80

Open
rjckkkkk wants to merge 1 commit into
developfrom
fix/windows-engine-scan-discovery
Open

Discover off-PATH native engine binaries via AIMA_ENGINE_DIR#80
rjckkkkk wants to merge 1 commit into
developfrom
fix/windows-engine-scan-discovery

Conversation

@rjckkkkk

@rjckkkkk rjckkkkk commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Problem

AIMA's engine scanner (internal/engine/scanner.go ScanNative) only enumerated ~/.aima/dist/{os-arch}/ and PATH for native engine binaries. Engines pre-installed in arbitrary directories off the system drive — e.g. the Strix Halo rig's llama.cpp build at D:\tools\llama-b9180-win-hip-radeon-x64\llama-server.exe — are in neither, so aima engine scan / engine list returned [] and no native engine could be deployed.

This is the engine-side analogue of the model-scan gap fixed in #79.

Fix

  • Add ScanOptions.ExtraDirs, populated from a new AIMA_ENGINE_DIR OS-path-list env var in cmd/aima/main.go (scanEnginesCore), mirroring AIMA_MODEL_DIR.
  • Extract scanDirForEngineBinaries so distDir / extra dirs / PATH share one flat-scan path with consistent dedup + ID semantics (dir-salted IDs for non-dist dirs).
  • No new engine/model branches (INV-1): binary names still come from YAML (source.binary / profile startup.command[0]).

Once a pre-installed binary is discovered, the existing local-engine overlay (cmd/aima/resolve.go) reinjects its path as a preinstalled probe → BinarySource.ProbePaths → native runtime resolves the absolute binary. So this scan change alone unblocks native deploy end-to-end.

Test

  • New unit test TestScanNativeFindsBinaryInExtraDirs.
  • Verified on the AMD Strix Halo (Radeon 8060S) Windows rig: with AIMA_ENGINE_DIR=D:\tools\llama-b9180-win-hip-radeon-x64, aima engine scan registers the llamacpp native engine, and aima deploy Qwen3.5-9B-Q4_K_M --engine llamacpp starts llama-server on the iGPU (all layers offloaded), serving the OpenAI API at ~33 t/s decode.

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant