rightkit-embed 0.6.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.6.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/bogusyogi/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 ten fixed-length batch-1 graph sessions (16 to 512 tokens in a schema-2 manifest, five in a legacy bundle, each with its ORT arenas and intra-op threads) plus, when the manifest lists ingest graphs, at most six static batch-4 and batch-8 sessions (32, 128, 512 tokens each; all graphs share one weights file) plus one host token table (fp16 268 MB, or int8 134 MB with scales), 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.6"
features = ["half"]
optional = true

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

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

[dependencies.thiserror]
version = "2"

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

[dev-dependencies.rusqlite]
version = "0.40.2"
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