Skip to main content

Commands

Enum Commands 

Source
pub enum Commands {
Show 23 variants Run {
Show 22 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, verbose: bool,
}, Serve { file: PathBuf, port: u16, host: String, no_cors: bool, no_metrics: bool, no_gpu: bool, gpu: bool, batch: bool, trace: bool, trace_level: String, profile: bool, }, 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>, }, 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, }, Lint { file: PathBuf, }, Explain { code: Option<String>, file: Option<PathBuf>, tensor: Option<String>, }, Canary { command: CanaryCommands, }, Export { file: Option<PathBuf>, format: String, output: Option<PathBuf>, quantize: Option<String>, list_formats: bool, batch: Option<String>, json: 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, force: bool, }, List, Rm { model_ref: String, }, Convert { file: PathBuf, quantize: Option<String>, compress: Option<String>, output: PathBuf, force: bool, }, Merge { files: Vec<PathBuf>, strategy: String, output: PathBuf, weights: Option<Vec<f32>>, base_model: Option<PathBuf>, drop_rate: f32, density: f32, seed: u64, }, Quantize { file: PathBuf, scheme: String, output: Option<PathBuf>, format: Option<String>, batch: Option<String>, plan: bool, force: bool, }, ModelOps(ModelOpsCommands), Tui { file: Option<PathBuf>, }, Check { file: PathBuf, no_gpu: bool, json: bool, }, Extended(ExtendedCommands),
}

Variants§

§

Run

Run model directly (auto-download, cache, execute)

Fields

§source: String

Model source: local path, hf://org/repo, or URL

§positional_prompt: Option<String>

Text prompt (positional): apr run model.gguf "What is 2+2?"

§input: Option<PathBuf>

Input file (audio, text, etc.)

§prompt: Option<String>

Text prompt for generation (for LLM models)

§max_tokens: usize

Maximum tokens to generate (default: 32)

§stream: bool

Enable streaming output

§language: Option<String>

Language code (for ASR models)

§task: Option<String>

Task (transcribe, translate)

§format: String

Output format (text, json, srt, vtt)

§no_gpu: bool

Disable GPU acceleration

§gpu: bool

Force GPU acceleration

§offline: bool

Offline mode: block all network access (Sovereign AI compliance)

§benchmark: bool

Benchmark mode: output performance metrics (tok/s, latency)

§trace: bool

Enable inference tracing (APR-TRACE-001)

§trace_steps: Option<Vec<String>>

Trace specific steps only (comma-separated)

§trace_verbose: bool

Verbose tracing (show tensor values)

§trace_output: Option<PathBuf>

Save trace output to JSON file

§trace_level: String

Trace detail level (none, basic, layer, payload)

§trace_payload: bool

Shorthand for –trace –trace-level payload (tensor value inspection)

§profile: bool

Enable inline Roofline profiling (PMAT-SHOWCASE-METHODOLOGY-001)

§chat: bool

Apply 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

§verbose: bool

Show verbose output (model loading, backend info)

§

Serve

Start inference server (REST API, streaming, metrics)

Fields

§file: PathBuf

Path to model file

§port: u16

Port to listen on

§host: String

Host to bind to

§no_cors: bool

Disable CORS

§no_metrics: bool

Disable Prometheus metrics endpoint

§no_gpu: bool

Disable GPU acceleration

§gpu: bool

Force GPU acceleration (requires CUDA)

§batch: bool

Enable batched GPU inference for 2X+ throughput

§trace: bool

Enable inference tracing (PMAT-SHOWCASE-METHODOLOGY-001)

§trace_level: String

Trace detail level (none, basic, layer)

§profile: bool

Enable inline Roofline profiling (adds X-Profile headers)

§

Inspect

Inspect model metadata, vocab, and structure

Fields

§file: PathBuf

Path to .apr model file

§vocab: bool

Show vocabulary details

§filters: bool

Show filter/security details

§weights: bool

Show weight statistics

§json: bool

Output as JSON

§

Debug

Simple debugging output (“drama” mode available)

Fields

§file: PathBuf

Path to .apr model file

§drama: bool

Theatrical “drama” mode output

§hex: bool

Show hex dump

§strings: bool

Extract ASCII strings

§limit: usize

Limit output lines

§

Validate

Validate model integrity and quality

Fields

§file: PathBuf

Path to .apr model file

§quality: bool

Show 100-point quality assessment

§strict: bool

Strict validation (fail on warnings)

§min_score: Option<u8>

Minimum score to pass (0-100)

§

Diff

Compare two models

Fields

§file1: PathBuf

First model file

§file2: PathBuf

Second model file

§weights: bool

Show weight-level differences

§values: bool

Compare actual tensor values with statistical analysis

§filter: Option<String>

Filter tensors by name pattern (for –values)

§limit: usize

Maximum number of tensors to compare (for –values)

§transpose_aware: bool

Account for transpose when comparing (GGUF col-major vs APR row-major)

§json: bool

Output as JSON

§

Tensors

List tensor names and shapes

Fields

§file: PathBuf

Path to .apr model file

§stats: bool

Show tensor statistics (mean, std, min, max)

§filter: Option<String>

Filter tensors by name pattern

§limit: usize

Limit number of tensors shown (0 = unlimited)

§json: bool

Output as JSON

§

Trace

Layer-by-layer trace analysis

Fields

§file: PathBuf

Path to .apr model file

§layer: Option<String>

Filter layers by name pattern

§reference: Option<PathBuf>

Compare with reference model

§json: bool

Output as JSON

§verbose: bool

Verbose output with per-layer stats

§payload: bool

Trace payload through model

§diff: bool

Diff mode

§interactive: bool

Interactive mode

§

Lint

Check for best practices and conventions

Fields

§file: PathBuf

Path to .apr model file

§

Explain

Explain errors, architecture, and tensors

Fields

§code: Option<String>

Explain a specific error code

§file: Option<PathBuf>

Path to .apr model file (optional context)

§tensor: Option<String>

Explain a specific tensor

§

Canary

Manage canary tests for regression

Fields

§command: CanaryCommands
§

Export

Export model to other formats

Fields

§file: Option<PathBuf>

Path to .apr model file

§format: String

Output format (safetensors, gguf, mlx, onnx, openvino, coreml)

§output: Option<PathBuf>

Output file/directory path

§quantize: Option<String>

Apply quantization during export (int8, int4, fp16)

§list_formats: bool

List all supported export formats

§batch: Option<String>

Batch export to multiple formats (comma-separated: gguf,mlx,safetensors)

§json: bool

Output in JSON format

§

Import

Import from external formats (hf://org/repo, local files, URLs)

Fields

§source: String

Source: hf://org/repo, local file, or URL

§output: Option<PathBuf>

Output .apr file path (default: derived from source name)

§arch: String

Model architecture (whisper, llama, bert, auto)

§quantize: Option<String>

Quantization (int8, int4, fp16)

§strict: bool

Strict mode: reject unverified architectures and fail on validation errors

§preserve_q4k: bool

Preserve 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.

§enforce_provenance: bool

F-GT-001: Enforce provenance chain. Rejects pre-baked GGUF imports (only SafeTensors sources allowed). Ensures single-provenance testing.

§allow_no_config: bool

GH-223: Allow import without config.json (default: error). Without config.json, hyperparameters like rope_theta are inferred from tensor shapes and may be wrong, producing garbage output.

§

Pull

Download and cache model from HuggingFace (Ollama-like UX)

Fields

§model_ref: String

Model reference (alias, hf:// URI, or org/repo)

§force: bool

Force re-download even if cached

§

List

List cached models

§

Rm

Remove model from cache

Fields

§model_ref: String

Model reference to remove

§

Convert

Convert/optimize model

Fields

§file: PathBuf

Path to .apr model file

§quantize: Option<String>

Quantize to format (int8, int4, fp16, q4k)

§compress: Option<String>

Compress output (none, zstd, zstd-max, lz4)

§output: PathBuf

Output file path

§force: bool

Force overwrite existing files

§

Merge

Merge multiple models

Fields

§files: Vec<PathBuf>

Model files to merge

§strategy: String

Merge strategy (average, weighted, slerp, ties, dare)

§output: PathBuf

Output file path

§weights: Option<Vec<f32>>

Weights for weighted merge (comma-separated, e.g., “0.7,0.3”)

§base_model: Option<PathBuf>

Base model for TIES/DARE (task vectors computed as delta from base)

§drop_rate: f32

DARE drop probability (default: 0.9)

§density: f32

TIES trim density threshold (default: 0.2)

§seed: u64

RNG seed for DARE (default: 42)

§

Quantize

Quantize model weights (GH-243)

Fields

§file: PathBuf

Input model file

§scheme: String

Quantization scheme: int8, int4, fp16, q4k

§output: Option<PathBuf>

Output file path (required unless –plan)

§format: Option<String>

Output format override (apr, gguf, safetensors)

§batch: Option<String>

Batch quantization (comma-separated schemes)

§plan: bool

Plan mode (estimate only, no execution)

§force: bool

Force overwrite existing files

§

ModelOps(ModelOpsCommands)

Model optimization commands (fine-tune, prune, distill)

§

Tui

Interactive terminal UI

Fields

§file: Option<PathBuf>

Path to .apr model file

§

Check

Model self-test: 10-stage pipeline integrity check (APR-TRACE-001)

Fields

§file: PathBuf

Path to model file

§no_gpu: bool

Disable GPU acceleration

§json: bool

Output as JSON

§

Extended(ExtendedCommands)

Extended analysis, profiling, QA, and visualization commands

Trait Implementations§

Source§

impl Debug for Commands

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Commands

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Commands

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,