apr-cli 0.30.0

CLI tool for APR model inspection, debugging, and operations
Documentation
[package]
name = "apr-cli"
version.workspace = true
edition = "2021"
rust-version = "1.89"
authors = ["Noah Gift <noah@paiml.com>"]
license = "MIT"
description = "CLI tool for APR model inspection, debugging, and operations"
repository = "https://github.com/paiml/aprender"
documentation = "https://docs.rs/apr-cli"
readme = "README.md"
keywords = ["machine-learning", "model-inspection", "cli", "debugging"]
categories = ["command-line-utilities", "science"]
exclude = [
    "playbooks/snapshots/",
    "models/",
]

[lints.rust]
# Safety
unsafe_code = "deny"
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }

[lints.clippy]
# Base level
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }

# CLI-specific allows (relaxed for development velocity)
too_many_lines = "allow"
unnecessary_wraps = "allow"
uninlined_format_args = "allow"
needless_raw_string_hashes = "allow"
format_in_format_args = "allow"
cast_lossless = "allow"
cast_precision_loss = "allow"
cast_possible_truncation = "allow"
cast_possible_wrap = "allow"
cast_sign_loss = "allow"
fn_params_excessive_bools = "allow"
match_same_arms = "allow"
used_underscore_binding = "allow"
module_name_repetitions = "allow"
must_use_candidate = "allow"
doc_markdown = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
items_after_statements = "allow"
similar_names = "allow"
too_many_arguments = "allow"
struct_excessive_bools = "allow"
single_match_else = "allow"
wildcard_imports = "allow"
enum_glob_use = "allow"
unreadable_literal = "allow"
no_effect_underscore_binding = "allow"

[lib]
name = "apr_cli"
path = "src/lib.rs"

[[bin]]
name = "apr"
path = "src/main.rs"

[features]
# crates.io install: minimal features (inspect, validate, lint, etc.)
# Full features enabled locally via workspace Cargo.toml default-members
default = ["hf-hub", "safetensors-compare", "inference", "training", "visualization", "zram"]
hf-hub = ["aprender/hf-hub-integration"]
code = ["dep:batuta"]
dev = []  # Enable `apr mono` subcommands (publish, shims, audit, archive)
safetensors-compare = ["aprender/safetensors-compare"]
inference = ["realizar", "trueno", "tokio", "axum", "futures-util"]
cuda = ["inference", "realizar/cuda", "entrenar/cuda"]
cuda-batch = ["cuda"]
# PMAT-335: WGPU backend for AMD/Intel/Apple GPU inference via Vulkan/Metal/WebGPU
wgpu = ["inference"]
visualization = ["renacer", "trueno-viz"]
zram = ["trueno-zram-core"]
training = ["dep:entrenar", "dep:entrenar-lora"]
training-gpu = ["training"]
whisper = ["whisper-apr"]
dhat-heap = ["dep:dhat"]
full = ["inference", "cuda", "cuda-batch", "visualization", "zram", "training", "training-gpu", "code"]

[target.'cfg(unix)'.dependencies]
libc = "0.2"

[dependencies]
# Core aprender library
aprender = { path = "../aprender-core", version = "0.30.0", package = "aprender-core", default-features = true, features = ["format-compression"] }
async-stream = "0.3"
provable-contracts-macros = "0.3"

# Shared formatting and system utilities (Batuta stack)
batuta-common = "0.1"

# Sovereign coding assistant (apr code โ†’ batuta agent engine) โ€” PMAT-182
# GH-344: path dep via .cargo/config.toml.dev-overrides; CI uses checkout+symlink
batuta = { version = "0.7", optional = true, default-features = false, features = ["agents", "agents-inference", "rag"] }

# Inference engine (workspace path dep โ€” enables cuda/gpu feature forwarding)
# GH-573: shim (0.9.1) didn't forward cuda feature โ†’ 0.7 tok/s instead of 273 tok/s
realizar = { workspace = true, optional = true }

# Whisper speech recognition (GH-516: apr run --input audio.wav)
# Zero external deps โ€” our own implementation in ../whisper.apr
# GH-344: path dep via .cargo/config.toml.dev-overrides when available
whisper-apr = { version = "0.2", optional = true }

# SIMD compute library (for BrickProfiler in ยง12.11 unified profiling)
# MUST use crates.io version to match aprender's trueno dependency
# 2026-04-05 PMAT-507: bumped 0.16.0โ†’0.17 to match aprender root Cargo.toml (was diamond dep)
trueno = { version = "0.19.1", optional = true }

# Async runtime for server
tokio = { version = "1", features = ["rt-multi-thread", "macros", "signal", "sync"], optional = true }

# HTTP server (for serve command with inference feature)
axum = { version = "0.7", optional = true }

# Async streams for SSE
futures-util = { version = "0.3", optional = true }

# CLI framework
clap = { version = "4.5", features = ["derive", "env", "wrap_help"] }

# Stdout suppression for qualify command
gag = "1.0"

# Output formatting
colored = "2.1"
tabled = "0.16"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
rmp-serde = "1.3"

# Error handling
thiserror = "2.0"

# Time formatting
chrono = { version = "0.4", default-features = false, features = ["std", "clock"] }

# Human-readable sizes
humansize = "2.1"

# Temporary directories (compile command)
tempfile = "3.14"

# File/directory utilities
glob = "0.3"
dirs = "5.0"
which = "7"

# HTTP client for downloads
ureq = "2.10"

# Checksum integrity (GH-213: shard manifest checksums)
blake3 = "1"

# TUI
crossterm = "0.28"
presentar-terminal = { workspace = true }
presentar-core = { workspace = true }

# Visualization (syscall tracing and charts)
renacer = { version = "0.11", optional = true }
trueno-viz = { version = "0.3", optional = true }

# ZRAM compression (SIMD-accelerated LZ4/ZSTD)
trueno-zram-core = { version = "0.3", optional = true }

# Model registry and caching (Ollama-like model management)
pacha = { version = "0.2.4", default-features = false, features = ["remote"] }

# PTX analysis and bug detection (trueno-explain: PtxAnalyzer + PtxBugAnalyzer)
trueno-explain = { version = "0.2.2", optional = true }

# ML tuning: LoRA/QLoRA configuration and memory planning (GH-176, PMAT-184)
entrenar-lora = { version = "0.3.0", optional = true }
# ML training engine (workspace path dep โ€” enables cuda feature forwarding)
entrenar = { workspace = true, optional = true }
# Heap profiling (opt-in via --features dhat-heap)
dhat = { version = "0.3", optional = true }
# Data loading, splitting, imbalance detection (apr data subcommands)
# GH-344: path dep via .cargo/config.toml.dev-overrides; CI uses checkout+symlink
alimentar = { version = "0.2.8", default-features = false, features = ["shuffle"] }
half = "2.4.1"
# YAML config parsing (distillation configs, ALB-011)
serde_yaml = { package = "serde_yaml_ng", version = "0.10" }

[[example]]
name = "probar_tui_testing"
required-features = ["inference"]

[[example]]
name = "federation_tui_demo"
required-features = ["inference"]

[[example]]
name = "serve_with_tracing"
required-features = ["inference"]

[[example]]
name = "gpu_chat_inference"
required-features = ["inference", "cuda"]

[[example]]
name = "ptx_parity_validation"
required-features = ["inference"]

[dev-dependencies]
assert_cmd = "2.0"
predicates = "3.1"
tempfile = "3.14"
proptest = "1.6"
jugar-probar = { version = "0.4", features = ["tui"] }
regex = "1.10"
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
axum-test = "16"
tower = "0.5"