Skip to main content

apr_cli/
tool_commands.rs

1
2#[derive(Subcommand, Debug)]
3pub enum ToolCommands {
4    /// Qwen2.5-Coder showcase demo
5    Showcase {
6        /// Run all steps with auto-verification
7        #[arg(long)]
8        auto_verify: bool,
9        /// Run specific step
10        #[arg(long)]
11        step: Option<String>,
12        /// Model tier: tiny (0.5B), small (1.5B), medium (7B), large (32B)
13        #[arg(long, default_value = "small")]
14        tier: String,
15        /// Model directory
16        #[arg(long, default_value = "./models")]
17        model_dir: PathBuf,
18        /// Baselines to compare: llama-cpp,ollama
19        #[arg(long, default_value = "llama-cpp,ollama")]
20        baseline: String,
21        /// Enable ZRAM compression
22        #[arg(long)]
23        zram: bool,
24        /// Number of benchmark runs (spec: minimum 30)
25        #[arg(long, default_value = "30")]
26        runs: usize,
27        /// Force GPU acceleration
28        #[arg(long)]
29        gpu: bool,
30        /// Output results as JSON
31        #[arg(long)]
32        json: bool,
33        /// Verbose output
34        #[arg(short, long)]
35        verbose: bool,
36        /// Quiet mode (errors only)
37        #[arg(short, long)]
38        quiet: bool,
39    },
40    /// Rosetta Stone - Universal model format converter (PMAT-ROSETTA-001)
41    Rosetta {
42        #[command(subcommand)]
43        action: RosettaCommands,
44    },
45    /// Publish model to HuggingFace Hub (APR-PUB-001)
46    Publish {
47        /// Directory containing model files to publish
48        #[arg(value_name = "DIRECTORY")]
49        directory: PathBuf,
50        /// HuggingFace repository ID (e.g., paiml/whisper-apr-tiny)
51        #[arg(value_name = "REPO_ID")]
52        repo_id: String,
53        /// Model display name
54        #[arg(long)]
55        model_name: Option<String>,
56        /// License (SPDX identifier, default: mit)
57        #[arg(long, default_value = "mit")]
58        license: String,
59        /// Pipeline tag (e.g., automatic-speech-recognition, text-generation)
60        #[arg(long, default_value = "text-generation")]
61        pipeline_tag: String,
62        /// Library name (e.g., whisper-apr, aprender)
63        #[arg(long)]
64        library_name: Option<String>,
65        /// Additional tags (comma-separated)
66        #[arg(long, value_delimiter = ',')]
67        tags: Option<Vec<String>>,
68        /// Commit message
69        #[arg(long)]
70        message: Option<String>,
71        /// Dry run (preview without uploading)
72        #[arg(long)]
73        dry_run: bool,
74    },
75    /// Model Oracle: identify family, size, constraints, and contract compliance
76    ///
77    /// Three modes:
78    ///   apr oracle <FILE>         - Analyze local model file
79    ///   apr oracle hf://org/repo  - Query HuggingFace API
80    ///   apr oracle --family qwen2 - Describe contract from YAML
81    Oracle {
82        /// Model file path or hf:// URI
83        #[arg(value_name = "SOURCE")]
84        source: Option<String>,
85        /// Show contract for a model family (e.g., qwen2, llama, whisper, bert)
86        #[arg(long)]
87        family: Option<String>,
88        /// Filter to a specific size variant (e.g., 0.5b, 7b)
89        #[arg(long)]
90        size: Option<String>,
91        /// Run full contract compliance check
92        #[arg(long)]
93        compliance: bool,
94        /// List all tensor shapes
95        #[arg(long)]
96        tensors: bool,
97        /// Show statistical analysis (GQA, memory, FFN, FLOPS)
98        #[arg(long)]
99        stats: bool,
100        /// Show architecture explanations with literature references
101        #[arg(long)]
102        explain: bool,
103        /// Show kernel compatibility report (quantization, TPS estimates)
104        #[arg(long)]
105        kernels: bool,
106        /// Cross-validate contract against HuggingFace config.json
107        #[arg(long)]
108        validate: bool,
109        /// Enable all analysis sections (stats + explain + kernels + validate)
110        #[arg(long)]
111        full: bool,
112    },
113}