[package]
name = "dakera-inference"
version.workspace = true
edition.workspace = true
license.workspace = true
description = "Embedded inference engine for Dakera - generates embeddings locally via ONNX Runtime"
repository = "https://github.com/Dakera-AI/dakera"
homepage = "https://dakera.ai"
documentation = "https://docs.rs/dakera-inference"
keywords = ["agent-memory", "vector-search", "knowledge-graph", "ai-agents", "mcp"]
categories = ["database", "science", "command-line-utilities"]

[lib]
name = "inference"

[features]
# Enable CUDA execution provider for GPU-accelerated ONNX inference.
# At runtime, set DAKERA_USE_GPU=1 to activate. Falls back to CPU if CUDA is unavailable.
cuda = ["ort/cuda"]

[dependencies]
# ONNX Runtime — replaces candle-core/nn/transformers (CE-3)
ort = { version = "=2.0.0-rc.12", features = ["download-binaries"] }

# HTTP client for ONNX model downloads from HuggingFace.
# Force ureq to load system CA certs via rustls-native-certs.
# Without this, ureq's default `tls` feature uses only webpki-roots (Mozilla bundle),
# which doesn't include corporate proxy CAs like Netskope.
ureq = { version = "2", default-features = false, features = ["tls", "native-certs"] }
url = "2"

# Tokenization — onig feature is mandatory on non-WASM: tokenizers 0.20.x compiles
# utils/onig.rs unconditionally (gated by !wasm, NOT by the fancy-regex feature flag).
# Removing default-features drops the onig crate dep while the source still references
# onig::Regex → E0432. zigbuild alloca issue is solved via CFLAGS_aarch64_unknown_linux_gnu
# in .github/workflows/ci.yml — not by removing the onig dep.
tokenizers = "0.20"

# Async runtime
tokio = { workspace = true }
async-trait = { workspace = true }

# Serialization
serde = { workspace = true }
serde_json = { workspace = true }

# Error handling
thiserror = { workspace = true }

# Logging
tracing = { workspace = true }

# Rule-based NER (CE-4)
regex = { workspace = true }
lazy_static = { workspace = true }

# Async HTTP for external extraction providers (EXT-1)
reqwest = { workspace = true }

# Concurrency
parking_lot = { workspace = true }

# Internal crates
common = { workspace = true }

[dev-dependencies]
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
