Squashed 'vendor/ruvector/' content from commit b64c2172
git-subtree-dir: vendor/ruvector git-subtree-split: b64c21726f2bb37286d9ee36a7869fef60cc6900
This commit is contained in:
159
examples/ruvLLM/esp32-flash/.github/workflows/release-binaries.yml
vendored
Normal file
159
examples/ruvLLM/esp32-flash/.github/workflows/release-binaries.yml
vendored
Normal file
@@ -0,0 +1,159 @@
|
||||
name: Release Pre-built Binaries
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'ruvllm-esp32-v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version to release (e.g., 0.2.1)'
|
||||
required: true
|
||||
default: '0.2.1'
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build-firmware:
|
||||
name: Build ${{ matrix.target }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- target: esp32
|
||||
rust_target: xtensa-esp32-espidf
|
||||
features: ""
|
||||
- target: esp32s2
|
||||
rust_target: xtensa-esp32s2-espidf
|
||||
features: ""
|
||||
- target: esp32s3
|
||||
rust_target: xtensa-esp32s3-espidf
|
||||
features: ""
|
||||
- target: esp32c3
|
||||
rust_target: riscv32imc-esp-espidf
|
||||
features: ""
|
||||
- target: esp32c6
|
||||
rust_target: riscv32imac-esp-espidf
|
||||
features: ""
|
||||
# Federation-enabled builds
|
||||
- target: esp32s3-federation
|
||||
rust_target: xtensa-esp32s3-espidf
|
||||
features: "federation"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-action@stable
|
||||
|
||||
- name: Install ESP toolchain
|
||||
run: |
|
||||
curl -L https://github.com/esp-rs/espup/releases/latest/download/espup-x86_64-unknown-linux-gnu -o espup
|
||||
chmod +x espup
|
||||
./espup install
|
||||
source ~/export-esp.sh
|
||||
|
||||
- name: Install ldproxy
|
||||
run: cargo install ldproxy
|
||||
|
||||
- name: Build firmware
|
||||
working-directory: examples/ruvLLM/esp32-flash
|
||||
run: |
|
||||
source ~/export-esp.sh
|
||||
if [ -n "${{ matrix.features }}" ]; then
|
||||
cargo build --release --target ${{ matrix.rust_target }} --features ${{ matrix.features }}
|
||||
else
|
||||
cargo build --release --target ${{ matrix.rust_target }}
|
||||
fi
|
||||
|
||||
- name: Create binary package
|
||||
working-directory: examples/ruvLLM/esp32-flash
|
||||
run: |
|
||||
mkdir -p dist
|
||||
# Find the built binary
|
||||
BINARY=$(find target/${{ matrix.rust_target }}/release -maxdepth 1 -name "ruvllm-esp32*" -type f ! -name "*.d" | head -1)
|
||||
if [ -f "$BINARY" ]; then
|
||||
cp "$BINARY" dist/ruvllm-esp32-${{ matrix.target }}
|
||||
fi
|
||||
# Create flash script
|
||||
cat > dist/flash-${{ matrix.target }}.sh << 'EOF'
|
||||
#!/bin/bash
|
||||
PORT=${1:-/dev/ttyUSB0}
|
||||
espflash flash --monitor --port $PORT ruvllm-esp32-${{ matrix.target }}
|
||||
EOF
|
||||
chmod +x dist/flash-${{ matrix.target }}.sh
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ruvllm-esp32-${{ matrix.target }}
|
||||
path: examples/ruvLLM/esp32-flash/dist/
|
||||
|
||||
create-release:
|
||||
name: Create Release
|
||||
needs: build-firmware
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: binaries
|
||||
merge-multiple: true
|
||||
|
||||
- name: Create release archive
|
||||
run: |
|
||||
cd binaries
|
||||
# Create combined archive
|
||||
tar -czvf ruvllm-esp32-all-targets.tar.gz *
|
||||
# Create individual zips
|
||||
for dir in */; do
|
||||
target=$(basename "$dir")
|
||||
zip -r "ruvllm-esp32-${target}.zip" "$dir"
|
||||
done
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
files: |
|
||||
binaries/*.tar.gz
|
||||
binaries/*.zip
|
||||
body: |
|
||||
## RuvLLM ESP32 Pre-built Binaries
|
||||
|
||||
Download the firmware for your ESP32 variant and flash directly - no Rust toolchain required!
|
||||
|
||||
### Quick Flash
|
||||
|
||||
```bash
|
||||
# Download and extract
|
||||
tar -xzf ruvllm-esp32-all-targets.tar.gz
|
||||
|
||||
# Flash (Linux/macOS)
|
||||
./flash-esp32s3.sh /dev/ttyUSB0
|
||||
|
||||
# Or use espflash directly
|
||||
espflash flash --monitor ruvllm-esp32-esp32s3
|
||||
```
|
||||
|
||||
### Available Binaries
|
||||
|
||||
| File | Target | Features |
|
||||
|------|--------|----------|
|
||||
| `ruvllm-esp32-esp32` | ESP32 | Base |
|
||||
| `ruvllm-esp32-esp32s2` | ESP32-S2 | Base |
|
||||
| `ruvllm-esp32-esp32s3` | ESP32-S3 | Base + SIMD |
|
||||
| `ruvllm-esp32-esp32c3` | ESP32-C3 | Base |
|
||||
| `ruvllm-esp32-esp32c6` | ESP32-C6 | Base |
|
||||
| `ruvllm-esp32-esp32s3-federation` | ESP32-S3 | Multi-chip federation |
|
||||
|
||||
### Web Flasher
|
||||
|
||||
Flash directly from your browser: [RuvLLM Web Flasher](https://ruvnet.github.io/ruvector/flash)
|
||||
283
examples/ruvLLM/esp32-flash/.github/workflows/release.yml
vendored
Normal file
283
examples/ruvLLM/esp32-flash/.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,283 @@
|
||||
name: Release Binaries
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'ruvllm-esp32-v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version tag (e.g., v0.2.0)'
|
||||
required: true
|
||||
default: 'v0.2.0'
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build-npm:
|
||||
name: Build npm package
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Package npm module
|
||||
working-directory: examples/ruvLLM/esp32-flash/npm
|
||||
run: |
|
||||
npm pack
|
||||
mv *.tgz ../ruvllm-esp32-npm.tgz
|
||||
|
||||
- name: Upload npm artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: npm-package
|
||||
path: examples/ruvLLM/esp32-flash/ruvllm-esp32-npm.tgz
|
||||
|
||||
build-rust:
|
||||
name: Build Rust (${{ matrix.target }})
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
# Linux x86_64
|
||||
- os: ubuntu-latest
|
||||
target: x86_64-unknown-linux-gnu
|
||||
artifact: ruvllm-esp32-linux-x64
|
||||
features: host-test
|
||||
|
||||
# Linux ARM64
|
||||
- os: ubuntu-latest
|
||||
target: aarch64-unknown-linux-gnu
|
||||
artifact: ruvllm-esp32-linux-arm64
|
||||
features: host-test
|
||||
cross: true
|
||||
|
||||
# macOS x86_64
|
||||
- os: macos-latest
|
||||
target: x86_64-apple-darwin
|
||||
artifact: ruvllm-esp32-darwin-x64
|
||||
features: host-test
|
||||
|
||||
# macOS ARM64
|
||||
- os: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
artifact: ruvllm-esp32-darwin-arm64
|
||||
features: host-test
|
||||
|
||||
# Windows x86_64
|
||||
- os: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
artifact: ruvllm-esp32-win-x64
|
||||
features: host-test
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-action@stable
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
||||
- name: Install cross (Linux ARM64)
|
||||
if: matrix.cross
|
||||
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||
|
||||
- name: Build binary
|
||||
working-directory: examples/ruvLLM/esp32-flash
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ matrix.cross }}" = "true" ]; then
|
||||
cross build --release --target ${{ matrix.target }} --features ${{ matrix.features }}
|
||||
else
|
||||
cargo build --release --target ${{ matrix.target }} --features ${{ matrix.features }}
|
||||
fi
|
||||
|
||||
- name: Prepare artifacts (Unix)
|
||||
if: runner.os != 'Windows'
|
||||
working-directory: examples/ruvLLM/esp32-flash
|
||||
run: |
|
||||
mkdir -p dist
|
||||
cp target/${{ matrix.target }}/release/ruvllm-esp32 dist/${{ matrix.artifact }} 2>/dev/null || echo "Binary not found"
|
||||
chmod +x dist/${{ matrix.artifact }} 2>/dev/null || true
|
||||
|
||||
- name: Prepare artifacts (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
working-directory: examples/ruvLLM/esp32-flash
|
||||
shell: pwsh
|
||||
run: |
|
||||
New-Item -ItemType Directory -Force -Path dist
|
||||
Copy-Item target/${{ matrix.target }}/release/ruvllm-esp32.exe dist/${{ matrix.artifact }}.exe -ErrorAction SilentlyContinue
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.artifact }}
|
||||
path: |
|
||||
examples/ruvLLM/esp32-flash/dist/*
|
||||
if-no-files-found: warn
|
||||
|
||||
build-wasm:
|
||||
name: Build WebAssembly
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-action@stable
|
||||
with:
|
||||
targets: wasm32-unknown-unknown
|
||||
|
||||
- name: Install wasm-pack
|
||||
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||
|
||||
- name: Build WASM
|
||||
working-directory: examples/ruvLLM/esp32-flash
|
||||
run: |
|
||||
wasm-pack build --target web --features wasm --no-default-features || echo "WASM build skipped"
|
||||
|
||||
- name: Package WASM
|
||||
working-directory: examples/ruvLLM/esp32-flash
|
||||
run: |
|
||||
mkdir -p wasm-dist
|
||||
if [ -d "pkg" ]; then
|
||||
cp -r pkg/* wasm-dist/
|
||||
else
|
||||
echo "WASM build not available" > wasm-dist/README.txt
|
||||
fi
|
||||
|
||||
- name: Upload WASM artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ruvllm-esp32-wasm
|
||||
path: examples/ruvLLM/esp32-flash/wasm-dist/
|
||||
|
||||
release:
|
||||
name: Create Release
|
||||
needs: [build-npm, build-rust, build-wasm]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifacts
|
||||
|
||||
- name: Prepare release assets
|
||||
run: |
|
||||
mkdir -p release
|
||||
|
||||
# Copy npm package
|
||||
cp artifacts/npm-package/*.tgz release/ 2>/dev/null || true
|
||||
|
||||
# Copy binaries
|
||||
for dir in artifacts/ruvllm-esp32-*; do
|
||||
if [ -d "$dir" ]; then
|
||||
name=$(basename $dir)
|
||||
if [ "$name" != "ruvllm-esp32-wasm" ]; then
|
||||
for f in $dir/*; do
|
||||
cp "$f" release/ 2>/dev/null || true
|
||||
done
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Copy WASM
|
||||
if [ -d "artifacts/ruvllm-esp32-wasm" ]; then
|
||||
cd artifacts/ruvllm-esp32-wasm && zip -r ../../release/ruvllm-esp32-wasm.zip . && cd ../..
|
||||
fi
|
||||
|
||||
ls -la release/
|
||||
|
||||
- name: Create checksums
|
||||
run: |
|
||||
cd release
|
||||
sha256sum * > checksums.txt 2>/dev/null || true
|
||||
cat checksums.txt
|
||||
|
||||
- name: Get version
|
||||
id: version
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "version=${GITHUB_REF#refs/tags/ruvllm-esp32-}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: ruvllm-esp32-${{ steps.version.outputs.version }}
|
||||
name: RuvLLM ESP32 ${{ steps.version.outputs.version }}
|
||||
body: |
|
||||
## RuvLLM ESP32 ${{ steps.version.outputs.version }}
|
||||
|
||||
Full-featured LLM inference engine for ESP32 microcontrollers.
|
||||
|
||||
### Features
|
||||
- INT8/Binary quantized inference (~20KB RAM)
|
||||
- Product quantization (8-32x compression)
|
||||
- MicroLoRA on-device adaptation
|
||||
- HNSW vector search (1000+ vectors)
|
||||
- Semantic memory with RAG
|
||||
- Multi-chip federation (pipeline/tensor parallel)
|
||||
- Speculative decoding (2-4x speedup)
|
||||
- Anomaly detection
|
||||
|
||||
### Installation
|
||||
|
||||
**Via npm (recommended):**
|
||||
```bash
|
||||
npx ruvllm-esp32 install
|
||||
npx ruvllm-esp32 build --target esp32s3
|
||||
npx ruvllm-esp32 flash
|
||||
```
|
||||
|
||||
**Direct binary:**
|
||||
Download the appropriate binary for your platform from the assets below.
|
||||
|
||||
### Supported Platforms
|
||||
- Linux x64/ARM64
|
||||
- macOS x64/ARM64 (Apple Silicon)
|
||||
- Windows x64
|
||||
- WebAssembly (browser/Node.js)
|
||||
|
||||
### Supported ESP32 Variants
|
||||
- ESP32 (520KB SRAM)
|
||||
- ESP32-S2 (320KB SRAM)
|
||||
- ESP32-S3 (512KB SRAM + SIMD)
|
||||
- ESP32-C3 (400KB SRAM, RISC-V)
|
||||
- ESP32-C6 (512KB SRAM, RISC-V + WiFi 6)
|
||||
files: |
|
||||
release/*
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
publish-npm:
|
||||
name: Publish to npm
|
||||
needs: [release]
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Publish to npm
|
||||
working-directory: examples/ruvLLM/esp32-flash/npm
|
||||
run: npm publish --access public
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
Reference in New Issue
Block a user