rightkit-embed 0.5.0

Product-neutral local text embeddings and persistent cosine vector store.
Documentation
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2021"
rust-version = "1.98.0"
name = "rightkit-embed"
version = "0.5.0"
build = false
include = [
    "src/**",
    "tests/**",
    "Cargo.toml",
    "README.md",
    "CHANGELOG.md",
    "LICENSE-MIT",
    "LICENSE-APACHE",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Product-neutral local text embeddings and persistent cosine vector store."
readme = "README.md"
license = "MIT OR Apache-2.0"
repository = "https://github.com/Orthic-Labs/rightkit"

[package.metadata.rightkit]
continuous = "held-resource"

[[package.metadata.rightkit.resources]]
api = "Embedder::load"
file = "src/embedder.rs"
holds = [
    "memory",
    "thread",
]
scale = "one ONNX session: model weights, ORT arenas and intra_threads intra-op threads (default 1), plus a tokenizer and a OnceLock pipeline id; fixed per Embedder, independent of how many texts are embedded"
release = "Drop"

[[package.metadata.rightkit.resources]]
api = "E40Engine::open"
file = "src/e40.rs"
holds = [
    "memory",
    "thread",
]
scale = "an E40 bundle on an accelerator keeps at most five fixed-length graph sessions (32, 64, 128, 256, 512 tokens, each with its ORT arenas and intra-op threads) plus one host token table, built at load by the pre-warm and fixed per Embedder; the session log is a Vec of at most one entry per graph build during load and stops recording when the load returns; none of it grows with the number of texts embedded"
release = "Drop"
static_note = "e40.rs has no process-wide static: the session log, pre-warm state and graph map are fields of E40Engine, owned by the Embedder and freed with it"

[[package.metadata.rightkit.resources]]
api = "CoreMlEngine::open"
file = "src/coreml.rs"
holds = ["memory"]
scale = "a Core ML bundle keeps at most five MLModel functions (one per length 32, 64, 128, 256, 512, each on the one compute unit its length maps to) plus one shared 268 MB host token table, all loaded at load by the pre-warm and fixed per Embedder; the compiled .mlmodelc is one directory on disk per package-hash and OS key; none of it grows with the number of texts embedded"
release = "Drop"
static_note = "the only static is COMPILE, a Mutex<()> that holds no data and no thread: it serialises .mlmodelc compiles within the process so two compiles never share Core ML's temporary output path; it is empty between compiles, so residency is one pointer-sized lock"

[features]
bench-internals = ["inference"]
default = [
    "inference",
    "vector",
]
inference = [
    "dep:rightkit-onnx",
    "dep:tokenizers",
    "dep:rightkit-fs",
    "dep:serde_json",
    "dep:objc2",
    "dep:objc2-core-ml",
    "dep:objc2-foundation",
]
vector = [
    "dep:rusqlite",
    "dep:rightkit-db",
]

[lib]
name = "rightkit_embed"
path = "src/lib.rs"

[[test]]
name = "accelerator_parity_e2e"
path = "tests/accelerator_parity_e2e.rs"

[[test]]
name = "batch_real_model_e2e"
path = "tests/batch_real_model_e2e.rs"

[[test]]
name = "coreml_real_model_e2e"
path = "tests/coreml_real_model_e2e.rs"

[[test]]
name = "e40_real_model_e2e"
path = "tests/e40_real_model_e2e.rs"

[[test]]
name = "e40_resident_bench"
path = "tests/e40_resident_bench.rs"

[[test]]
name = "e40_token_dump"
path = "tests/e40_token_dump.rs"

[[test]]
name = "gemma2_real_model_e2e"
path = "tests/gemma2_real_model_e2e.rs"

[[test]]
name = "real_model_e2e"
path = "tests/real_model_e2e.rs"

[[test]]
name = "runtime_budget_declaration"
path = "tests/runtime_budget_declaration.rs"

[[test]]
name = "vector_e2e"
path = "tests/vector_e2e.rs"

[dependencies.rightkit-db]
version = "0.4"
optional = true
default-features = false

[dependencies.rightkit-fs]
version = "0.4.0"
features = ["digest"]
optional = true
default-features = false

[dependencies.rightkit-onnx]
version = "0.2.2"
features = ["half"]
optional = true

[dependencies.rusqlite]
version = "0.40.1"
optional = true
default-features = false

[dependencies.serde_json]
version = "1.0.150"
optional = true

[dependencies.thiserror]
version = "2"

[dependencies.tokenizers]
version = "0.22.2"
features = ["onig"]
optional = true
default-features = false

[dev-dependencies.rusqlite]
version = "0.40.1"
features = ["bundled"]

[dev-dependencies.tempfile]
version = "3"

[target.'cfg(target_os = "macos")'.dependencies.objc2]
version = "0.6"
features = ["exception"]
optional = true

[target.'cfg(target_os = "macos")'.dependencies.objc2-core-ml]
version = "0.3"
optional = true

[target.'cfg(target_os = "macos")'.dependencies.objc2-foundation]
version = "0.3"
optional = true