Installation
Get started with bun-scikit in your Bun project.Requirements
Bun 1.3.9 or later is required to run bun-scikit.
Install bun-scikit
Add the package
Install bun-scikit using Bun’s package manager:This installs the latest stable version from npm.
Native Binaries
bun-scikit includes prebuilt native binaries for optimal performance:Linux x64
Prebuilt binaries included
Windows x64
Prebuilt binaries included
macOS
Build from source (prebuilt binaries not yet available)
Other Platforms
JavaScript fallback available
Configuration (Advanced)
For advanced users, bun-scikit supports several environment variables to customize native acceleration:Native Bridge Mode
node-api: Use Node-API bridge (default)ffi: Use FFI bridge
Custom Binary Paths
Tree Backend Selection
The default
zig backend provides significant performance improvements for DecisionTreeClassifier, DecisionTreeRegressor, RandomForestClassifier, and RandomForestRegressor.TypeScript Configuration
bun-scikit is fully typed. If you’re using TypeScript, no additional configuration is needed:Troubleshooting
Module not found error
Module not found error
Make sure you’re using Bun 1.3.9 or later:Clear your cache and reinstall:
Tree backend showing 'js' instead of 'zig'
Tree backend showing 'js' instead of 'zig'
This can happen if:
- You’re on an unsupported platform (macOS prebuilts not yet available)
- The native binaries failed to load
- You set
BUN_SCIKIT_TREE_BACKEND=js
Type errors with TypeScript
Type errors with TypeScript
Ensure you have the latest Bun types:Run type checking:
Next Steps
Quick Start
Train your first model
API Reference
Explore the full API