llama-cpp-4 0.9.0

llama.cpp bindings for Rust
Documentation
[package]
name = "llama-cpp-4"
description = "llama.cpp bindings for Rust"
version = "0.9.0"
edition = "2021"
# The floor is set by the dependency graph, not by this crate's own syntax.
# `llama-cpp-sys-4`'s `ureq` build-dependency pulls url -> idna -> icu_*, which
# declare 1.88; this crate's own code only needs 1.82 (for `&raw const`). Lower
# it only after checking the graph again:
#   cargo metadata | jq -r '.packages[]|select(.rust_version)|.rust_version'
rust-version = "1.88"
license = "MIT OR Apache-2.0"
authors = ["Eugene Hauptmann"]
repository = "https://github.com/eugenehp/llama-cpp-rs"
keywords = ["llama", "llm", "ggml", "gguf", "inference"]
categories = ["api-bindings", "science"]

[dependencies]
enumflags2 = "0.7.12"
llama-cpp-sys-4 = { path = "../llama-cpp-sys-4", version = "0.9.0" }
thiserror = { workspace = true }
tracing = { workspace = true }

[dev-dependencies]
encoding_rs = { workspace = true }
criterion = { workspace = true }

[features]
# `ggml` is free to enable: it gates Rust API only and appears nowhere in the
# sys build script. `rpc` costs a GGML_RPC backend build on every downstream
# build, and is on by request.
default = ["openmp", "mtmd", "dynamic-link", "ggml", "rpc"]
cuda = ["llama-cpp-sys-4/cuda"]
metal = ["llama-cpp-sys-4/metal"]
dynamic-link = ["llama-cpp-sys-4/dynamic-link"]
vulkan = ["llama-cpp-sys-4/vulkan"]
webgpu = ["llama-cpp-sys-4/webgpu"]
blas = ["llama-cpp-sys-4/blas"]
opencl = ["llama-cpp-sys-4/opencl"]
hip = ["llama-cpp-sys-4/hip"]
native = ["llama-cpp-sys-4/native"]
openmp = ["llama-cpp-sys-4/openmp"]
rpc = ["llama-cpp-sys-4/rpc"]
mtmd = ["llama-cpp-sys-4/mtmd"]
ggml = []
# Retained as a no-op so `--features q1` keeps resolving. Q1_0 quantization is
# upstream now (ftype 40, ggml type 41) and unconditional, and the patch this
# used to stage is gone — see the note on `GgmlType::Q1_0`.
q1 = ["llama-cpp-sys-4/q1"]
prebuilt = ["llama-cpp-sys-4/prebuilt"]



[lints]
workspace = true

[package.metadata.docs.rs]
all-features = false
features = ["mtmd", "ggml", "rpc"]

[[bench]]
name = "tensor_transactions"
harness = false

[[bench]]
name = "decode_hooks"
harness = false

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

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

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

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