[package]
name = "llama-cpp-bindings"
description = "llama.cpp bindings for Rust"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true

[dependencies]
encoding_rs = { workspace = true }
enumflags2 = { workspace = true }
llama-cpp-bindings-sys = { workspace = true }
llama-cpp-bindings-types = { workspace = true }
llama-cpp-log-decoder = { workspace = true }
llguidance = { workspace = true }
log = { workspace = true }
nom = { workspace = true }
serde_json = { workspace = true }
thiserror = { workspace = true }
toktrie = { workspace = true }

[dev-dependencies]
serial_test = { workspace = true }

[features]
default = ["openmp", "android-shared-stdcxx"]
cuda = ["llama-cpp-bindings-sys/cuda"]
cuda-no-vmm = ["cuda", "llama-cpp-bindings-sys/cuda-no-vmm"]
metal = ["llama-cpp-bindings-sys/metal"]
dynamic-link = ["llama-cpp-bindings-sys/dynamic-link"]
dynamic-backends = ["dynamic-link", "llama-cpp-bindings-sys/dynamic-backends"]
vulkan = ["llama-cpp-bindings-sys/vulkan"]
openmp = ["llama-cpp-bindings-sys/openmp"]
rocm = ["llama-cpp-bindings-sys/rocm"]
# Only has an impact on Android.
android-shared-stdcxx = ["llama-cpp-bindings-sys/shared-stdcxx"]
android-static-stdcxx = ["llama-cpp-bindings-sys/static-stdcxx"]
system-ggml = ["llama-cpp-bindings-sys/system-ggml"]
system-ggml-static = ["system-ggml", "llama-cpp-bindings-sys/system-ggml-static"]

[target.'cfg(all(target_os = "macos", any(target_arch = "aarch64", target_arch = "arm64")))'.dependencies]
llama-cpp-bindings-sys = { workspace = true, features = ["metal"] }

[lints.rust]
unsafe_op_in_unsafe_fn = "warn"
unused_qualifications = "warn"

[lints.clippy]
all = { level = "deny", priority = -1 }
pedantic = { level = "warn", priority = -1 }
nursery = { level = "warn", priority = -1 }
module_name_repetitions = "allow"

# Generated FFI bindings use these patterns
used_underscore_binding = "allow"
