fix: made the macos app smaller

This commit is contained in:
2026-07-18 10:20:54 +02:00
parent c77450d497
commit 593f1646a1
8 changed files with 166 additions and 32 deletions

18
mix.exs
View File

@@ -62,11 +62,21 @@ defmodule BDS.MixProject do
{:ex_ratatui, "~> 0.11"},
{:image, "~> 0.67"},
{:nx, "~> 0.10"},
{:exla, "~> 0.10"},
# Only one ML inference backend ships per platform; NIF releases are
# host-built, so the build OS is the target OS. EXLA (283 MB XLA CPU
# payload) never runs in the macOS app — EMLX always wins on Apple
# Silicon — but `runtime: false` alone can't exclude it there because
# the `image` dep declares exla as an optional application, which drags
# it into the release whenever it exists in the prod dep tree. Scoping
# it to dev/test on macOS keeps it fully out of macOS releases while
# Linux/Windows ship it as their production inference backend.
{:exla, "~> 0.10", if(macos?(), do: [only: [:dev, :test]], else: [])},
# Apple Silicon GPU (Metal) acceleration for embedding inference. Ships
# precompiled MLX binaries; the Neural backend prefers it on arm64 macOS
# and falls back to EXLA-CPU elsewhere (SPECGAPS A1-14c).
{:emlx, "~> 0.2.0"},
# and falls back to EXLA-CPU elsewhere (SPECGAPS A1-14c). Apple-only, so
# non-macOS releases exclude it (runtime: false deps stay out of
# releases — nothing pulls emlx in optionally, unlike exla above).
{:emlx, "~> 0.2.0", runtime: macos?()},
{:bumblebee, "~> 0.6.3"},
{:hnswlib, "~> 0.1.7"},
{:stemex, "~> 0.2.1"},
@@ -121,4 +131,6 @@ defmodule BDS.MixProject do
]
]
end
defp macos?, do: :os.type() == {:unix, :darwin}
end