feat(mac-launcher): auto-discover an mlx_lm-capable Python (no manual KAKEYA_MAC_PYTHON)#156
Merged
cursor[bot] merged 1 commit intoJun 19, 2026
Conversation
… KAKEYA_MAC_PYTHON needed)
After a reboot / in a fresh shell the bare 'python3' is often the system/pyenv
one without mlx_lm, so the launcher's preflight failed ('mlx/mlx_lm not
importable by python3'). Now the launcher tries KAKEYA_MAC_PYTHON -> repo
.venv-mac -> ~/kakeya-venv -> ~/.venv -> python3.13 -> python3 and picks the
FIRST that can 'import mlx_lm' (logs which). Only fails fast (with the searched
candidates listed) when none exists. bash 3.2-safe.
Co-authored-by: FluffyAIcode <FluffyAIcode@users.noreply.github.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.
Why
After the merge,
bash scripts/run_kakeya_mac.shfailed withmlx/mlx_lm not importable by python3 — set KAKEYA_MAC_PYTHON. That's the #150 preflight working as designed (fail fast instead of a deepModuleNotFoundError), but it's friction: a barepython3in a fresh shell / after a reboot is often the system/pyenv one withoutmlx_lm, even though a venv with it exists.Fix
The launcher now auto-discovers the interpreter: it tries
KAKEYA_MAC_PYTHON→<repo>/.venv-mac→~/kakeya-venv→~/.venv→python3.13→python3, and picks the first that canimport mlx_lm(logs which one). It only fails fast — now listing the searched candidates — when none hasmlx_lm. bash-3.2 safe.Validation (Mac M4)
mlx-kakeya-launcher-dryrun-bash32(runs/bin/bash run_kakeya_mac.sh --dry-run) on the runner: auto-discovery resolved to…/.venv-mac/bin/python3.13(the venv that hasmlx_lm) and the dry-run printed the command with it. Locally: a fakemlx_lmpython is picked; with none available the preflight fails cleanly with the actionable message (no crash).Testing
bash -n scripts/run_kakeya_mac.sh; local discovery + clean-failure testspytest tests/inference_engine/bridge/test_manifest.pyNote: if your venv lives in a non-standard path the candidates don't cover (e.g. a different checkout dir), set
KAKEYA_MAC_PYTHON=/path/to/venv/bin/pythononce — discovery prefers it.