Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

21.2 KB
Raw Blame
[package]
name = "locally-uncensored"
version = "3.1.2"
description = "Private, local AI chat & image/video generation"
authors = ["purpledoubled"]
edition = "2021"
license = "AGPL-3.0-only"
# Never published to crates.io. Also what lets cargo deny accept the path
# dependency on plugins/lu-native (allow-wildcard-paths, deny.toml).
publish = false

# The app is a library with a thin desktop executable around it (src/main.rs).
# Android loads the cdylib, iOS links the staticlib, the desktop binary and the
# tests use the rlib. The name differs from the package on purpose: a library
# and a binary with one name collide on their debug files under Windows.
[lib]
name = "locally_uncensored_lib"
crate-type = ["staticlib", "cdylib", "rlib"]

[features]
# Test-only: let LU_NO_KEYCHAIN / ~/.lu-no-keychain bypass the OS keychain during
# unattended rebuild→open E2E loops. NEVER enabled in a shipped build (not in any
# default), so a release binary always uses the OS vault regardless of env vars or
# marker files. Build test artifacts with: tauri build --features insecure-test-keychain
insecure-test-keychain = []
# Test-only: device tests against a real desktop (src/e2e_remote.rs). With
# LU_E2E_REMOTE_CODE set the desktop starts Remote in the Wi-Fi, fixes the
# code, writes the pairing link to LU_E2E_REMOTE_LINK_FILE and accepts every
# phone with all rights. NEVER in a default or a shipped build:
#   tauri build --debug --features e2e-remote
e2e-remote = []
# The in-process engine (commands/engine_inproc.rs) is always part of the
# Android and iOS builds: a phone cannot start the llama-server sidecar the
# desktop uses. This feature builds the SAME file into a macOS build as well,
# so that the Metal path of the iPhone can be exercised on a Mac, which has
# the same chip family and the same Metal backend (MOBILE-ZIEL.md section 5).
# It changes nothing about how the desktop app serves models. Never part of a
# shipped desktop build. Run with:
#   cargo test --features inproc-engine inproc -- --nocapture
inproc-engine = ["dep:llama-cpp-2", "dep:llama-cpp-sys-2", "dep:encoding_rs"]
# Acceptance builds only: makes the WebView of a RELEASE build inspectable, so
# the test harness (scripts/mobile/ios/ios-harness.mjs, WebKit Remote
# Inspector) can drive a release package in the simulator. On iOS wry then
# calls setInspectable(true) and sets the private key developerExtrasEnabled,
# on Android it opens the WebView debug socket. Because of both it must NEVER
# be part of a store build, and it is in no default. The native layer
# (plugins/lu-native) reads the same feature: only then does it accept
# `simulate_memory_warning` and test servers on private addresses. Build with:
#   scripts/mobile/ios/bauen.sh release abnahme
# Guard: src/lib/__tests__/mobile-ios-fallen.test.ts
abnahme = ["tauri/devtools", "tauri-plugin-lu-native/abnahme"]

[build-dependencies]
tauri-build = { version = "2", features = [] }

[dependencies]
# `devtools` and `tray-icon` are NOT here on purpose, they sit in the
# desktop-only block below. `tray-icon` does not compile for a phone
# (`tauri::tray` does not exist there). `devtools` compiles, and that is the
# problem: on Android it makes wry call
# WebView.setWebContentsDebuggingEnabled(true) in a RELEASE build too, and the
# app then publishes the socket @webview_devtools_remote_<pid>. Anything that
# reaches it drives the whole WebView: read the chat, read the session, call
# every command. Debug builds keep the inspector through debug_assertions.
# Guard: src/lib/__tests__/release-opens-no-debug-socket.test.ts
tauri = { version = "2", features = ["image-png"] }
tauri-plugin-shell = "2"
# The same signature check the updater plugin runs, for the one download the
# plugin cannot do for us: the AppImage LU installs into the home folder when
# it was repackaged by somebody else (commands/self_migrate.rs). Already in
# Cargo.lock as a dependency of the plugin, so this adds no crate to the build.
minisign-verify = "0.2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["full"] }
# reqwest is declared per target further down, because the TLS stack differs:
# the desktop keeps the system one (reqwest's defaults, unchanged), the phones
# use rustls.
zip = { version = "9", default-features = false, features = ["deflate-flate2"] }
dirs = "6"
# Python interpreter discovery for the in-process MLX media engine
# (os_paths::find_python, mlx.rs::locate_python_311).
which = "6"
regex = "1"
glob = "0.3"
sysinfo = "0.33"
walkdir = "2"
hostname = "0.4"
whoami = "1"
num_cpus = "1"
base64 = "0.22"
tempfile = "3"
futures-util = "0.3"
once_cell = "1"
uuid = { version = "1", features = ["v4", "serde"] }
tokio-util = "0.7"
urlencoding = "2"
url = "2"
# Remote Access
axum = { version = "0.8", features = ["ws"] }
tokio-tungstenite = "0.26"
tower-http = { version = "0.6", features = ["cors", "fs"] }
# The sealed remote channel runs an inner request through the router in this
# process (commands/remote.rs, `dispatch_sealed`). tower 0.5 with "util" is
# already in the build through axum, so naming it adds no crate.
tower = { version = "0.5", default-features = false, features = ["util"] }
jsonwebtoken = "9"
qrcode = "0.14"
# "jpeg" is for the screenshots of computer use (commands/computer): a JPEG of
# a desktop is a fifth of the PNG. It adds zune-jpeg (MIT OR Apache-2.0 OR Zlib).
# "webp" is for Remove Background on a Mac, which reads the staged image as it
# was picked (PNG, JPG or WebP). It adds image-webp (MIT OR Apache-2.0).
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "webp"] }
rand = "0.8"
sha2 = "0.10"
# The git object id of a gated Hugging Face file (commands/mesh3d_sf3d.rs).
# RustCrypto, the sibling of sha2, already in Cargo.lock at 0.10.6 through
# other crates, so this adds no crate to the build.
sha1 = "0.10"
# Unpacking the private Python of the voice loop (commands/voice_loop). Both
# are already in Cargo.lock through the updater plugin, so this adds no crate
# to the build.
tar = "0.4"
# flate2 serves the voice loop and the unpacking of a fetched page. One line,
# a key may not stand twice.
flate2 = "1"
# End-to-end sealed remote channel (src/remote_seal.rs), shared by desktop and
# phone. ring and zeroize are already in Cargo.lock on every target
# (jsonwebtoken and rustls pull ring, several crates pull zeroize): naming them
# adds no crate. ring gives Ed25519, HKDF, SHA-256 and ChaCha20-Poly1305.
# snow is the Noise protocol framework (Apache-2.0/MIT); it runs on ring for
# cipher, hash and randomness. ring cannot keep a static X25519 key, so the
# X25519 step comes from curve25519-dalek (BSD-3-Clause, dalek-cryptography),
# the same crate and call snow's own resolver uses. No default features: the
# AES and ChaCha crates of snow's default resolver are not built.
ring = "0.17"
zeroize = "1"
snow = { version = "0.10", default-features = false, features = ["ring-resolver"] }
curve25519-dalek = { version = "4.1.3", default-features = false, features = ["zeroize"] }
# Unpacking a fetched page (commands/web_body.rs): a server may pack its answer
# with gzip, deflate, brotli or zstd whether the request asks for it or not.
# All three are in the build already (png brings flate2, tauri-utils brings
# brotli, zip brings zstd), with exactly these features, so naming them adds
# no crate and no feature to any target.
brotli = { version = "8", default-features = false, features = ["std"] }
zstd = { version = "0.14.3", default-features = false }
local-ip-address = "0.6"
socket2 = "0.5"
# Structured tracing — used for the JSON-log mode behind `LU_LOG_FORMAT=json`
# (the web app Phase 3 parity). Default formatter is the compact text layer so
# the existing console output stays readable for a desktop user.
# Local time with a real UTC offset for the agent's get_current_time tool.
# Already resolved in the lock (jsonwebtoken pulls it with `clock` +
# iana-time-zone), so declaring it directly adds no crate to the build.
chrono = { version = "0.4", default-features = false, features = ["clock", "std"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
# Audit #01 — the rolling log FILE. A shipped desktop app has no stdout, so
# until this crate arrived every line the app produced was thrown away and a
# user's crash left no artefact to ask for. 0.2 is the series that pairs with
# tracing-subscriber 0.3 (it re-exports `MakeWriter` from it); `max_log_files`
# needs >= 0.2.3.
tracing-appender = "0.2"
# GH #183: reads the extra_model_paths.yaml files ComfyUI itself reads
# (commands/comfy_user_paths.rs). Was a dev-dependency for the tests of
# custom_models.rs; same locked version.
serde_yaml = "0.9.34"
# web_fetch (commands/search.rs) reads a page the way Firefox Reader View
# does: a port of Mozilla Readability (MIT). 0.17 on purpose: it builds on
# dom_query 0.27, which wry already brings, so no second copy of html5ever.
dom_smoothie = "0.17"
# The native layer of the phones: secure storage, share and save, device
# facts, lifecycle, deep links, the Remote transport, background downloads
# (plugins/lu-native, mobile-docs/NATIVE-SCHICHT.md). It is only REGISTERED on
# Android and iOS (lib.rs). It is a dependency of every target because the
# code that translates between its download list and the app's own
# (commands/download_mobile.rs) is tested on the desktop.
tauri-plugin-lu-native = { path = "plugins/lu-native" }

# ── Desktop only ─────────────────────────────────────────────────────────────
# Nothing in this block exists on a phone. Checked for aarch64-apple-ios-sim
# (mobile-docs/IOS-MACHBARKEIT.md 7.1 and 7.2): `tauri::tray` is missing, the
# single-instance crate is empty there, `rfd` and `trash` do not compile, and
# the updater has nothing to install because updates come through the store.
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri = { version = "2", features = ["devtools", "tray-icon"] }
# Pinned: 2.12.0 is the first with `requireSignedVersion` (tauri.conf.json),
# which binds a signature to the version latest.json announces; the CLI writes
# that version into the signature since 2.11.5. 2.13 asks for tauri 2.12.
tauri-plugin-updater = "=2.12.0"
# `deep-link`: a second start that carries a locallyuncensored:// link
# (Windows, Linux) hands the link to the deep-link plugin of the running app.
tauri-plugin-single-instance = { version = "2", features = ["deep-link"] }
# locallyuncensored://open-model, Hugging Face's "Use this model" (hf_link.rs).
# The same pinned version the phones use below, so no crate enters the lock.
tauri-plugin-deep-link = "=2.4.10"
# Native open and save dialogs.
rfd = "0.15"
# Gallery delete moves the render to the Recycle Bin / Trash instead of
# erasing it (Discord 2026-09-25: deleted renders stayed in ComfyUI/output).
trash = "5"
# Exactly the line every platform had before the split: reqwest's defaults,
# which means the system TLS stack.
reqwest = { version = "0.12", features = ["stream", "blocking", "json", "multipart"] }
# Astra computer use (commands/computer). enigo (MIT) simulates mouse and
# keyboard on all three systems; on Linux only its pure Rust X11 backend, so
# the build needs no libxdo and no Wayland libraries. It does link
# libxkbcommon there (the workflows install libxkbcommon-dev; at run time the
# library is already present wherever GTK is).
enigo = { version = "0.6", default-features = false, features = ["x11rb"] }
# The global stop shortcut of computer use (MIT OR Apache-2.0). Held below 2.4
# on purpose: 2.4 asks for tauri 2.12 and would move the whole app with it.
tauri-plugin-global-shortcut = ">=2.3, <2.4"
# Watchers (watchers.rs): a notification of the system when a watcher ran,
# also with the window in the tray. tauri-apps/plugins-workspace, MIT OR
# Apache-2.0, crates.io since 05/2023. Pinned: 2.4.0 (31.08.2026) is the
# newest that asks for tauri 2.10 and not 2.12, like the shortcut above. Only
# Rust calls it; the page gets no permission for it.
tauri-plugin-notification = "=2.4.0"

# ── Android and iOS ──────────────────────────────────────────────────────────
[target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies]
# rustls on both phones. On Android there is no choice (openssl-sys does not
# cross-compile for aarch64-linux-android); iOS could use the system stack,
# but one TLS implementation for both keeps the two builds behaving alike.
# The rest is reqwest's default feature set minus the TLS part.
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls", "charset", "http2", "stream", "blocking", "json", "multipart"] }
# The in-process engine: llama.cpp compiled into the app, behind the same
# HTTP surface the desktop sidecar has (commands/engine_inproc.rs).
#
# Both crates are pinned with `=` and they must carry the SAME version.
# llama-cpp-2 asks for llama-cpp-sys-2 with a caret range, and 0.1.154 does
# not compile against the 0.1.159 a fresh resolve picks (wrong argument counts
# in llama_rs_fit_params and llama_sampler_init_dry). Naming the sys crate here
# is what holds it in place.
# Guard: src/lib/__tests__/mobile-bau-fallen.test.ts
#
# default-features off drops `openmp` and `android-shared-stdcxx`. `common`
# carries the chat templates. There is no `metal` feature to set: on Apple
# targets llama-cpp-sys-2 always builds Metal in, and the switch between card
# and processor is a runtime one (n_gpu_layers).
llama-cpp-2 = { version = "=0.1.154", default-features = false, features = ["common"] }
llama-cpp-sys-2 = { version = "=0.1.154", default-features = false, features = ["common"] }
# Streaming UTF-8 decoder for the token-by-token output: one character can
# span two tokens. The same crate llama-cpp-2 uses for it.
encoding_rs = "0.8"
# lu://oauth/callback and lu://remote: the intent filters of the Android
# manifest and the URL scheme of the iOS Info.plist are written by this
# plugin's build script from tauri.android.conf.json and tauri.ios.conf.json.
# Pinned: 2.6 asks for tauri 2.12, the app is on 2.10.
# Guard: src/lib/__tests__/android-manifest-security.test.ts
tauri-plugin-deep-link = "=2.4.10"

# ── Android only ─────────────────────────────────────────────────────────────
[target.'cfg(target_os = "android")'.dependencies]
# libc++ linked statically into the app library, so the APK needs no
# libc++_shared.so next to it. The feature only acts on Android.
llama-cpp-2 = { version = "=0.1.154", default-features = false, features = ["common", "static-stdcxx"] }
# stdout does not exist on Android. Log lines go to logcat under the tag "LU".
tracing-android = "0.2"

# ── macOS, only with the feature `inproc-engine` ─────────────────────────────
# The same three crates as on the phones, optional, for the Metal test on a
# Mac. See the feature above.
[target.'cfg(target_os = "macos")'.dependencies]
llama-cpp-2 = { version = "=0.1.154", default-features = false, features = ["common"], optional = true }
llama-cpp-sys-2 = { version = "=0.1.154", default-features = false, features = ["common"], optional = true }
encoding_rs = { version = "0.8", optional = true }
# Which app a window belongs to, for computer use. Both are already in
# Cargo.lock through tauri and xcap (MIT). libc, which computer use also names
# on macOS, is declared once for every unix below, with its exact pin.
objc2-app-kit = { version = "0.3", default-features = false, features = ["NSRunningApplication", "libc", "NSImage", "NSImageRep", "NSBitmapImageRep"] }
# The LU browser (commands/browser.rs, P-L 3.1.0): read a page in our own
# JavaScript world and take its picture. Both crates are in Cargo.lock already
# through wry, same versions; named here only for the WKWebView calls Tauri
# 2.10 does not expose (it has no eval with an answer).
objc2-web-kit = { version = "0.3", default-features = false, features = ["std", "block2", "objc2-app-kit", "WKWebView", "WKContentWorld", "WKFrameInfo", "WKSnapshotConfiguration"] }
block2 = "0.6"
objc2-foundation = { version = "0.3", default-features = false, features = ["NSString", "NSURL", "NSArray", "NSData", "NSDictionary", "NSError", "NSIndexSet"] }

# Remove Background on a Mac (commands/mlx_cutout): the subject mask comes
# from the Vision framework of macOS 14, so the cutout needs no model and no
# Python. objc2 is in Cargo.lock already; objc2-vision is new and, like its
# siblings, Zlib OR Apache-2.0 OR MIT. objc2-core-video reads the mask buffer
# and is in Cargo.lock through xcap.
objc2 = "0.6"
objc2-vision = { version = "0.3", default-features = false, features = ["std", "VNRequestHandler", "VNRequest", "VNObservation", "VNGenerateForegroundInstanceMaskRequest", "objc2-core-video", "objc2-image-io"] }
objc2-core-video = { version = "0.3", default-features = false, features = ["std", "CVBase", "CVBuffer", "CVImageBuffer", "CVPixelBuffer", "CVReturn"] }
objc2-image-io = { version = "0.3", default-features = false, features = ["std", "CGImageProperties"] }

# ── Every unix ───────────────────────────────────────────────────────────────
# statvfs for the free-space check (src/disk.rs). Only the phones use it in
# production, where sysinfo's disk list reads the wrong file system inside the
# app sandbox and refused every download on the old Android branch. It is
# declared for every unix so the desktop test run executes the same function.
# The crate is in every build already (tokio, sysinfo and others pull it in).
#
# The exact version is the point. sysinfo 0.33.1 stops compiling for iOS with
# libc 0.2.190 (`unresolved import libc::mach_task_self`), and the lock file
# is shared by every target, so this pin is what keeps a `cargo update` from
# pulling the newer libc in. Raise it together with sysinfo, never alone.
# Guard: src/lib/__tests__/mobile-bau-fallen.test.ts
[target.'cfg(unix)'.dependencies]
libc = "=0.2.183"

[target.'cfg(windows)'.dependencies]
# The LU browser (commands/browser.rs, P-L 3.1.0): ExecuteScript with its
# answer and CapturePreview of WebView2. Both in Cargo.lock already through
# wry, same versions.
webview2-com = "0.38"
windows = { version = "0.61", features = ["Win32_System_Com", "Win32_UI_Shell"] }
windows-sys = { version = "0.59", features = ["Win32_System_JobObjects", "Win32_System_Threading", "Win32_Foundation", "Win32_Security", "Win32_Storage_FileSystem", "Win32_UI_WindowsAndMessaging", "Win32_UI_HiDpi", "Win32_UI_Input_KeyboardAndMouse", "Win32_Graphics_Gdi", "Win32_Graphics_Dwm"] }
# The accessibility tree for computer use (Apache-2.0). "input" is the one
# feature its core module does not compile without.
uiautomation = { version = "0.25", default-features = false, features = ["input"] }
# Registry access for LM Studio install-path lookup (Bug #2 — system-wide
# installs in C:\Program Files\LM Studio that a user reported on v2.4.3).
winreg = "0.55"

# OS keychain for provider API keys (H5). Windows Credential Manager + macOS
# Keychain only — both backends are built into the OS, so no extra system
# libraries are pulled in. Deliberately NOT on Linux: the secret-service
# backend needs libdbus/gnome-keyring and fails on headless/minimal desktops,
# so Linux keeps the obfuscated-localStorage path (the frontend falls back when
# the secret_* commands report unsupported). default-features off avoids the
# crate's sync-secret-service default.
[target.'cfg(any(target_os = "windows", target_os = "macos"))'.dependencies]
keyring = { version = "3", default-features = false, features = ["apple-native", "windows-native"] }

# Screen capture and the window list for computer use (Apache-2.0). Not on
# Linux: there xcap pulls in PipeWire, D-Bus and Wayland libraries at build
# time, and LU reads X11 itself through x11rb instead.
[target.'cfg(any(windows, target_os = "macos"))'.dependencies]
xcap = "0.9"

# The X11 client enigo already brings (MIT OR Apache-2.0), named here for the
# "randr" feature: monitors, capture and the window list of computer use.
[target.'cfg(target_os = "linux")'.dependencies]
x11rb = { version = "0.13", features = ["randr"] }
# The web view on Linux, already in Cargo.lock through tauri and wry. Only for
# answering its microphone requests (src/linux_media.rs, GitHub #162).
webkit2gtk = "=2.0.2"
# The Secret Service client for the keychain commands on Linux (GitHub #226):
# GNOME Keyring, KWallet 6, KeePassXC and every other org.freedesktop.secrets
# provider. MIT OR Apache-2.0, by the keyring-rs maintainers. Pure Rust over the
# zbus 5 that rfd and the single-instance plugin already bring, so no libdbus
# or libsecret at build or run time. crypto-rust: the secret crosses the bus
# encrypted (dh-ietf1024-sha256-aes128-cbc-pkcs7), as libsecret does it.
# keyring 3's own Linux features were no option: its async backend wants zbus 4
# (a second copy of the bus stack), its sync one links libdbus.
secret-service = { version = "=5.2.0", default-features = false, features = ["rt-tokio-crypto-rust"] }

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