Stage 2: Native dependencies
Attach the two native dependencies to their owning modules: vendored jinja_cpp built from source for chat, and Homebrew mlx-c plus Apple frameworks for mlxbridge. C linking is per-module so consumers inherit transitively; no other module touches native deps directly.
Epic: #1
Depends on: Stage 1 (modules must exist to attach native deps)
Phase 2.1: Vendor jinja_cpp
Note (evaluated 2026-07-05): google/minja was considered as an alternative and rejected. The vendored jinja_cpp IS minja's successor: llama.cpp replaced minja with this engine in Jan 2026 (PR #18462) and actively maintains it, while minja's primary author left Google and its README warns about maintenance status. Keeping jinja_cpp also preserves the existing 3-function C API and format-corpus validation.
Phase 2.2: Homebrew mlx gates
Acceptance
vendor/jinja_cpp builds from source with no prebuilt artifacts checked in
- Missing or outdated brew mlx/mlx-c fails configuration with an actionable error message
Stage 2: Native dependencies
Attach the two native dependencies to their owning modules: vendored jinja_cpp built from source for
chat, and Homebrew mlx-c plus Apple frameworks formlxbridge. C linking is per-module so consumers inherit transitively; no other module touches native deps directly.Epic: #1
Depends on: Stage 1 (modules must exist to attach native deps)
Phase 2.1: Vendor jinja_cpp
mlx-serve/lib/jinja_cppintovendor/jinja_cpp/(sources only, no prebuiltlibjinja.a)-std=c++17inbuild.zigand attach them to thechatmodule only, so consumers inherit the link transitivelychatcompiles and links against jinja_cpp via one trivial extern call exercised in a test blockvendor/jinja_cpp/README.md: the engine is llama.cpp's in-tree Jinja engine (common/jinja/, introduced in implement new jinja template engine ggml-org/llama.cpp#18462, the PR that replaced minja), plus mlx-serve's C wrapper (jinja_wrapper.{h,cpp}); note the upstream path so fixes can be syncedPhase 2.2: Homebrew mlx gates
build.zig: requiremlx-c>= 0.6.0 andmlx>= 0.31.2, fail configuration with a clear actionable message when missing or outdatedmlx-cplus Metal/Foundation/IOKit/CoreFoundation frameworks to themlxbridgemodule only (per-modulelinkSystemLibrary/framework attachment)mlxbridgedeclares one trivial mlx-c extern and a gated test proves the symbol resolves at link timeAcceptance
vendor/jinja_cppbuilds from source with no prebuilt artifacts checked in