Overview
Thecactus test command runs the Cactus test suite, including unit tests, performance benchmarks, and on-device testing for iOS and Android.
Syntax
Flags
—model
Specify the LLM model to test:LFM2-VL-450M
—transcribe_model
Specify the speech-to-text model to test:moonshine-base
—benchmark
Run benchmarks with larger, more comprehensive models:—precision
Regenerate model weights at a specific precision:—reconvert
Force reconversion of test models from source:—no-rebuild
Skip rebuilding the library before testing:—llm / —stt / —performance
Run specific test suites:—ios
Run tests on a connected iPhone or iPad:- Physical iOS device connected via USB
- Xcode with device provisioning
- Device in developer mode
—android
Run tests on a connected Android device:- Physical Android device or emulator
- ADB debugging enabled
- Device authorized for USB debugging
Examples
Test Suites
LLM Tests (--llm)
Tests language model functionality:
- Model loading and initialization
- Text generation with various prompts
- Tokenization accuracy
- Context window handling
- Stop sequence detection
- Temperature and sampling
- Batch processing
STT Tests (--stt)
Tests speech-to-text functionality:
- Model loading and initialization
- Audio file transcription
- Real-time streaming transcription
- Multiple audio formats
- Accuracy on test dataset
- Performance metrics
Performance Tests (--performance)
Benchmarks system performance:
- Token generation speed (tokens/sec)
- Time to first token (TTFT)
- Memory usage and leaks
- Model load time
- Concurrent request handling
- Device-specific optimizations
Device Testing
iOS Device (--ios)
Deploys and runs tests on a connected iPhone/iPad:
Android Device (--android)
Deploys and runs tests on a connected Android device:
Benchmark Mode
With--benchmark, tests use larger production models:
| Suite | Default Model | Benchmark Model |
|---|---|---|
| LLM | LFM2-VL-450M | Qwen-2.5-3B |
| STT | moonshine-base | parakeet-1.1b |
Continuous Integration
For CI/CD pipelines:See Also
Build Command
Build libraries before testing
Run Command
Test models interactively