edgebert 0.3.4

Fast local text embeddings library for Rust and WASM for BERT inference on native and edge devices with no dependencies.
Documentation
[package]
name = "edgebert"
version = "0.3.4"
edition = "2024"
authors = ["Ólafur Aron Jóhannsson <olafurjohannss@gmail.com>"]
description = "Fast local text embeddings library for Rust and WASM for BERT inference on native and edge devices with no dependencies."
repository = "https://github.com/olafurjohannssson/edgebert"
license = "MIT"
keywords = ["bert", "nlp", "wasm", "transformer", "embeddings"]
categories = ["wasm", "text-processing", "encoding"]

[features]
default = []  # No OpenBLAS by default
openblas = ["dep:blas-src", "dep:openblas-src", "ndarray/blas"]

[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
anyhow = "1.0"
safetensors = "0.6.2"
wasm-bindgen = "0.2.100"
reqwest = { version = "0.12.23", features = ["blocking", "rustls-tls"], default-features = false }
lru = "0.16.1"
once_cell = "1.21.3"

# Optional BLAS dependencies
blas-src = { version = "0.10", features = ["openblas"], optional = true }
openblas-src = { version = "0.10", features = ["cblas", "system"], optional = true }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokenizers = { version = "0.15", default-features = false, features = ["onig"] }
rayon = "1.11.0"
dirs = "6.0.0"
ndarray-stats = "0.6.0"
matrixmultiply = { version = "0.3", features = ["threading", "num_cpus", "cgemm"] }
ndarray = { version = "0.16", features = ["rayon", "matrixmultiply-threading"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2.100"
js-sys = "0.3.77"
wasm-bindgen-futures = "0.4.50"
web-sys = { version = "0.3.77", features = ["console"] }
getrandom = { version = "0.2", features = ["js"] }
ndarray = "0.16.1"
futures = "0.3.31"
console_error_panic_hook = "0.1.7"

[lib]
crate-type = ["cdylib", "rlib"]

[target.'cfg(not(target_arch = "wasm32"))'.build-dependencies]
pkg-config = "0.3"

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
criterion = "0.7.0"

[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
panic = "abort"
strip = true

[profile.bench]
inherits = "release"

[profile.dev-opt]
inherits = "dev"
opt-level = 2

[package.metadata.wasm-pack.profile.release]
wasm-opt = false

[[bin]]
path = "bin/native.rs"
name = "native"