[package]
name = "blazen-embed-candle"
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
rust-version.workspace = true
repository.workspace = true
description = "Local embedding backend for Blazen using HuggingFace candle"

[dependencies]
candle-core = { version = "0.10", optional = true, default-features = false }
candle-nn = { version = "0.10", optional = true }
candle-transformers = { version = "0.10", optional = true }
tokenizers = { version = "0.22", optional = true, default-features = false, features = ["onig", "progressbar"] }
hf-hub = { workspace = true, features = ["tokio"], optional = true }
blazen-model-cache = { workspace = true }
serde = { workspace = true }
serde_json.workspace = true
tokio = { workspace = true }
tracing.workspace = true
thiserror = { workspace = true }

# On Apple targets, forward metal + accelerate features into candle-core
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
candle-core = { version = "0.10", optional = true, default-features = false, features = ["metal", "accelerate"] }

[features]
default = ["cpu"]
engine = ["dep:candle-core", "dep:candle-nn", "dep:candle-transformers", "dep:tokenizers", "dep:hf-hub"]
cpu = ["engine"]
cuda = ["engine"]
metal = ["engine"]
accelerate = ["engine"]

[lints]
workspace = true
