# 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 = "2024"
name = "embellama"
version = "0.10.1"
authors = ["Embellama Contributors"]
build = "build.rs"
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "High-performance Rust library for generating text embeddings using llama-cpp"
readme = "README.md"
keywords = [
    "embeddings",
    "llama",
    "nlp",
    "machine-learning",
    "ai",
]
categories = [
    "science",
    "api-bindings",
    "text-processing",
]
license = "Apache-2.0"
repository = "https://github.com/darjus/embellama"

[package.metadata.docs.rs]
features = [
    "server",
    "openmp",
]
targets = [
    "x86_64-unknown-linux-gnu",
    "x86_64-apple-darwin",
    "x86_64-pc-windows-msvc",
]

[features]
android-shared-stdcxx = ["llama-cpp-2/android-shared-stdcxx"]
android-static-stdcxx = ["llama-cpp-2/android-static-stdcxx"]
cpu-optimized = ["openmp"]
cuda = ["llama-cpp-2/cuda"]
cuda-backend = ["cuda"]
cuda-no-vmm = [
    "cuda",
    "llama-cpp-2/cuda-no-vmm",
]
default = ["openmp"]
dynamic-link = ["llama-cpp-2/dynamic-link"]
metal = ["llama-cpp-2/metal"]
metal-backend = ["metal"]
mtmd = ["llama-cpp-2/mtmd"]
openmp = ["llama-cpp-2/openmp"]
redis-cache = [
    "dep:redis",
    "server",
]
rocm = ["llama-cpp-2/rocm"]
rocm-backend = ["rocm"]
sampler = ["llama-cpp-2/sampler"]
server = [
    "dep:axum",
    "dep:tokio",
    "dep:clap",
    "dep:async-trait",
    "dep:tower",
    "dep:tower-http",
    "dep:uuid",
    "dep:base64",
    "dep:governor",
    "dep:prometheus",
    "dep:rand",
    "dep:subtle",
]
vulkan = ["llama-cpp-2/vulkan"]
vulkan-backend = ["vulkan"]

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

[[bin]]
name = "embellama-server"
path = "src/bin/server.rs"
required-features = ["server"]

[[example]]
name = "batch"
path = "examples/batch.rs"

[[example]]
name = "embedded_server"
path = "examples/embedded_server.rs"

[[example]]
name = "error_handling"
path = "examples/error_handling.rs"

[[example]]
name = "reranking"
path = "examples/reranking.rs"

[[example]]
name = "simple"
path = "examples/simple.rs"

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[[bench]]
name = "cache_benchmark"
path = "benches/cache_benchmark.rs"

[[bench]]
name = "embeddings_bench"
path = "benches/embeddings_bench.rs"
harness = false

[dependencies.anyhow]
version = "1.0"

[dependencies.async-trait]
version = "0.1"
optional = true

[dependencies.axum]
version = "0.8"
optional = true

[dependencies.base64]
version = "0.22"
optional = true

[dependencies.byteorder]
version = "1"

[dependencies.clap]
version = "4.4"
features = [
    "derive",
    "env",
]
optional = true

[dependencies.dashmap]
version = "6.0"

[dependencies.governor]
version = "0.7"
optional = true

[dependencies.llama-cpp-2]
version = "=0.1.138"

[dependencies.llama-cpp-sys-2]
version = "=0.1.138"

[dependencies.lru]
version = "0.12"

[dependencies.moka]
version = "0.12"
features = ["sync"]

[dependencies.num_cpus]
version = "1.16"

[dependencies.once_cell]
version = "1.21.3"

[dependencies.parking_lot]
version = "0.12"

[dependencies.prometheus]
version = "0.14"
optional = true

[dependencies.rand]
version = "0.8"
optional = true

[dependencies.rayon]
version = "1.8"

[dependencies.redis]
version = "0.27"
features = [
    "tokio-comp",
    "connection-manager",
]
optional = true

[dependencies.self_cell]
version = "1.2.0"

[dependencies.serde]
version = "1.0"
features = ["derive"]

[dependencies.serde_json]
version = "1.0"

[dependencies.sha2]
version = "0.10"

[dependencies.subtle]
version = "2.6"
optional = true

[dependencies.sysinfo]
version = "0.38"

[dependencies.thiserror]
version = "2.0"

[dependencies.tokio]
version = "1.44"
features = ["full"]
optional = true

[dependencies.tower]
version = "0.5"
optional = true

[dependencies.tower-http]
version = "0.6"
features = [
    "cors",
    "trace",
]
optional = true

[dependencies.tracing]
version = "0.1"

[dependencies.tracing-subscriber]
version = "0.3"
features = ["env-filter"]

[dependencies.uuid]
version = "1.11"
features = [
    "v4",
    "serde",
]
optional = true

[dev-dependencies.axum-test]
version = "18.1"

[dev-dependencies.chrono]
version = "0.4"
features = ["serde"]

[dev-dependencies.criterion]
version = "0.5"
features = ["html_reports"]

[dev-dependencies.hyper]
version = "1.0"
features = ["full"]

[dev-dependencies.hyper-util]
version = "0.1"

[dev-dependencies.pretty_assertions]
version = "1.4"

[dev-dependencies.proptest]
version = "1.4"

[dev-dependencies.reqwest]
version = "0.12"
features = [
    "json",
    "blocking",
]

[dev-dependencies.serial_test]
version = "3.0"

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

[dev-dependencies.test-log]
version = "0.2.18"
features = ["trace"]

[dev-dependencies.test-with]
version = "0.15"
default-features = false

[dev-dependencies.tokio-test]
version = "0.4"

[lints.clippy]
missing_errors_doc = "allow"

[lints.clippy.pedantic]
level = "deny"
priority = -1

[profile.bench]
inherits = "release"

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