Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.
[package]
name = "tauri-plugin-llamacpp"
version = "1.0.0"
authors = ["Jan <[email protected]>"]
description = "Tauri plugin for managing Jan LlamaCpp server processes and model loading"
license = "Apache-2.0"
repository = "https://github.com/janhq/jan"
edition = "2021"
rust-version = "1.77.2"
exclude = ["/examples", "/dist-js", "/guest-js", "/node_modules"]
links = "tauri-plugin-llamacpp"
[dependencies]
base64 = "0.22.1"
byteorder = "1.5.0"
hmac = "0.12.1"
jan-utils = { path = "../../utils" }
log = "0.4"
# Bearer tokens for the worker. The OS assigns the port, so the key cannot be
# derived from it; it is drawn from the OS CSPRNG instead.
rand = "0.8"
serde = { version = "1.0", features = ["derive"] }
sha2 = "0.10.9"
tauri = { version = "2.5.0", default-features = false, features = [] }
thiserror = "2.0.12"
tokio = { version = "1", features = ["full"] }
tauri-plugin-hardware = { path = "../tauri-plugin-hardware" }
serde_json = "1.0.149"
futures-util = "0.3"
# The loopback OpenAI-compatible surface. Same versions the app crate already
# uses, so the workspace resolves one copy.
hyper = { version = "1", features = ["server", "http1"] }
hyper-util = { version = "0.1", features = ["tokio"] }
http-body-util = "0.1"
bytes = "1"
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
reqwest = { version = "0.12", features = ["json", "blocking", "stream", "native-tls"] }
# lddtree's Mach-O handling has crashed in the field; we skip dep analysis on macOS.
[target.'cfg(not(any(target_os = "macos", target_os = "ios", target_os = "android")))'.dependencies]
lddtree = "0.5"
[target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies]
reqwest = { version = "0.12", features = ["json", "blocking", "stream", "rustls-tls"], default-features = false }
# Unix-specific dependencies
[target.'cfg(unix)'.dependencies]
nix = { version = "=0.30.1", features = ["signal", "process"] }
# The kill-on-close job object the worker is spawned into. Windows has no
# process group, so this is what keeps a force-quit Jan from orphaning it.
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.60.2", features = [
"Win32_Foundation",
# CreateJobObjectW takes SECURITY_ATTRIBUTES, and the extended limit struct
# lives behind Threading; both are gated separately from JobObjects itself.
"Win32_Security",
"Win32_System_JobObjects",
"Win32_System_Threading",
] }
# The supervised worker. `required-features` keeps it out of the default build,
# where there is no compiled llama.cpp to link against.
[[bin]]
name = "jan-llama-worker"
path = "src/bin/jan-llama-worker.rs"
required-features = ["engine"]
[features]
default = []
# Compiles and statically links llama.cpp (libllama + libcommon +
# server-context) plus the C shim. OFF by default: this crate is a
# non-optional dependency of the app crate, so enabling it unconditionally
# would put cmake and a C++ toolchain on the critical path of every
# `cargo check`, including the CLI-only job that never runs inference.
engine = []
# GPU backends. Each implies `engine`; they are separate build artifacts
# because each needs its own toolchain (nvcc per CUDA major, the Vulkan SDK,
# ROCm) and CUDA 12 and 13 cannot come from one compile.
engine-cuda = ["engine"]
engine-vulkan = ["engine"]
engine-hip = ["engine"]
engine-metal = ["engine"]
[dev-dependencies]
tempfile = "3.0"
serde_json = "1.0.149"
reqwest = { version = "0.12", features = ["json"] }
[build-dependencies]
tauri-plugin = { version = "2.3.1", features = ["build"] }
# Pure-Rust and cheap when unused; it only shells out to a compiler if the
# `engine` feature actually asks for the native build.
cc = "1"