Skip to content

Commit ede8ddb

Browse files
Sprout × mesh-llm: in-process mesh node (serve/consume) + relay admission (#798)
1 parent 6481428 commit ede8ddb

48 files changed

Lines changed: 14292 additions & 695 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,52 @@ jobs:
479479
touch "desktop/src-tauri/binaries/sprout-dev-mcp-$TARGET"
480480
touch "desktop/src-tauri/binaries/git-credential-nostr-$TARGET"
481481
touch "desktop/src-tauri/binaries/sprout-$TARGET"
482+
# Mesh rev is derived from Cargo.lock so a dependency bump needs no
483+
# lockstep edit here; the cache key tracks it automatically.
484+
- name: Resolve mesh-llm rev
485+
id: mesh_rev
486+
run: |
487+
set -euo pipefail
488+
REV=$(grep -oE 'mesh-llm\.git\?rev=[0-9a-f]{40}' Cargo.lock | head -1 | grep -oE '[0-9a-f]{40}')
489+
[[ -n "$REV" ]] || { echo "::error::could not resolve mesh-llm rev from Cargo.lock"; exit 1; }
490+
echo "rev=$REV" >> "$GITHUB_OUTPUT"
491+
echo "short=${REV:0:7}" >> "$GITHUB_OUTPUT"
492+
- name: Restore mesh llama build cache
493+
id: llama_cache
494+
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
495+
with:
496+
path: ${{ github.workspace }}/.cache/mesh-llama
497+
key: mesh-llama-${{ runner.os }}-metal-${{ steps.mesh_rev.outputs.rev }}
498+
- name: Build mesh llama native libraries
499+
if: steps.llama_cache.outputs.cache-hit != 'true'
500+
env:
501+
MESH_REV_SHORT: ${{ steps.mesh_rev.outputs.short }}
502+
run: |
503+
set -euo pipefail
504+
cargo fetch --manifest-path desktop/src-tauri/Cargo.toml
505+
SHORT="$MESH_REV_SHORT"
506+
MESH_ROOT=$(find "${CARGO_HOME:-$HOME/.cargo}/git/checkouts" -path "*/$SHORT" -type d -name "$SHORT" | head -1)
507+
if [[ -z "$MESH_ROOT" ]]; then
508+
echo "::error::mesh-llm checkout for $SHORT not found after cargo fetch"
509+
exit 1
510+
fi
511+
export LLAMA_STAGE_BACKEND=metal
512+
export LLAMA_STAGE_BUILD_DIR="$GITHUB_WORKSPACE/.cache/mesh-llama/build-stage-abi-metal"
513+
export CMAKE_OSX_DEPLOYMENT_TARGET=10.15
514+
"$MESH_ROOT/scripts/prepare-llama.sh" pinned
515+
"$MESH_ROOT/scripts/build-llama.sh" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
516+
- name: Save mesh llama build cache
517+
if: steps.llama_cache.outputs.cache-hit != 'true'
518+
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
519+
with:
520+
path: ${{ github.workspace }}/.cache/mesh-llama
521+
key: mesh-llama-${{ runner.os }}-metal-${{ steps.mesh_rev.outputs.rev }}
482522
- name: Build Tauri app
483523
run: cd desktop && pnpm tauri build
484524
env:
485525
CMAKE_POLICY_VERSION_MINIMUM: "3.5"
526+
MACOSX_DEPLOYMENT_TARGET: "10.15"
527+
CMAKE_OSX_DEPLOYMENT_TARGET: "10.15"
528+
LLAMA_STAGE_BACKEND: metal
529+
LLAMA_STAGE_BUILD_DIR: ${{ github.workspace }}/.cache/mesh-llama/build-stage-abi-metal
530+
SKIPPY_LLAMA_AUTO_BUILD: "0"

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,46 @@ jobs:
7575
cargo build --release -p sprout-acp -p sprout-mcp -p sprout-agent -p sprout-dev-mcp -p git-credential-nostr -p sprout-cli
7676
./scripts/bundle-sidecars.sh
7777
78+
# Mesh rev derived from Cargo.lock (no lockstep edit on dep bump); cache key tracks it.
79+
- name: Resolve mesh-llm rev
80+
id: mesh_rev
81+
run: |
82+
set -euo pipefail
83+
REV=$(grep -oE 'mesh-llm\.git\?rev=[0-9a-f]{40}' Cargo.lock | head -1 | grep -oE '[0-9a-f]{40}')
84+
[[ -n "$REV" ]] || { echo "::error::could not resolve mesh-llm rev from Cargo.lock"; exit 1; }
85+
echo "rev=$REV" >> "$GITHUB_OUTPUT"
86+
echo "short=${REV:0:7}" >> "$GITHUB_OUTPUT"
87+
- name: Restore mesh llama build cache
88+
id: llama_cache
89+
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
90+
with:
91+
path: ${{ github.workspace }}/.cache/mesh-llama
92+
key: mesh-llama-${{ runner.os }}-metal-${{ steps.mesh_rev.outputs.rev }}
93+
- name: Build mesh llama native libraries
94+
if: steps.llama_cache.outputs.cache-hit != 'true'
95+
env:
96+
MESH_REV_SHORT: ${{ steps.mesh_rev.outputs.short }}
97+
run: |
98+
set -euo pipefail
99+
cargo fetch --manifest-path desktop/src-tauri/Cargo.toml
100+
SHORT="$MESH_REV_SHORT"
101+
MESH_ROOT=$(find "${CARGO_HOME:-$HOME/.cargo}/git/checkouts" -path "*/$SHORT" -type d -name "$SHORT" | head -1)
102+
if [[ -z "$MESH_ROOT" ]]; then
103+
echo "::error::mesh-llm checkout for $SHORT not found after cargo fetch"
104+
exit 1
105+
fi
106+
export LLAMA_STAGE_BACKEND=metal
107+
export LLAMA_STAGE_BUILD_DIR="$GITHUB_WORKSPACE/.cache/mesh-llama/build-stage-abi-metal"
108+
export CMAKE_OSX_DEPLOYMENT_TARGET=10.15
109+
"$MESH_ROOT/scripts/prepare-llama.sh" pinned
110+
"$MESH_ROOT/scripts/build-llama.sh" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
111+
- name: Save mesh llama build cache
112+
if: steps.llama_cache.outputs.cache-hit != 'true'
113+
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
114+
with:
115+
path: ${{ github.workspace }}/.cache/mesh-llama
116+
key: mesh-llama-${{ runner.os }}-metal-${{ steps.mesh_rev.outputs.rev }}
117+
78118
- name: Build unsigned Tauri app
79119
run: cd desktop && pnpm tauri build --verbose --no-sign --config src-tauri/tauri.release.conf.json
80120
env:
@@ -83,6 +123,11 @@ jobs:
83123
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
84124
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
85125
CMAKE_POLICY_VERSION_MINIMUM: "3.5"
126+
MACOSX_DEPLOYMENT_TARGET: "10.15"
127+
CMAKE_OSX_DEPLOYMENT_TARGET: "10.15"
128+
LLAMA_STAGE_BACKEND: metal
129+
LLAMA_STAGE_BUILD_DIR: ${{ github.workspace }}/.cache/mesh-llama/build-stage-abi-metal
130+
SKIPPY_LLAMA_AUTO_BUILD: "0"
86131

87132
- name: Locate unsigned DMG
88133
id: unsigned

0 commit comments

Comments
 (0)