Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.
[package]
name = "Jan"
version = "0.8.8"
description = "Use offline LLMs with your own data. Run open source models like Llama2 or Falcon on your internal computers/servers."
authors = ["Jan <[email protected]>"]
license = "Apache-2.0"
repository = "https://github.com/janhq/jan"
edition = "2021"
# 1.88 is the floor: `agent-client-protocol` (the experimental `jan acp`
# server) declares it. Before that, 1.85 was the floor because `genai` (the
# OpenAI upstream client) is edition 2024, and 1.82 before that, for
# `Option::is_none_or` in agent/loop.rs.
rust-version = "1.88"
resolver = "2"
default-run = "Jan-Desktop"
[lib]
name = "app_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[[bin]]
name = "Jan-Desktop"
path = "src/main.rs"
required-features = ["desktop"]
# The headless `jan` CLI is a separate standalone crate (jan-cli/), not a
# [[bin]] here: tauri-cli bundles every [[bin]] regardless of required-features,
# so a `jan` target would make the desktop bundler try to copy a binary the
# desktop build never compiles. It is deliberately NOT a workspace member -- the
# desktop build renames this package (`ctoml package.name "Jan-<channel>"`) and a
# member would then fail to resolve its `package = "Jan"` dependency.
[features]
default = [
"tauri/wry",
"tauri/common-controls-v6",
"tauri/x11",
"tauri/protocol-asset",
"tauri/macos-private-api",
"tauri/tray-icon",
"tauri/test",
"tauri/custom-protocol",
"desktop",
]
hardware = ["dep:tauri-plugin-hardware"]
# Runtime-installed extensions (install pipeline, entry reads, extension
# network). Desktop only: not part of the CLI or mobile builds.
extensions = ["dep:tauri-plugin-extensions"]
deep-link = ["dep:tauri-plugin-deep-link"]
# WebDriver e2e only. Runs an embedded WebDriver server inside the app so
# @wdio/tauri-service can drive it. Required on macOS, where no WKWebView driver
# exists to attach from outside; used on Linux too so both platforms exercise
# one path. Opt-in so release builds never ship a remote-control listener.
e2e = ["dep:tauri-plugin-wdio-webdriver"]
# MLX (tauri-plugin-mlx) is Apple-Silicon-only; it's a macOS-target dependency
# (see [target.'cfg(target_os = "macos")'.dependencies]) rather than a feature.
desktop = [
"deep-link",
"extensions",
"hardware",
"tauri-app",
]
# Everything that makes this crate a Tauri application: the framework, its
# plugins, and the native GUI helpers (file dialogs, GTK, D-Bus). The headless
# `jan` CLI builds without this feature and links no GUI crate -- gtk/gdk enter
# the graph through `tauri` itself (via muda), so the dependency must be absent,
# not merely unused.
tauri-app = [
"dep:tauri",
"dep:tauri-build",
"dep:tauri-plugin-http",
"dep:tauri-plugin-llamacpp",
"dep:tauri-plugin-log",
"dep:tauri-plugin-opener",
"dep:tauri-plugin-notification",
"dep:tauri-plugin-os",
"dep:tauri-plugin-rag",
"dep:tauri-plugin-shell",
"dep:tauri-plugin-store",
"dep:tauri-plugin-mlx",
"dep:tauri-plugin-updater",
"dep:tauri-plugin-single-instance",
"dep:tauri-plugin-dialog",
"dep:fix-path-env",
"dep:rfd",
"dep:gtk",
"dep:zbus",
"tauri-plugin-vector-db/tauri",
"tauri-plugin-websearch/tauri",
"tauri-plugin-agent-tools/tauri",
]
mobile = [
"tauri/protocol-asset",
"tauri/test",
"tauri/wry",
"dep:sqlx",
"tauri-app",
]
test-tauri = [
"tauri-app",
"tauri/wry",
"tauri/x11",
"tauri/protocol-asset",
"tauri/macos-private-api",
"tauri/tray-icon",
"tauri/test",
"deep-link",
"extensions",
"hardware",
]
cli = ["dep:env_logger", "dep:agent-client-protocol", "dep:indicatif", "dep:console", "dep:ratatui", "dep:unicode-width", "dep:pulldown-cmark", "dep:syntect", "dep:comfy-table", "dep:arboard", "dep:png"]
[build-dependencies]
tauri-build = { version = "2.0.2", features = [], optional = true }
serde_json = "1.0"
[dependencies]
dirs = "6.0.0"
# Canonical paths without Windows' `\\?\` prefix, which git reads as a URL
# or refuses (`worktree add`); a no-op elsewhere.
dunce = "1.0"
# The protocol types derive JSON Schema from themselves: `jan cli agent schema`
# is generated, never hand-written, so a consumer validates against the types
# rather than against a copy of them.
schemars = "1"
async-trait = "0.1"
env = "1.0.1"
fix-path-env = { git = "https://github.com/tauri-apps/fix-path-env-rs", optional = true }
flate2 = "1.0"
form_urlencoded = "1.2"
futures-util = "0.3.31"
hex = "0.4"
hmac = "0.12"
hyper = { version = "1", features = ["server", "http1"] }
hyper-util = { version = "0.1", features = ["tokio"] }
http-body-util = "0.1"
tokio-stream = "0.1"
jan-utils = { path = "./utils" }
log = "0.4"
# Pulled in by rmcp's `auth` feature; used directly for `TokenResponse`
# accessors on the persisted token record (`core::mcp::oauth`).
oauth2 = "5.0"
rand = "0.8"
# Both directions: `client` + the http/child-process client transports consume
# other people's servers (`core::mcp::helpers`), while `server`,
# `transport-io` and `transport-streamable-http-server` serve Jan's own toolset
# (`core::mcp::server`). The server side is Tauri-free so it builds in the `cli`
# feature config too.
rmcp = { version = "3.2.0", features = [
"auth",
"client",
"server",
"transport-io",
"transport-streamable-http-client",
"transport-streamable-http-client-reqwest",
"transport-streamable-http-server",
"transport-child-process",
"tower",
"reqwest",
] }
# Advisory lock on a session file (`agent::session_log`): one writer per
# thread across processes (flock / LockFileEx).
fs4 = "1"
serde = { version = "1.0", features = ["derive"] }
# `raw_value` keeps a JSON number as the text the server sent. Money fields in
# the Tokamak usage API must round-trip exactly, and a plain parse routes every
# number through f64 (see core/cli/tokamak/usage.rs).
# `float_roundtrip` makes a parsed double equal the one that was written; the
# default parser can be one ULP off, which breaks byte-stable thread storage
# and the Cowork migration's read-back check.
serde_json = { version = "1.0", features = ["raw_value", "float_roundtrip"] }
serde_yaml = "0.9.34"
toml = "0.8"
toml_edit = "0.23"
sha2 = "0.10"
tar = "0.4"
zip = "9"
tauri-plugin-deep-link = { version = "2", optional = true }
tauri-plugin-wdio-webdriver = { version = "1.5", optional = true }
tauri-plugin-hardware = { path = "./plugins/tauri-plugin-hardware", optional = true }
tauri-plugin-extensions = { path = "./plugins/tauri-plugin-extensions", optional = true }
tauri-plugin-llamacpp = { path = "./plugins/tauri-plugin-llamacpp", optional = true }
# The CLI consumes only these plugins' tauri-free cores (`db`, `provider`, the
# agent toolset); the desktop feature turns their Tauri command surface back on.
tauri-plugin-vector-db = { path = "./plugins/tauri-plugin-vector-db", default-features = false }
tauri-plugin-rag = { path = "./plugins/tauri-plugin-rag", optional = true }
tauri-plugin-websearch = { path = "./plugins/tauri-plugin-websearch", default-features = false }
tauri-plugin-agent-tools = { path = "./plugins/tauri-plugin-agent-tools", default-features = false }
# `default-features = false` drops the plugin's default `rustls-tls` (bundled
# Mozilla roots) so `native-tls` reads the OS trust store instead. Other
# features re-list the plugin's defaults so behaviour is otherwise unchanged.
# `macos-system-configuration` is reqwest's legacy alias for `system-proxy` —
# cross-platform-safe; native deps are target-gated by Cargo.
tauri-plugin-http = { version = "2", optional = true, default-features = false, features = [
"native-tls",
"http2",
"charset",
"macos-system-configuration",
"cookies",
"unsafe-headers",
] }
tauri-plugin-log = { version = "2.0.0-rc", optional = true }
tauri-plugin-opener = { version = "2.2.7", optional = true }
tauri-plugin-notification = { version = "2.8.1", optional = true }
tauri-plugin-os = { version = "2.2.1", optional = true }
tauri-plugin-shell = { version = "2.2.0", optional = true }
tauri-plugin-store = { version = "2", optional = true }
sqlx = { version = "0.8", features = ["runtime-tokio", "sqlite"], optional = true }
thiserror = "2.0.12"
tokio = { version = "1", features = ["full"] }
tokio-util = "0.7.14"
url = "2.5"
uuid = { version = "1.7", features = ["v4"] }
rfd = { version = "0.15.4", optional = true, default-features = false, features = [
"tokio",
"xdg-portal",
"common-controls-v6",
] }
chrono = { version = "0.4", features = ["serde"] }
ed25519-dalek = { version = "2.1", features = ["rand_core"] }
futures = "0.3"
hostname = "0.4"
base64 = "0.22"
glob = "0.3"
regex = "1"
ignore = "0.4"
clap = { version = "4", features = ["derive"] }
env_logger = { version = "0.11", optional = true }
# The experimental `jan acp` server (core/cli/acp.rs). Stable ACP wire protocol
# v1 only: no `unstable_*` feature, since those are drafts a client may not
# have negotiated. The crate version is a library version, not the wire version.
agent-client-protocol = { version = "2.2.0", default-features = false, optional = true }
indicatif = { version = "0.17", optional = true }
console = { version = "0.15", optional = true }
# The Secret Service backend must be `async-secret-service` (zbus, pure Rust),
# not `sync-secret-service`: the latter pulls `libdbus-sys`, whose `DT_NEEDED`
# on libdbus-1.so.3 is resolved before `main`, so a headless host without the
# D-Bus runtime cannot even exec `jan` -- the encrypted-file fallback in
# `core::server::provider_secrets` never gets a chance to run. `async-io`
# rather than `tokio`: zbus's `tokio` `block_on` drives a runtime of its own,
# which panics when called from inside one, and the keyring is read from async
# CLI paths.
keyring = { version = "3", features = [
"apple-native",
"windows-native",
"async-secret-service",
"async-io",
"crypto-rust",
] }
aes-gcm = "0.10"
machine-uid = "0.5"
ratatui = { version = "0.30", optional = true, features = ["unstable-rendered-line-info"] }
# Display width for the TUI's own truncation: a CJK glyph or emoji is two
# cells wide, so counting chars overflows a bordered panel. Already in the graph
# via ratatui; named here because this crate calls it directly.
unicode-width = { version = "0.2", optional = true }
# Grapheme clusters for the `wave` glyph cap: `👁️🗨️` is one thing a person sees
# but five `char`s, so the 3-glyph limit has to count clusters or it rejects a
# single emoji. Not optional -- `global_config` builds for desktop too. Already
# compiled in both graphs via ratatui/comfy-table, so this adds no build cost.
unicode-segmentation = "1"
pulldown-cmark = { version = "0.13", optional = true, default-features = false }
# `regex-fancy` keeps this pure Rust: the default `onig` backend links libonig,
# which the headless CLI must not pull in. The raw `.sublime-syntax`/`.tmTheme`
# loaders (plist, yaml-rust, html) are off -- only the bundled dumps are used.
syntect = { version = "5.3", optional = true, default-features = false, features = [
"parsing",
"default-syntaxes",
"default-themes",
"regex-fancy",
] }
comfy-table = { version = "7.2", default-features = false, optional = true }
arboard = { version = "3", optional = true, features = ["wayland-data-control"] }
png = { version = "0.17", optional = true }
[dependencies.tauri]
version = "2.8.5"
optional = true
default-features = false
features = ["protocol-asset", "macos-private-api", "test"]
[dev-dependencies]
tempfile = "3.20.0"
# Snapshot tests for the agent TUI (src/core/cli/tui), so only exercised
# under the `cli` feature; dev-dependencies cannot be feature-gated.
insta = { version = "1.46", default-features = false }
[target.'cfg(unix)'.dependencies]
nix = { version = "=0.30.1", features = ["signal", "process", "resource"] }
libc = "0.2"
[target.'cfg(target_os = "linux")'.dependencies]
zbus = { version = "5", default-features = false, features = ["tokio"], optional = true }
gtk = { version = "0.18", optional = true }
[target.'cfg(windows)'.dependencies]
libc = "0.2.172"
windows-sys = { version = "0.60.2", features = ["Win32_Storage_FileSystem", "Win32_System_LibraryLoader"] }
# MLX runs only on Apple Silicon, so the plugin is built solely for macOS.
[target.'cfg(target_os = "macos")'.dependencies]
tauri-plugin-mlx = { path = "./plugins/tauri-plugin-mlx", optional = true }
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
reqwest = { version = "0.12", features = ["json", "blocking", "stream", "native-tls"] }
# TLS backend must track `reqwest` above: reqwest features are additive across the
# graph, so letting genai default to rustls would link both backends here.
genai = { version = "=0.7.0-beta.19", default-features = false, features = ["native-tls"] }
# genai is on reqwest 0.13 while the rest of the app is on 0.12, so its client
# type is a distinct crate. Aliased here solely to build the pool-tuned client
# `agent_http_client` hands to genai (see core/agent/upstream.rs).
reqwest13 = { package = "reqwest", version = "0.13", default-features = false, features = ["json", "stream", "charset", "http2", "system-proxy", "native-tls"] }
tauri-plugin-updater = { version = "2.14", optional = true }
once_cell = "1.18"
tauri-plugin-single-instance = { version = "2", features = ["deep-link"], optional = true }
# Process table for the startup sweep of engines orphaned by an in-place update
# (core/system/orphans.rs). Same version as the hardware and mlx plugins.
sysinfo = "0.34.2"
[target.'cfg(any(target_os = "android", target_os = "ios"))'.dependencies]
reqwest = { version = "0.12", features = ["json", "blocking", "stream", "rustls-tls"], default-features = false }
genai = { version = "=0.7.0-beta.19", default-features = false, features = ["rustls-tls"] }
reqwest13 = { package = "reqwest", version = "0.13", default-features = false, features = ["json", "stream", "charset", "http2", "rustls"] }
tauri-plugin-dialog = { version = "2.2.1", default-features = false, optional = true }
tauri-plugin-http = { version = "2", default-features = false, optional = true }
tauri-plugin-log = { version = "2.0.0-rc", default-features = false, optional = true }
tauri-plugin-opener = { version = "2.2.7", default-features = false, optional = true }
tauri-plugin-os = { version = "2.2.1", default-features = false, optional = true }
tauri-plugin-shell = { version = "2.2.0", default-features = false, optional = true }
tauri-plugin-store = { version = "2", default-features = false, optional = true }
# Release profile optimizations for minimal binary size
[profile.release]
opt-level = "z" # Optimize for size
lto = "fat" # Aggressive Link Time Optimization
strip = "symbols" # Strip debug symbols for smaller binary
codegen-units = 1 # Reduce parallel codegen for better optimization
panic = "unwind" # Unwind on panic, allows catching library panics
overflow-checks = false # Disable overflow checks for size
debug = false # No debug info
debug-assertions = false # No debug assertions
incremental = false # Disable incremental compilation for release
rpath = false # Don't include rpath