#!/bin/zsh set -euo pipefail support_root=${0:A:h} model_root=${support_root:h} app_resources=${OMLX_APP_RESOURCES:-/Applications/oMLX.app/Contents/Resources} python_root=$app_resources/Python cpython_root=$python_root/cpython-3.11 mlx_site=$python_root/framework-mlx-base/lib/python3.11/site-packages mlx_runtime=${OMLX_MLX_RUNTIME:-$model_root/.mlx-runtime} if [[ ! -d "$mlx_runtime/mlx" ]]; then print -u2 "MLX 0.32.1 is missing from $mlx_runtime" print -u2 "Install it with: uv pip install --target $mlx_runtime mlx==0.32.1 mlx-metal==0.32.1" exit 1 fi export PYTHONHOME=$cpython_root export PYTHONDONTWRITEBYTECODE=1 export PYTHONPATH="$support_root:$mlx_runtime:$app_resources:$mlx_site" exec "$cpython_root/bin/python3" "$@"