Skip to content
Closed
239 changes: 156 additions & 83 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,76 +143,28 @@ jobs:
cmake -B llama.cpp/build -S llama.cpp \
-DGGML_METAL=OFF \
-DGGML_CUDA=OFF \
-DGGML_NATIVE=OFF \
-DGGML_RPC=ON \
-DBUILD_SHARED_LIBS=OFF \
-DLLAMA_OPENSSL=OFF \
"${CACHE_FLAGS[@]}"
cmake --build llama.cpp/build --config Release -j$(nproc) --target rpc-server llama-server llama-moe-split

# ── Download model ──
- name: Cache model
id: cache-model
uses: actions/cache@v5
with:
path: ~/.models/${{ env.MODEL_FILE }}
key: ${{ env.CACHE_NAMESPACE }}-${{ runner.os }}-model-${{ env.MODEL_FILE }}-${{ hashFiles('.github/cache-version.txt', '.github/workflows/ci.yml') }}

- name: Download model
if: steps.cache-model.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.models
curl -fSL "$MODEL_URL" -o ~/.models/$MODEL_FILE
ls -lh ~/.models/$MODEL_FILE

# ── Integration smoke test ──
- name: Smoke test (real inference)
- name: Package Linux binaries
run: |
scripts/ci-smoke-test.sh \
target/debug/mesh-llm \
llama.cpp/build/bin \
~/.models/$MODEL_FILE
mkdir -p ci-artifacts/linux-binaries
cp target/debug/mesh-llm ci-artifacts/linux-binaries/
cp llama.cpp/build/bin/rpc-server ci-artifacts/linux-binaries/
cp llama.cpp/build/bin/llama-server ci-artifacts/linux-binaries/
cp llama.cpp/build/bin/llama-moe-split ci-artifacts/linux-binaries/
tar -czf ci-artifacts/linux-binaries.tgz -C ci-artifacts linux-binaries
Comment thread
i386 marked this conversation as resolved.
Resolved

- name: OpenAI Python compat smoke
run: |
scripts/ci-compat-smoke.sh \
target/debug/mesh-llm \
llama.cpp/build/bin \
~/.models/$MODEL_FILE

- name: Split-mode test (host/worker routing)
run: |
scripts/ci-split-test.sh \
target/debug/mesh-llm \
llama.cpp/build/bin \
~/.models/$MODEL_FILE

# ── MoE split test ──
- name: Cache MoE model
id: cache-moe-model
uses: actions/cache@v5
- name: Upload Linux binaries
uses: actions/upload-artifact@v6
with:
path: ~/.models/${{ env.MOE_MODEL_FILE }}
key: ${{ env.CACHE_NAMESPACE }}-${{ runner.os }}-model-${{ env.MOE_MODEL_FILE }}-${{ hashFiles('.github/cache-version.txt', '.github/workflows/ci.yml') }}

- name: Download MoE model
if: steps.cache-moe-model.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.models
curl -fSL "$MOE_MODEL_URL" -o ~/.models/$MOE_MODEL_FILE
ls -lh ~/.models/$MOE_MODEL_FILE

- name: MoE split test (expert sharding)
run: |
scripts/ci-moe-split-test.sh \
llama.cpp/build/bin \
~/.models/$MOE_MODEL_FILE

- name: MoE mesh test (expert sharding end-to-end)
run: |
scripts/ci-moe-mesh-test.sh \
target/debug/mesh-llm \
llama.cpp/build/bin \
~/.models/$MOE_MODEL_FILE
name: linux-binaries
path: ci-artifacts/linux-binaries.tgz
if-no-files-found: error

- name: CLI smoke test
run: |
Expand Down Expand Up @@ -257,11 +209,6 @@ jobs:
workspaces: . -> target
prefix-key: ${{ env.CACHE_NAMESPACE }}-rust-${{ hashFiles('.github/cache-version.txt') }}

# Early-fail gate: runs before expensive compile/test work.
- name: Check formatting
working-directory: mesh-llm
run: cargo fmt -- --check

# See linux job for rationale on building in dev/debug, not release.
- name: Build mesh-llm binary (debug)
run: cargo build -p mesh-llm --bin mesh-llm
Expand All @@ -284,43 +231,130 @@ jobs:
fi
cmake -B llama.cpp/build -S llama.cpp \
-DGGML_METAL=OFF \
-DGGML_NATIVE=OFF \
-DGGML_RPC=ON \
-DBUILD_SHARED_LIBS=OFF \
-DLLAMA_OPENSSL=OFF \
"${CACHE_FLAGS[@]}"
cmake --build llama.cpp/build --config Release -j$(sysctl -n hw.ncpu) --target rpc-server llama-server llama-moe-split

# ── Download model ──
- name: Cache model
- name: Package macOS binaries
run: |
mkdir -p ci-artifacts/macos-binaries
cp target/debug/mesh-llm ci-artifacts/macos-binaries/
cp llama.cpp/build/bin/rpc-server ci-artifacts/macos-binaries/
cp llama.cpp/build/bin/llama-server ci-artifacts/macos-binaries/
cp llama.cpp/build/bin/llama-moe-split ci-artifacts/macos-binaries/ 2>/dev/null || true
cp llama.cpp/build/bin/*.dylib ci-artifacts/macos-binaries/ 2>/dev/null || true
shopt -s nullglob
Comment thread
i386 marked this conversation as resolved.
Resolved
metallibs=(target/release/build/mlx-sys-*/out/build/lib/mlx.metallib)
Comment thread
i386 marked this conversation as resolved.
Resolved
if [ "${#metallibs[@]}" -gt 0 ]; then
cp "${metallibs[0]}" ci-artifacts/macos-binaries/mlx.metallib
fi
Comment thread
i386 marked this conversation as resolved.
Resolved
tar -czf ci-artifacts/macos-binaries.tgz -C ci-artifacts macos-binaries

- name: Upload macOS binaries
uses: actions/upload-artifact@v6
with:
name: macos-binaries
path: ci-artifacts/macos-binaries.tgz
if-no-files-found: error

- name: CLI smoke test
run: |
target/debug/mesh-llm --version
target/debug/mesh-llm --help | head -5

- name: Client-auto boot test
run: scripts/ci-client-auto-test.sh target/debug/mesh-llm

- name: Show sccache stats
if: always()
run: sccache --show-stats || true

inference_smoke_tests:
needs: [changes, linux]
if: ${{ needs.linux.result == 'success' && (github.event_name == 'workflow_dispatch' || needs.changes.outputs.rust == 'true') }}
name: Inference Smoke Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- uses: actions/setup-node@v5
with:
node-version: 24
cache: npm
cache-dependency-path: |
.github/cache-version.txt
mesh-llm/ui/package-lock.json

- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: pip
cache-dependency-path: |
.github/cache-version.txt
ci/requirements-ci-python.txt

- name: Install Python SDKs
run: python -m pip install --upgrade pip -r ci/requirements-ci-python.txt

- name: Download Linux binaries
uses: actions/download-artifact@v7
with:
name: linux-binaries
path: ci-artifacts

- name: Extract Linux binaries
run: tar -xzf ci-artifacts/linux-binaries.tgz

- name: Stage binaries for inference smokes
run: |
mkdir -p target/debug llama.cpp/build/bin
cp linux-binaries/mesh-llm target/debug/mesh-llm
cp linux-binaries/rpc-server llama.cpp/build/bin/rpc-server
cp linux-binaries/llama-server llama.cpp/build/bin/llama-server
cp linux-binaries/llama-moe-split llama.cpp/build/bin/llama-moe-split
test -x target/debug/mesh-llm
test -x llama.cpp/build/bin/rpc-server
test -x llama.cpp/build/bin/llama-server
test -x llama.cpp/build/bin/llama-moe-split

- name: Cache integration model
id: cache-model
uses: actions/cache@v5
with:
path: ~/.models/${{ env.MODEL_FILE }}
key: ${{ env.CACHE_NAMESPACE }}-${{ runner.os }}-model-${{ env.MODEL_FILE }}-${{ hashFiles('.github/cache-version.txt', '.github/workflows/ci.yml') }}

- name: Download model
- name: Download integration model
if: steps.cache-model.outputs.cache-hit != 'true'
run: |
mkdir -p ~/.models
curl -fSL "$MODEL_URL" -o ~/.models/$MODEL_FILE
ls -lh ~/.models/$MODEL_FILE

# ── Integration smoke test ──
- name: Smoke test (real inference)
run: |
scripts/ci-smoke-test.sh \
target/debug/mesh-llm \
llama.cpp/build/bin \
~/.models/$MODEL_FILE

- name: OpenAI Python compat smoke
run: |
scripts/ci-compat-smoke.sh \
target/debug/mesh-llm \
llama.cpp/build/bin \
~/.models/$MODEL_FILE

- name: Split-mode test (host/worker routing)
run: |
scripts/ci-split-test.sh \
target/debug/mesh-llm \
llama.cpp/build/bin \
~/.models/$MODEL_FILE

# ── MoE split test ──
- name: Cache MoE model
id: cache-moe-model
uses: actions/cache@v5
Expand Down Expand Up @@ -348,18 +382,6 @@ jobs:
llama.cpp/build/bin \
~/.models/$MOE_MODEL_FILE

- name: CLI smoke test
run: |
target/debug/mesh-llm --version
target/debug/mesh-llm --help | head -5

- name: Client-auto boot test
run: scripts/ci-client-auto-test.sh target/debug/mesh-llm

- name: Show sccache stats
if: always()
run: sccache --show-stats || true

linux_cuda:
needs: changes
if: ${{ github.event_name == 'workflow_dispatch' || needs.changes.outputs.rust == 'true' }}
Expand Down Expand Up @@ -536,6 +558,23 @@ jobs:
target/debug/mesh-llm --version
target/debug/mesh-llm --help | head -5

- name: Package Linux CUDA binaries
shell: bash
run: |
mkdir -p ci-artifacts/linux-cuda-binaries
cp target/debug/mesh-llm ci-artifacts/linux-cuda-binaries/
cp llama.cpp/build/bin/rpc-server ci-artifacts/linux-cuda-binaries/
cp llama.cpp/build/bin/llama-server ci-artifacts/linux-cuda-binaries/
cp llama.cpp/build/bin/llama-moe-split ci-artifacts/linux-cuda-binaries/ 2>/dev/null || true

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cp llama.cpp/build/bin/llama-moe-split ... 2>/dev/null || true suppresses both stderr and the failure exit code, so a missing/failed llama-moe-split build will quietly produce an incomplete artifact. Prefer making this explicit: either fail fast if the binary is expected in this lane, or gate the copy with a clear if [[ -f ... ]] branch that logs that the binary is intentionally omitted (and consider reflecting that in the artifact name/content).

Suggested change
cp llama.cpp/build/bin/llama-moe-split ci-artifacts/linux-cuda-binaries/ 2>/dev/null || true
if [[ -f llama.cpp/build/bin/llama-moe-split ]]; then
cp llama.cpp/build/bin/llama-moe-split ci-artifacts/linux-cuda-binaries/
else
echo "INFO: llama-moe-split not present in this Linux CUDA build; omitting it from packaged artifacts."
fi

Copilot uses AI. Check for mistakes.
tar -czf ci-artifacts/linux-cuda-binaries.tgz -C ci-artifacts linux-cuda-binaries

- name: Upload Linux CUDA binaries
uses: actions/upload-artifact@v6
with:
name: linux-cuda-binaries
path: ci-artifacts/linux-cuda-binaries.tgz
if-no-files-found: error

- name: Show sccache stats
if: always()
run: sccache --show-stats || true
Expand Down Expand Up @@ -650,6 +689,23 @@ jobs:
target/release/mesh-llm --version
target/release/mesh-llm --help | head -5

- name: Package Linux ROCm binaries
shell: bash
run: |
mkdir -p ci-artifacts/linux-rocm-binaries
cp target/release/mesh-llm ci-artifacts/linux-rocm-binaries/
cp llama.cpp/build/bin/rpc-server ci-artifacts/linux-rocm-binaries/
cp llama.cpp/build/bin/llama-server ci-artifacts/linux-rocm-binaries/
cp llama.cpp/build/bin/llama-moe-split ci-artifacts/linux-rocm-binaries/ 2>/dev/null || true

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lane also suppresses errors when copying llama-moe-split (2>/dev/null || true), which can hide unexpected build regressions and upload an incomplete tarball. Prefer either requiring the binary (fail if missing) or conditionally including it with an explicit log message when absent.

Suggested change
cp llama.cpp/build/bin/llama-moe-split ci-artifacts/linux-rocm-binaries/ 2>/dev/null || true
if [[ -f llama.cpp/build/bin/llama-moe-split ]]; then
cp llama.cpp/build/bin/llama-moe-split ci-artifacts/linux-rocm-binaries/
else
echo "INFO: llama-moe-split not present in llama.cpp/build/bin; skipping optional binary"
fi

Copilot uses AI. Check for mistakes.
tar -czf ci-artifacts/linux-rocm-binaries.tgz -C ci-artifacts linux-rocm-binaries

- name: Upload Linux ROCm binaries
uses: actions/upload-artifact@v6
with:
name: linux-rocm-binaries
path: ci-artifacts/linux-rocm-binaries.tgz
if-no-files-found: error

- name: Show sccache stats
if: always()
run: sccache --show-stats || true
Expand Down Expand Up @@ -719,6 +775,23 @@ jobs:
target/release/mesh-llm --version
target/release/mesh-llm --help | head -5

- name: Package Linux Vulkan binaries
shell: bash
run: |
mkdir -p ci-artifacts/linux-vulkan-binaries
cp target/release/mesh-llm ci-artifacts/linux-vulkan-binaries/
cp llama.cpp/build/bin/rpc-server ci-artifacts/linux-vulkan-binaries/
cp llama.cpp/build/bin/llama-server ci-artifacts/linux-vulkan-binaries/
cp llama.cpp/build/bin/llama-moe-split ci-artifacts/linux-vulkan-binaries/ 2>/dev/null || true

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

llama-moe-split is copied with 2>/dev/null || true, which hides missing-binary errors and can result in a silently incomplete linux-vulkan-binaries.tgz. If the binary is optional here, make the omission explicit with a conditional + log; if it’s required, fail the step when it’s not present/executable.

Suggested change
cp llama.cpp/build/bin/llama-moe-split ci-artifacts/linux-vulkan-binaries/ 2>/dev/null || true
if [ -x llama.cpp/build/bin/llama-moe-split ]; then
cp llama.cpp/build/bin/llama-moe-split ci-artifacts/linux-vulkan-binaries/
echo "Included optional binary: llama-moe-split"
else
echo "Optional binary not found or not executable, skipping: llama.cpp/build/bin/llama-moe-split"
fi

Copilot uses AI. Check for mistakes.
tar -czf ci-artifacts/linux-vulkan-binaries.tgz -C ci-artifacts linux-vulkan-binaries

- name: Upload Linux Vulkan binaries
uses: actions/upload-artifact@v6
with:
name: linux-vulkan-binaries
path: ci-artifacts/linux-vulkan-binaries.tgz
if-no-files-found: error

- name: Show sccache stats
if: always()
run: sccache --show-stats || true
Expand Down
Loading
Loading