Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 1 addition & 32 deletions .github/assemble-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,7 @@ cp android/README.md site_docs/android/README.md
cp bindings/flutter/README.md site_docs/flutter/README.md
cp bindings/swift/README.md site_docs/swift/README.md
cp bindings/kotlin/README.md site_docs/kotlin/README.md

mkdir -p site_docs/react-native
if curl -sfL "https://raw.githubusercontent.com/cactus-compute/cactus-react-native/main/README.md" -o site_docs/react-native/README.md; then

{
echo '!!! info "Independent release cycle"'
echo ' The React Native SDK releases independently from the Cactus engine.'
echo ' Check the [releases page](https://github.com/cactus-compute/cactus-react-native/releases) for the latest compatible version.'
echo ''
cat site_docs/react-native/README.md
} > site_docs/react-native/README.tmp && mv site_docs/react-native/README.tmp site_docs/react-native/README.md

mkdir -p site_docs/react-native/assets
curl -sfL "https://raw.githubusercontent.com/cactus-compute/cactus-react-native/main/assets/logo.png" -o site_docs/react-native/assets/logo.png 2>/dev/null || true
echo "Fetched React Native README"
else
echo "# React Native SDK" > site_docs/react-native/README.md
echo "" >> site_docs/react-native/README.md
echo "See [cactus-react-native on GitHub](https://github.com/cactus-compute/cactus-react-native) for full documentation." >> site_docs/react-native/README.md
echo "Warning: Could not fetch React Native README, using fallback"
fi

cp bindings/react-native/README.md site_docs/react-native/README.md
cp bindings/rust/README.md site_docs/rust/README.md

if [ -d blog ] && ls blog/*.md >/dev/null 2>&1; then
Expand Down Expand Up @@ -93,8 +72,6 @@ sedi 's|(/bindings/rust/)|(rust/README.md)|g' site_docs/index.md
sedi 's|(/python/)|(python/README.md)|g' site_docs/index.md
sedi 's|(/apple/)|(apple/README.md)|g' site_docs/index.md
sedi 's|(/android/)|(android/README.md)|g' site_docs/index.md
sedi 's|(/flutter/)|(flutter/README.md)|g' site_docs/index.md
sedi 's|(/rust/)|(rust/README.md)|g' site_docs/index.md
sedi 's|(/blog/hybrid_transcription\.md)|(blog/hybrid_transcription.md)|g' site_docs/index.md
sedi 's|(/blog/lfm2_24b_a2b\.md)|(blog/lfm2_24b_a2b.md)|g' site_docs/index.md
sedi 's|(/blog/parakeet\.md)|(blog/parakeet.md)|g' site_docs/index.md
Expand Down Expand Up @@ -127,8 +104,6 @@ for f in site_docs/docs/*.md; do
sedi 's|(/python/)|(../python/README.md)|g' "$f"
sedi 's|(/apple/)|(../apple/README.md)|g' "$f"
sedi 's|(/android/)|(../android/README.md)|g' "$f"
sedi 's|(/flutter/)|(../flutter/README.md)|g' "$f"
sedi 's|(/rust/)|(../rust/README.md)|g' "$f"
done

for f in site_docs/python/README.md site_docs/apple/README.md site_docs/android/README.md site_docs/flutter/README.md site_docs/swift/README.md site_docs/kotlin/README.md; do
Expand All @@ -152,8 +127,6 @@ for f in site_docs/python/README.md site_docs/apple/README.md site_docs/android/
sedi 's|(/python/)|(../python/README.md)|g' "$f"
sedi 's|(/apple/)|(../apple/README.md)|g' "$f"
sedi 's|(/android/)|(../android/README.md)|g' "$f"
sedi 's|(/flutter/)|(../flutter/README.md)|g' "$f"
sedi 's|(/rust/)|(../rust/README.md)|g' "$f"
sedi 's|(\.\.\/README\.md)|(../index.md)|g' "$f"
done

Expand All @@ -179,8 +152,6 @@ if [ -f site_docs/rust/README.md ]; then
's|(/python/)|(../python/README.md)|g' \
's|(/apple/)|(../apple/README.md)|g' \
's|(/android/)|(../android/README.md)|g' \
's|(/flutter/)|(../flutter/README.md)|g' \
's|(/rust/)|(../rust/README.md)|g' \
's|(\.\.\/README\.md)|(../index.md)|g'; do
sedi "$pattern" site_docs/rust/README.md
done
Expand All @@ -206,8 +177,6 @@ if ls site_docs/blog/*.md >/dev/null 2>&1; then
sedi 's|(/python/)|(../python/README.md)|g' "$f"
sedi 's|(/apple/)|(../apple/README.md)|g' "$f"
sedi 's|(/android/)|(../android/README.md)|g' "$f"
sedi 's|(/flutter/)|(../flutter/README.md)|g' "$f"
sedi 's|(/rust/)|(../rust/README.md)|g' "$f"
sedi 's|(/blog/hybrid_transcription\.md)|(hybrid_transcription.md)|g' "$f"
sedi 's|(/blog/lfm2_24b_a2b\.md)|(lfm2_24b_a2b.md)|g' "$f"
sedi 's|(/blog/parakeet\.md)|(parakeet.md)|g' "$f"
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Build
on:
pull_request:
paths:
- cactus/**
- cactus-engine/**
- cactus-graph/**
- cactus-kernels/**
Expand All @@ -13,7 +12,6 @@ on:
push:
branches: [main]
paths:
- cactus/**
- cactus-engine/**
- cactus-graph/**
- cactus-kernels/**
Expand All @@ -25,13 +23,17 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
apple:
runs-on: macos-15
timeout-minutes: 15
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- run: bash cactus/build.sh
- run: bash cactus-engine/build.sh
- run: BUILD_STATIC=true BUILD_XCFRAMEWORK=false bash apple/build.sh
- run: bash android/build.sh

Expand All @@ -41,4 +43,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: sudo apt-get update && sudo apt-get install -y cmake build-essential libcurl4-openssl-dev
- run: bash cactus/build.sh
- run: bash cactus-engine/build.sh
36 changes: 16 additions & 20 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
name: Unit Tests

on:
pull_request:
paths:
- cactus/**
- tests/**
- cactus-kernels/**
- cactus-graph/**
- .github/workflows/cpp.yml
push:
branches: [main]
paths:
- cactus/**
- tests/**
- cactus-kernels/**
- cactus-graph/**
- .github/workflows/cpp.yml
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
timeout-minutes: 45
unit-tests:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
Expand All @@ -30,17 +36,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: ${{ matrix.deps }}
- uses: actions/cache@v4
with:
path: ~/.ccache
key: ccache-${{ matrix.os }}-${{ github.ref_name }}-${{ hashFiles('cactus/CMakeLists.txt', 'tests/CMakeLists.txt', '.github/workflows/cpp.yml') }}
restore-keys: |
ccache-${{ matrix.os }}-${{ github.ref_name }}-
ccache-${{ matrix.os }}-
- run: ccache --zero-stats || true
- run: cmake -G Ninja -S cactus -B cactus/build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- run: cmake --build cactus/build --target cactus_ffi --parallel 4
- run: cmake -G Ninja -S tests -B tests/build-ci -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- run: cmake --build tests/build-ci --target test_stt --parallel 4
- run: ./tests/build-ci/test_stt
- run: ccache --show-stats || true
- name: Run kernel tests
run: bash cactus-kernels/test.sh
- name: Run graph tests
run: bash cactus-graph/test.sh
8 changes: 8 additions & 0 deletions .github/workflows/dco.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read

concurrency:
group: dco-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
dco-check:
runs-on: ubuntu-latest
timeout-minutes: 5
name: DCO Check
steps:
- name: Checkout
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ on:
- python/README.md
- apple/README.md
- android/README.md
- bindings/README.md
- bindings/flutter/README.md
- bindings/kotlin/README.md
- bindings/python/README.md
- bindings/react-native/README.md
- bindings/rust/README.md
- bindings/swift/README.md
- README.md
workflow_call:
inputs:
Expand All @@ -23,9 +28,17 @@ on:
required: false
workflow_dispatch:

permissions:
contents: read

concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: false

jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
steps:
Expand All @@ -36,7 +49,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.x"
python-version: "3.12"

- name: Install dependencies
run: pip install "mkdocs==1.6.1" "mkdocs-material==9.7.5" "mike==2.1.4"
Expand Down
76 changes: 20 additions & 56 deletions .github/workflows/inference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ on:
permissions:
contents: read

concurrency:
group: inference-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
gate:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
approved: ${{ steps.check.outputs.approved }}
steps:
Expand All @@ -28,6 +33,7 @@ jobs:
needs: gate
if: needs.gate.outputs.approved == 'true'
runs-on: [self-hosted, linux, arm64]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -39,77 +45,35 @@ jobs:
source ./setup
fi

- name: Convert models
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
source venv/bin/activate
convert() {
local id=$1 dir=$2 bits=$3
[ -f "weights/$dir/config.txt" ] && return
python3 -m cactus convert "$id" --bits "$bits" ${HF_TOKEN:+--token "$HF_TOKEN"} || true
}
convert "Qwen/Qwen3-0.6B" "qwen3-0.6b" "4"
convert "google/gemma-3-270m-it" "gemma-3-270m-it" "4"
convert "openai/whisper-small" "whisper-small" "4"
convert "nvidia/parakeet-tdt-0.6b-v3" "parakeet-tdt-0.6b-v3" "4"

- name: Build
- name: Build libcactus + engine tests
run: |
bash cactus/build.sh
bash cactus-engine/build.sh
cd cactus-engine/tests
rm -rf build && mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)

unit-tests:
needs: build
runs-on: [self-hosted, linux, arm64]
env:
CACTUS_INDEX_PATH: /tmp/cactus_test_index
CACTUS_NO_CLOUD_TELE: "1"
steps:
- uses: actions/checkout@v4
with:
clean: false
- name: Run unit tests
run: |
mkdir -p "$CACTUS_INDEX_PATH"
cd cactus-engine/tests/build
./test_index
./test_model_loading
./test_telemetry

- name: Run kernel tests
run: bash cactus-kernels/test.sh

- name: Run graph tests
run: bash cactus-graph/test.sh

inference-tests:
model-tests:
needs: build
runs-on: [self-hosted, linux, arm64]
timeout-minutes: 60
env:
CACTUS_TEST_ASSETS: ${{ github.workspace }}/cactus-engine/tests/assets
CACTUS_NO_CLOUD_TELE: "1"
strategy:
fail-fast: false
matrix:
include:
- test: test_llm
model_dir: qwen3-0.6b
- test: test_llm
model_dir: gemma-3-270m-it
- test: test_stt
model_dir: whisper-small
- test: test_stt
model_dir: parakeet-tdt-0.6b-v3
model:
- LiquidAI/LFM2-VL-450M
- openai/whisper-small
steps:
- uses: actions/checkout@v4
with:
clean: false
- name: Run ${{ matrix.test }} (${{ matrix.model_dir }})

- name: Run tests for ${{ matrix.model }}
env:
CACTUS_TEST_MODEL: ${{ github.workspace }}/weights/${{ matrix.model_dir }}
CACTUS_TEST_TRANSCRIBE_MODEL: ${{ github.workspace }}/weights/${{ matrix.model_dir }}
run: ./cactus-engine/tests/build/${{ matrix.test }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
source venv/bin/activate
MODEL="${{ github.event.inputs.model || matrix.model }}"
python3 -m cactus test --component engine --model "$MODEL"
Loading
Loading