pub enum Commands {
Show 29 variants
Run {Show 31 fields
source: String,
positional_prompt: Option<String>,
input: Option<PathBuf>,
prompt: Option<String>,
max_tokens: usize,
stream: bool,
language: Option<String>,
task: Option<String>,
format: String,
no_gpu: bool,
gpu: bool,
offline: bool,
benchmark: bool,
trace: bool,
trace_steps: Option<Vec<String>>,
trace_verbose: bool,
trace_output: Option<PathBuf>,
trace_level: String,
trace_payload: bool,
profile: bool,
chat: bool,
temperature: f32,
top_k: usize,
top_p: Option<f32>,
seed: u64,
repeat_penalty: f32,
repeat_last_n: usize,
split_prompt: bool,
batch_jsonl: Option<PathBuf>,
verbose: bool,
backend: Option<String>,
},
Serve {
command: ServeCommands,
},
Inspect {
file: PathBuf,
vocab: bool,
filters: bool,
weights: bool,
json: bool,
},
Debug {
file: PathBuf,
drama: bool,
hex: bool,
strings: bool,
limit: usize,
},
Validate {
file: PathBuf,
quality: bool,
strict: bool,
min_score: Option<u8>,
},
ValidateManifest {
file: PathBuf,
artifact: Option<PathBuf>,
live: bool,
},
Diff {
file1: PathBuf,
file2: PathBuf,
weights: bool,
values: bool,
filter: Option<String>,
limit: usize,
transpose_aware: bool,
json: bool,
},
Tensors {
file: PathBuf,
stats: bool,
filter: Option<String>,
limit: usize,
json: bool,
},
Trace {
file: PathBuf,
layer: Option<String>,
reference: Option<PathBuf>,
json: bool,
verbose: bool,
payload: bool,
diff: bool,
interactive: bool,
save_tensor: Option<String>,
save_tensor_dir: Option<PathBuf>,
save_tensor_layers: String,
},
Lint {
file: PathBuf,
},
Explain {
code_or_file: Option<String>,
file: Option<PathBuf>,
tensor: Option<String>,
kernel: bool,
json: bool,
verbose: bool,
proof_status: bool,
},
Canary {
command: CanaryCommands,
},
Export {
file: Option<PathBuf>,
format: String,
output: Option<PathBuf>,
quantize: Option<String>,
list_formats: bool,
batch: Option<String>,
json: bool,
plan: bool,
},
Import {
source: String,
output: Option<PathBuf>,
arch: String,
quantize: Option<String>,
strict: bool,
preserve_q4k: bool,
tokenizer: Option<PathBuf>,
enforce_provenance: bool,
allow_no_config: bool,
},
Pull {
model_ref: String,
repo: Option<String>,
force: bool,
dry_run: bool,
revision: Option<String>,
offline: bool,
include: Vec<String>,
output: Option<PathBuf>,
},
Registry {
command: RegistryCommands,
},
List,
Rm {
model_ref: String,
},
Convert {
file: PathBuf,
quantize: Option<String>,
compress: Option<String>,
output: PathBuf,
force: bool,
},
Stamp {
file: PathBuf,
license: Option<String>,
data_source: Option<String>,
data_license: Option<String>,
output: PathBuf,
force: bool,
},
Compile {
file: Option<PathBuf>,
output: Option<PathBuf>,
target: Option<String>,
quantize: Option<String>,
release: bool,
strip: bool,
lto: bool,
list_targets: bool,
},
Merge {
files: Vec<PathBuf>,
strategy: String,
output: Option<PathBuf>,
weights: Option<Vec<f32>>,
base_model: Option<PathBuf>,
drop_rate: f32,
density: f32,
seed: u64,
plan: bool,
},
Quantize {
file: PathBuf,
scheme: String,
output: Option<PathBuf>,
format: Option<String>,
batch: Option<String>,
plan: bool,
force: bool,
},
ModelOps(ModelOpsCommands),
Mcp {},
Tui {
file: Option<PathBuf>,
},
Check {
file: PathBuf,
no_gpu: bool,
json: bool,
},
Gpu {
json: bool,
},
Extended(ExtendedCommands),
}Variants§
Run
Run model directly (auto-download, cache, execute)
Fields
trace_level: StringTrace detail level (none, basic, layer, payload, chrome) “chrome” outputs chrome://tracing JSON integrating layer trace + brick profile. F-CLIPARITY-01 / PMAT-386 / paiml/aprender#574
chat: boolApply chat template for Instruct models (GAP-UX-001)
Wraps prompt in ChatML format for Qwen2, LLaMA, Mistral Instruct models. Format: <|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n
top_p: Option<f32>Top-p nucleus sampling (0.0 = disabled). When set with –top-k, applies top-k first then top-p. F-CLIPARITY-01 / PMAT-381 / paiml/aprender#569
seed: u64RNG seed for deterministic sampling (default: 299792458, matching Candle) F-CLIPARITY-01 / PMAT-382 / paiml/aprender#570
repeat_penalty: f32Repetition penalty (1.0 = no penalty, >1.0 penalizes repeats) F-CLIPARITY-01 / PMAT-383 / paiml/aprender#571
repeat_last_n: usizeContext window for repetition penalty (number of recent tokens to check) F-CLIPARITY-01 / PMAT-384 / paiml/aprender#571
split_prompt: boolProcess prompt tokens one-by-one instead of batched prefill. Useful for debugging prefill correctness (comparing per-token attention). F-CLIPARITY-01 / PMAT-385 / paiml/aprender#572
Serve
Inference server (plan/run)
Fields
command: ServeCommandsInspect
Inspect model metadata, vocab, and structure
Fields
Debug
Simple debugging output (“drama” mode available)
Fields
Validate
Validate model integrity and quality
Fields
ValidateManifest
Validate a publish manifest (FALSIFY-PM-001..006).
Contract: contracts/publish-manifest-v1.yaml
Spec: SPEC-SHIP-TWO-001 §12.3 AC-EX-004
Fields
Diff
Compare two models
Fields
Tensors
List tensor names and shapes
Fields
Trace
Layer-by-layer trace analysis
Fields
save_tensor: Option<String>Save per-stage F32 tensors during trace for SHIP-007 layer-0
element-wise diff. Comma-separated stage names from
apr-cli-trace-save-tensor-v1.yaml (e.g.
embedding,qkv_matmul,attention). Pass all to save every
stage. Output goes to --save-tensor-dir if provided,
else <file_dir>/trace-tensors/<run_id>/.
Lint
Check for best practices and conventions
Explain
Explain errors, architecture, tensors, and kernel dispatch
Fields
Canary
Manage canary tests for regression
Fields
command: CanaryCommandsExport
Export model to other formats
Fields
Import
Import from external formats (hf://org/repo, local files, URLs)
Fields
arch: StringModel architecture (whisper, llama, bert, qwen2, qwen3, gpt2, starcoder, gpt-neox, opt, phi, gemma, falcon, mamba, t5, auto)
preserve_q4k: boolPreserve Q4K quantization for fused kernel inference (GGUF only) Uses realizar’s Q4K converter instead of dequantizing to F32
tokenizer: Option<PathBuf>PMAT-232: External tokenizer.json for weights-only GGUF files. Required if the GGUF has no embedded tokenizer vocabulary.
Pull
Download and cache model OR HuggingFace dataset (Ollama-like UX)
Fields
model_ref: StringModel reference (alias, hf:// URI, or org/repo) OR “dataset”
asset-type discriminator. When this value is the literal
string “dataset”, the next positional repo is the
HuggingFace dataset repo and dataset-pull semantics apply.
repo: Option<String>Dataset repository (used only when model_ref == “dataset”).
Per apr-cli-pull-dataset-v1.yaml.
dry_run: boolCRUX-A-01: resolve short name to canonical URL and exit without performing any network I/O.
revision: Option<String>CRUX-A-03: pin to a specific branch, tag, or git SHA on the remote (HuggingFace Hub). Defaults to “main” when omitted.
offline: boolCRUX-A-20: offline mode — forbid any outbound network I/O. Equivalent to APR_OFFLINE=1 or HF_HUB_OFFLINE=1 in the environment.
Registry
Registry operations (CRUX-A-01): inspect alias map, etc.
Fields
command: RegistryCommandsList
List cached models
Rm
Remove model from cache
Convert
Convert/optimize model
Fields
Stamp
Stamp provenance fields (license, data_source, data_license) onto an existing .apr file
SHIP-009 full-discharge enabler — patches the three provenance fields on a pre-built APR v2 artifact (e.g., the shipped MODEL-1 teacher whose fields are all (missing) because it was built before GATE-APR-PROV-001..003 shipped). Tensor bytes and header flags are preserved verbatim.
Fields
Compile
Compile model into standalone executable (APR-SPEC §4.16)
Fields
Merge
Merge multiple models
Fields
Quantize
Quantize model weights (GH-243)
Fields
ModelOps(ModelOpsCommands)
Model optimization commands (fine-tune, prune, distill)
Mcp
Start the MCP (Model Context Protocol) server over stdio
Exposes apr as MCP tools for Claude Code, Cursor, Cline, and other
MCP clients. Configure via .mcp.json with {"command":"apr","args":["mcp"]}.
Tui
Interactive terminal UI
Check
Model self-test: 10-stage pipeline integrity check (APR-TRACE-001)
Fields
Gpu
GPU status and VRAM reservation management (GPU-SHARE-001)
Extended(ExtendedCommands)
Extended analysis, profiling, QA, and visualization commands
Trait Implementations§
Source§impl FromArgMatches for Commands
impl FromArgMatches for Commands
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for Commands
impl Subcommand for Commands
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Freeze for Commands
impl RefUnwindSafe for Commands
impl Send for Commands
impl Sync for Commands
impl Unpin for Commands
impl UnsafeUnpin for Commands
impl UnwindSafe for Commands
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.