Skip to content

Cactus Rust Bindings

Raw FFI bindings to the Cactus C API. Auto-generated via bindgen.

Model weights: Pre-converted weights for all supported models at huggingface.co/Cactus-Compute.

Installation

Add to your Cargo.toml:

[dependencies]
cactus-sys = { path = "rust/cactus-sys" }

Build requirements: CMake, C++20 compiler, and platform tools (Xcode CLI on macOS, build-essential + libcurl4-openssl-dev + libclang-dev on Linux).

Usage

All functions mirror the C API documented in docs/cactus_engine.md. For vision models (LFM2-VL, LFM2.5-VL), add "images": ["path/to/image.png"] to any message.

For usage examples, see: - Test files: rust/cactus-sys/tests/ - C API docs: docs/cactus_engine.md - Other SDKs: python/README.md, apple/README.md

Testing

export CACTUS_MODEL_PATH=/path/to/model
export CACTUS_STT_MODEL_PATH=/path/to/whisper-model
export CACTUS_STT_AUDIO_PATH=/path/to/audio.wav
cargo test --manifest-path rust/Cargo.toml -- --nocapture

See Also