diff --git a/aarambh-studio/src/cmd/convert.rs b/aarambh-studio/src/cmd/convert.rs index 5e906ce..c28738e 100644 --- a/aarambh-studio/src/cmd/convert.rs +++ b/aarambh-studio/src/cmd/convert.rs @@ -11,21 +11,30 @@ use aarambh_studio_weights::{ use clap::Args; #[derive(Debug, Args)] +/// Convert checkpoints between HF SafeTensors and GGUF, or expand vocabularies. pub struct ConvertArgs { + /// Training/model TOML configuration (provides architecture + device). #[arg(long, default_value = "configs/tiny_shakespeare.toml")] pub config: PathBuf, + /// Source checkpoint path to convert. #[arg(long)] pub input: PathBuf, + /// Output converted checkpoint path. #[arg(long)] pub output: PathBuf, + /// HF architecture family: llama3 (used for HF -> SafeTensors migration). #[arg(long, default_value = "llama3")] pub arch: String, + /// Emit a GGUF checkpoint instead of native SafeTensors. #[arg(long)] pub gguf: bool, + /// GGUF quantisation format: q4_k_m, q5_k_m, or q8_0. #[arg(long, default_value = "q4_k_m")] pub format: String, + /// Expand the SafeTensors model with the Phase 35 video vocabulary. #[arg(long, requires = "tokenizer", requires = "output_tokenizer")] pub upgrade_video_vocab: bool, + /// Expand the SafeTensors model with the Phase 36 document vocabulary. #[arg( long, requires = "tokenizer", @@ -33,6 +42,7 @@ pub struct ConvertArgs { conflicts_with = "upgrade_video_vocab" )] pub upgrade_document_vocab: bool, + /// Expand the SafeTensors model with the Phase 42 audio vocabulary. #[arg( long, requires = "tokenizer", @@ -40,8 +50,10 @@ pub struct ConvertArgs { conflicts_with_all = ["upgrade_video_vocab", "upgrade_document_vocab"] )] pub upgrade_audio_vocab: bool, + /// Source tokenizer JSON path (required for vocabulary upgrades). #[arg(long)] pub tokenizer: Option, + /// Output tokenizer JSON path for the upgraded vocabulary. #[arg(long)] pub output_tokenizer: Option, } diff --git a/aarambh-studio/src/cmd/distill.rs b/aarambh-studio/src/cmd/distill.rs index daa9cd4..d4f9d78 100644 --- a/aarambh-studio/src/cmd/distill.rs +++ b/aarambh-studio/src/cmd/distill.rs @@ -10,6 +10,7 @@ use aarambh_studio_train::TrainingRunConfig; use clap::{Args, Subcommand}; #[derive(Debug, Args)] +/// Distil a smaller student model from a frozen local or dataset teacher. pub struct DistillArgs { #[command(subcommand)] pub command: DistillCommand, @@ -28,171 +29,252 @@ pub enum DistillCommand { } #[derive(Debug, Args)] +/// `distill train` — train a full student on fresh rollouts scored by a frozen teacher. pub struct TrainArgs { + /// Student distillation TOML configuration (architecture + train settings). #[arg(long, default_value = "configs/distill_smoke.toml")] pub config: PathBuf, + /// Student checkpoint path to fine-tune. #[arg(long)] pub student: PathBuf, + /// Optional tokenizer JSON path; falls back to the config. #[arg(long)] pub tokenizer: Option, + /// Prompts JSONL path; defaults to the config dataset path. #[arg(long)] pub prompts: Option, + /// Output adapter directory; defaults to the config checkpoint dir. #[arg(long)] pub output: Option, + /// Teacher backend: local (frozen checkpoint) or dataset (logged completions). #[arg(long, default_value = "local")] pub teacher: String, + /// Frozen teacher checkpoint path (required for --teacher local). #[arg(long)] pub teacher_model: Option, + /// Frozen teacher TOML config path (required for --teacher local). #[arg(long)] pub teacher_config: Option, + /// Teacher completions JSONL path (required for --teacher dataset). #[arg(long)] pub teacher_data: Option, + /// Override the teacher device (e.g. cpu, cuda:0, metal). #[arg(long)] pub teacher_device: Option, + /// Override the teacher dtype (e.g. f16, bf16, f32). #[arg(long)] pub teacher_dtype: Option, + /// Distillation objective: soft-kl (forward KL) or reward (GRPO-style). #[arg(long)] pub objective: Option, + /// Number of student rollouts sampled per prompt. #[arg(long, default_value_t = 4)] pub rollouts_per_prompt: usize, + /// Maximum new tokens generated per student rollout. #[arg(long, default_value_t = 128)] pub max_new_tokens: usize, + /// Sampling temperature for student rollouts. #[arg(long, default_value_t = 0.8)] pub temperature: f32, + /// Nucleus sampling probability mass for student rollouts. #[arg(long, default_value_t = 0.95)] pub top_p: f32, + /// Top-k sampling width for student rollouts. #[arg(long, default_value_t = 50)] pub top_k: usize, + /// Sampling temperature applied to the teacher distribution. #[arg(long, default_value_t = 1.0)] pub teacher_temperature: f64, + /// Maximum absolute advantage used to clip reward-weighted rollouts. #[arg(long, default_value_t = 5.0)] pub advantage_clip: f64, + /// Thinking budget: none, low, medium, high, or max. #[arg(long, default_value = "none")] pub thinking: String, + /// Training batch size. #[arg(long)] pub batch_size: Option, + /// Maximum optimiser steps (overrides max-epochs when set). #[arg(long)] pub max_steps: Option, + /// Maximum training epochs. #[arg(long)] pub max_epochs: Option, + /// Learning rate. #[arg(long)] pub lr: Option, + /// Gradient accumulation steps before an optimiser update. #[arg(long)] pub grad_accum_steps: Option, + /// Linear warmup steps before the cosine schedule. #[arg(long)] pub warmup_steps: Option, + /// Save an adapter every N optimiser steps. #[arg(long)] pub save_every_n_steps: Option, + /// Log training metrics every N optimiser steps. #[arg(long)] pub log_every_n_steps: Option, + /// Resume training from the latest adapter in the output directory. #[arg(long)] pub resume: bool, + /// Disable dataset shuffling between epochs. #[arg(long)] pub no_shuffle: bool, } #[derive(Debug, Args)] +/// `distill prepare-offline` — generate one static local-teacher completion per prompt. pub struct PrepareOfflineArgs { + /// Frozen teacher TOML config path. #[arg(long)] pub teacher_config: PathBuf, + /// Frozen teacher checkpoint path. #[arg(long)] pub teacher_model: PathBuf, + /// Optional tokenizer JSON path; falls back to the teacher config. #[arg(long)] pub tokenizer: Option, + /// Input prompts JSONL path. #[arg(long)] pub prompts: PathBuf, + /// Output JSONL path with one static teacher completion per prompt. #[arg(long)] pub output: PathBuf, + /// Override the device used to generate completions. #[arg(long)] pub device: Option, + /// Override the dtype used to generate completions. #[arg(long)] pub dtype: Option, + /// Maximum new tokens generated per prompt. #[arg(long, default_value_t = 128)] pub max_new_tokens: usize, + /// Sampling temperature for completion generation. #[arg(long, default_value_t = 0.8)] pub temperature: f32, + /// Nucleus sampling probability mass for completion generation. #[arg(long, default_value_t = 0.95)] pub top_p: f32, + /// Top-k sampling width for completion generation. #[arg(long, default_value_t = 50)] pub top_k: usize, + /// RNG seed for deterministic completion sampling. #[arg(long, default_value_t = 42)] pub seed: u64, } #[derive(Debug, Args)] +/// `distill train-offline` — train the matched static-completion offline control. pub struct TrainOfflineArgs { + /// Student distillation TOML configuration (architecture + train settings). #[arg(long, default_value = "configs/distill_smoke.toml")] pub config: PathBuf, + /// Student checkpoint path to fine-tune. #[arg(long)] pub student: PathBuf, + /// Optional tokenizer JSON path; falls back to the config. #[arg(long)] pub tokenizer: Option, + /// Static-completion JSONL produced by `distill prepare-offline`. #[arg(long)] pub data: PathBuf, + /// Output adapter directory; defaults to the config checkpoint dir. #[arg(long)] pub output: Option, + /// Training batch size. #[arg(long)] pub batch_size: Option, + /// Maximum optimiser steps (overrides max-epochs when set). #[arg(long)] pub max_steps: Option, + /// Maximum training epochs. #[arg(long)] pub max_epochs: Option, + /// Learning rate. #[arg(long)] pub lr: Option, + /// Gradient accumulation steps before an optimiser update. #[arg(long)] pub grad_accum_steps: Option, + /// Save an adapter every N optimiser steps. #[arg(long)] pub save_every_n_steps: Option, + /// Log training metrics every N optimiser steps. #[arg(long)] pub log_every_n_steps: Option, + /// Resume training from the latest adapter in the output directory. #[arg(long)] pub resume: bool, + /// Disable dataset shuffling between epochs. #[arg(long)] pub no_shuffle: bool, } #[derive(Debug, Args)] +/// `distill evaluate` — score fresh student rollouts and write alignment reports. pub struct EvaluateArgs { + /// Student distillation TOML configuration (architecture + train settings). #[arg(long, default_value = "configs/distill_smoke.toml")] pub config: PathBuf, + /// Student checkpoint path to evaluate. #[arg(long)] pub student: PathBuf, + /// Optional tokenizer JSON path; falls back to the config. #[arg(long)] pub tokenizer: Option, + /// Prompts JSONL path; defaults to the config dataset path. #[arg(long)] pub prompts: Option, + /// Teacher backend: local (frozen checkpoint) or dataset (logged completions). #[arg(long, default_value = "local")] pub teacher: String, + /// Frozen teacher checkpoint path (required for --teacher local). #[arg(long)] pub teacher_model: Option, + /// Frozen teacher TOML config path (required for --teacher local). #[arg(long)] pub teacher_config: Option, + /// Teacher completions JSONL path (required for --teacher dataset). #[arg(long)] pub teacher_data: Option, + /// Override the teacher device (e.g. cpu, cuda:0, metal). #[arg(long)] pub teacher_device: Option, + /// Override the teacher dtype (e.g. f16, bf16, f32). #[arg(long)] pub teacher_dtype: Option, + /// Distillation objective: soft-kl (forward KL) or reward (GRPO-style). #[arg(long)] pub objective: Option, + /// Number of student rollouts sampled per prompt. #[arg(long, default_value_t = 2)] pub rollouts_per_prompt: usize, + /// Maximum new tokens generated per student rollout. #[arg(long, default_value_t = 128)] pub max_new_tokens: usize, + /// Sampling temperature for student rollouts. #[arg(long, default_value_t = 0.8)] pub temperature: f32, + /// Nucleus sampling probability mass for student rollouts. #[arg(long, default_value_t = 0.95)] pub top_p: f32, + /// Top-k sampling width for student rollouts. #[arg(long, default_value_t = 50)] pub top_k: usize, + /// Sampling temperature applied to the teacher distribution. #[arg(long, default_value_t = 1.0)] pub teacher_temperature: f64, + /// Optional cap on the number of prompts evaluated. #[arg(long)] pub max_prompts: Option, + /// Optional JSON output path for the alignment report. #[arg(long)] pub out: Option, + /// Optional Markdown output path for the alignment report. #[arg(long)] pub markdown: Option, + /// RNG seed for deterministic rollout sampling. #[arg(long, default_value_t = 42)] pub seed: u64, } diff --git a/aarambh-studio/src/cmd/eval.rs b/aarambh-studio/src/cmd/eval.rs index f4bfb10..ab5b8f3 100644 --- a/aarambh-studio/src/cmd/eval.rs +++ b/aarambh-studio/src/cmd/eval.rs @@ -17,50 +17,72 @@ use serde::Deserialize; use std::str::FromStr; #[derive(Debug, Args)] +/// Evaluate a checkpoint on capability, forgetting, or KV-cache probes. pub struct EvalArgs { + /// Optional training/model TOML config (required unless --compare is used). #[arg(long)] pub config: Option, + /// Model checkpoint path; falls back to best.json/latest.json pointer. #[arg(long)] pub model: Option, + /// Optional tokenizer JSON path; falls back to the configured tokenizer. #[arg(long)] pub tokenizer: Option, + /// Comma-separated task list (e.g. ppl,gsm8k,humaneval). #[arg(long, default_value = "ppl")] pub tasks: String, + /// Directory containing per-task evaluation datasets. #[arg(long, default_value = "data/eval")] pub data_dir: PathBuf, + /// Optional cap on the number of examples evaluated per task. #[arg(long)] pub max_examples: Option, + /// Maximum new tokens generated per generative task. #[arg(long, default_value_t = 128)] pub max_new_tokens: usize, /// Thinking budget: none, low, medium, high, or max (Phase 39). #[arg(long, default_value = "none")] pub thinking: String, + /// Maximum tool-call steps for agent-style tasks. #[arg(long, default_value_t = 8)] pub agent_max_steps: usize, + /// Allow code execution in agent-style tasks (enables the code tool). #[arg(long)] pub allow_code_exec: bool, + /// Optional JSON output path for the scorecard. #[arg(long)] pub out: Option, + /// Optional Markdown output path for the scorecard. #[arg(long)] pub markdown: Option, + /// Compare two scorecards (takes exactly two JSON scorecard paths). #[arg(long, num_args = 2)] pub compare: Vec, + /// Compare a QAT checkpoint against its unquantised baseline. #[arg(long)] pub qat_compare: bool, + /// Unquantised baseline checkpoint used as the --qat-compare reference. #[arg(long, requires = "qat_compare")] pub baseline_model: Option, + /// Capability probe manifest path (enables forgetting analysis). #[arg(long)] pub forgetting_manifest: Option, + /// Forgetting curves store path (read and updated). #[arg(long, default_value = "checkpoints/forgetting/curves.json")] pub forgetting_store: PathBuf, + /// Current checkpoint or session id recorded under the manifest. #[arg(long, requires = "forgetting_manifest")] pub checkpoint_id: Option, + /// Baseline checkpoint or session id used to compute forgetting deltas. #[arg(long, requires = "forgetting_manifest")] pub baseline_id: Option, + /// Absolute capability-score delta treated as significant forgetting. #[arg(long, default_value_t = DEFAULT_SIGNIFICANCE_THRESHOLD)] pub significance_threshold: f64, + /// Optional JSONL export path for forgetting deltas. #[arg(long, requires_all = ["forgetting_manifest", "baseline_id"])] pub forgetting_jsonl: Option, + /// Require every manifest probe to run; otherwise missing probes are skipped. #[arg(long, requires = "forgetting_manifest")] pub require_all_probes: bool, /// Print per-layer KV-cache bytes/token by attention kind and exit (v4 Phase 41). diff --git a/aarambh-studio/src/cmd/finetune.rs b/aarambh-studio/src/cmd/finetune.rs index 2d68bee..68f09f2 100644 --- a/aarambh-studio/src/cmd/finetune.rs +++ b/aarambh-studio/src/cmd/finetune.rs @@ -19,6 +19,7 @@ use aarambh_studio_weights::load_any_model; use clap::{Args, Subcommand}; #[derive(Debug, Args)] +/// Fine-tune adapters with SFT, DoRA, GRPO, DPO, RLAIF, or merge. pub struct FinetuneArgs { #[command(subcommand)] pub command: FinetuneCommand, @@ -26,183 +27,277 @@ pub struct FinetuneArgs { #[derive(Debug, Subcommand)] pub enum FinetuneCommand { + /// Supervised fine-tune a LoRA adapter on a chat dataset. Sft(FinetuneRunArgs), + /// Supervised fine-tune a QLoRA adapter on a chat dataset. Qlora(FinetuneRunArgs), + /// Supervised fine-tune a LoRA adapter on a tool-calling dataset. ToolSft(FinetuneRunArgs), + /// Supervised fine-tune a QLoRA adapter on a tool-calling dataset. ToolQlora(FinetuneRunArgs), + /// Supervised fine-tune a weight-decomposed DoRA adapter. Dora(FinetuneRunArgs), + /// Supervised fine-tune a quantised weight-decomposed QDoRA adapter. Qdora(FinetuneRunArgs), + /// DoRA fine-tune a vision-language adapter on image VQA data. VlmDora(VlmFinetuneArgs), + /// QDoRA fine-tune a vision-language adapter on image VQA data. VlmQdora(VlmFinetuneArgs), + /// DoRA fine-tune a vision-language adapter on video VQA data. VideoDora(VlmFinetuneArgs), + /// QDoRA fine-tune a vision-language adapter on video VQA data. VideoQdora(VlmFinetuneArgs), + /// DoRA fine-tune a vision-language adapter on document VQA data. DocumentDora(VlmFinetuneArgs), + /// QDoRA fine-tune a vision-language adapter on document VQA data. DocumentQdora(VlmFinetuneArgs), + /// DoRA fine-tune a vision-language adapter on audio VQA data. AudioDora(VlmFinetuneArgs), + /// QDoRA fine-tune a vision-language adapter on audio VQA data. AudioQdora(VlmFinetuneArgs), + /// Group-relative policy optimisation (verifier-rewarded RL fine-tune). Grpo(GrpoArgs), + /// Direct preference optimisation against (chosen, rejected) pairs. Dpo(DpoArgs), + /// Direct preference optimisation against (chosen, rejected) pairs on a quantised base. Qdpo(DpoArgs), Rlaif(RlaifArgs), + /// Merge a trained adapter back into the base checkpoint. Merge(MergeArgs), } #[derive(Debug, Args)] +/// `finetune sft|qlora|tool-sft|tool-qlora|dora|qdora` shared arguments. pub struct FinetuneRunArgs { + /// Training/model TOML configuration (provides architecture + device). #[arg(long, default_value = "configs/tiny_shakespeare.toml")] pub config: PathBuf, + /// Base model checkpoint path to fine-tune. #[arg(long)] pub base: PathBuf, + /// Optional tokenizer JSON path; falls back to the config. #[arg(long)] pub tokenizer: Option, + /// JSONL chat or tool-call training data path. #[arg(long)] pub data: PathBuf, + /// Output adapter directory. #[arg(long)] pub output: PathBuf, + /// LoRA / DoRA adapter rank. #[arg(long, default_value_t = 16)] pub lora_rank: usize, + /// LoRA / DoRA scaling alpha; defaults to 2 * rank. #[arg(long)] pub lora_alpha: Option, + /// LoRA / DoRA dropout probability. #[arg(long, default_value_t = 0.05)] pub lora_dropout: f32, + /// Comma-separated target module list (e.g. attn.wq,attn.wk,attn.wv,attn.wo). #[arg(long, default_value = "attn.wq,attn.wk,attn.wv,attn.wo")] pub target_modules: String, + /// Training batch size. #[arg(long)] pub batch_size: Option, + /// Maximum optimiser steps (overrides max-epochs when set). #[arg(long)] pub max_steps: Option, + /// Maximum training epochs. #[arg(long)] pub max_epochs: Option, + /// Learning rate. #[arg(long)] pub lr: Option, + /// Gradient accumulation steps before an optimiser update. #[arg(long)] pub grad_accum_steps: Option, + /// Linear warmup steps before the cosine schedule. #[arg(long)] pub warmup_steps: Option, + /// Save an adapter every N optimiser steps. #[arg(long)] pub save_every_n_steps: Option, + /// Log training metrics every N optimiser steps. #[arg(long)] pub log_every_n_steps: Option, + /// Disable dataset shuffling between epochs. #[arg(long)] pub no_shuffle: bool, } #[derive(Debug, Args)] +/// `finetune merge` — fold an adapter back into the base checkpoint. pub struct MergeArgs { + /// Training/model TOML configuration (provides architecture + device). #[arg(long, default_value = "configs/tiny_shakespeare.toml")] pub config: PathBuf, + /// Base model checkpoint path. #[arg(long)] pub base: PathBuf, + /// Adapter directory to merge. #[arg(long)] pub adapter: PathBuf, + /// Output merged checkpoint path. #[arg(long)] pub output: PathBuf, + /// Merge method: auto (infer from metadata), lora, or dora. #[arg(long, default_value = "auto")] pub method: String, } #[derive(Debug, Args)] +/// `finetune grpo` — verifier-rewarded group-relative policy optimisation. pub struct GrpoArgs { + /// Training/model TOML configuration (provides architecture + device). #[arg(long, default_value = "configs/tiny_shakespeare.toml")] pub config: PathBuf, + /// Base policy checkpoint path. #[arg(long)] pub base: PathBuf, + /// Frozen reference checkpoint used for the KL penalty. #[arg(long)] pub reference: PathBuf, + /// Optional tokenizer JSON path; falls back to the config. #[arg(long)] pub tokenizer: Option, + /// Prompts JSONL path. #[arg(long)] pub data: PathBuf, + /// Output adapter directory. #[arg(long)] pub output: PathBuf, + /// Built-in verifier kind: math, format, or math-format. #[arg(long, default_value = "math-format")] pub verifier: String, + /// Number of completions sampled per prompt to form a reward group. #[arg(long, default_value_t = 8)] pub group_size: usize, + /// Maximum new tokens generated per rollout. #[arg(long, default_value_t = 128)] pub max_new_tokens: usize, + /// Sampling temperature for rollouts. #[arg(long, default_value_t = 0.8)] pub temperature: f32, + /// Nucleus sampling probability mass for rollouts. #[arg(long, default_value_t = 0.95)] pub top_p: f32, + /// Top-k sampling width for rollouts. #[arg(long, default_value_t = 50)] pub top_k: usize, + /// GRPO thinking budget: none, low, medium, high, or max. #[arg(long, default_value = "low")] pub thinking: String, + /// LoRA / DoRA adapter rank. #[arg(long, default_value_t = 16)] pub lora_rank: usize, + /// LoRA / DoRA scaling alpha; defaults to 2 * rank. #[arg(long)] pub lora_alpha: Option, + /// LoRA / DoRA dropout probability. #[arg(long, default_value_t = 0.05)] pub lora_dropout: f32, + /// Comma-separated target module list (e.g. attn.wq,attn.wk,attn.wv,attn.wo). #[arg(long, default_value = "attn.wq,attn.wk,attn.wv,attn.wo")] pub target_modules: String, + /// Maximum optimiser steps (alias: --max-steps). #[arg(long, alias = "max-steps")] pub steps: Option, + /// Maximum training epochs. #[arg(long)] pub max_epochs: Option, + /// Learning rate. #[arg(long)] pub lr: Option, + /// KL penalty coefficient against the reference policy. #[arg(long, default_value_t = 0.01)] pub kl_coeff: f64, + /// Gradient accumulation steps before an optimiser update. #[arg(long)] pub grad_accum_steps: Option, + /// Linear warmup steps before the cosine schedule. #[arg(long)] pub warmup_steps: Option, + /// Save an adapter every N optimiser steps. #[arg(long)] pub save_every_n_steps: Option, + /// Log training metrics every N optimiser steps. #[arg(long)] pub log_every_n_steps: Option, + /// Disable dataset shuffling between epochs. #[arg(long)] pub no_shuffle: bool, } #[derive(Debug, Args)] +/// `finetune dpo` / `finetune qdpo` — direct preference optimisation arguments. pub struct DpoArgs { + /// Training/model TOML configuration (provides architecture + device). #[arg(long, default_value = "configs/tiny_shakespeare.toml")] pub config: PathBuf, + /// Base policy checkpoint path to fine-tune. #[arg(long)] pub base: PathBuf, + /// Optional frozen reference checkpoint used for the DPO KL term. #[arg(long, conflicts_with = "reference_free")] pub reference: Option, + /// Run reference-free DPO (skip the frozen reference model). #[arg(long, conflicts_with = "reference")] pub reference_free: bool, + /// Optional tokenizer JSON path; falls back to the config. #[arg(long)] pub tokenizer: Option, + /// Preference-pair JSONL path (chosen, rejected per row). #[arg(long)] pub data: PathBuf, + /// Output adapter directory. #[arg(long)] pub output: PathBuf, + /// DPO beta (regularisation strength). #[arg(long, default_value_t = 0.1)] pub beta: f64, + /// Maximum tokens kept per prompt half (truncates longer prompts). #[arg(long)] pub max_prompt_tokens: Option, + /// Maximum tokens kept per chosen/rejected completion. #[arg(long)] pub max_completion_tokens: Option, + /// LoRA / DoRA adapter rank. #[arg(long, default_value_t = 16)] pub lora_rank: usize, + /// LoRA / DoRA scaling alpha; defaults to 2 * rank. #[arg(long)] pub lora_alpha: Option, + /// LoRA / DoRA dropout probability. #[arg(long, default_value_t = 0.0)] pub lora_dropout: f32, + /// Comma-separated target module list (e.g. attn.wq,attn.wk,attn.wv,attn.wo). #[arg(long, default_value = "attn.wq,attn.wk,attn.wv,attn.wo")] pub target_modules: String, + /// Training batch size. #[arg(long)] pub batch_size: Option, + /// Maximum optimiser steps (overrides max-epochs when set). #[arg(long)] pub max_steps: Option, + /// Maximum training epochs. #[arg(long)] pub max_epochs: Option, + /// Learning rate. #[arg(long)] pub lr: Option, + /// Gradient accumulation steps before an optimiser update. #[arg(long)] pub grad_accum_steps: Option, + /// Linear warmup steps before the cosine schedule. #[arg(long)] pub warmup_steps: Option, + /// Save an adapter every N optimiser steps. #[arg(long)] pub save_every_n_steps: Option, + /// Log training metrics every N optimiser steps. #[arg(long)] pub log_every_n_steps: Option, + /// Disable dataset shuffling between epochs. #[arg(long)] pub no_shuffle: bool, } @@ -269,74 +364,109 @@ pub struct RlaifArgs { } #[derive(Debug, Args)] +/// `finetune vlm-dora|vlm-qdora|video-dora|video-qdora|document-dora|document-qdora|audio-dora|audio-qdora` +/// shared arguments. pub struct VlmFinetuneArgs { + /// VLM training/model TOML configuration (vision encoder + projector + device). #[arg(long, default_value = "configs/vision_vqa_instruct.toml")] pub config: PathBuf, + /// Base model checkpoint path to fine-tune. #[arg(long)] pub base: PathBuf, + /// Optional tokenizer JSON path; falls back to the config. #[arg(long)] pub tokenizer: Option, + /// JSONL VQA training data path (image, video, document, or audio rows). #[arg(long)] pub data: PathBuf, + /// Output adapter directory. #[arg(long)] pub output: PathBuf, + /// Pretrained vision projector checkpoint path (defaults to the base). #[arg(long)] pub projector: Option, + /// CLIP vision encoder config JSON path (defaults to the config). #[arg(long)] pub clip_config: Option, + /// CLIP vision encoder weights path (defaults to the config). #[arg(long)] pub clip_weights: Option, + /// Root directory that image training paths are resolved against. #[arg(long)] pub image_root: Option, + /// Root directory that video training paths are resolved against. #[arg(long)] pub video_root: Option, + /// Number of frames sampled per video (overrides the config). #[arg(long)] pub frames: Option, + /// Frame sampling strategy: uniform or scene-aware. #[arg(long)] pub frame_sampling: Option, + /// Temporal encoding kind for video frames. #[arg(long)] pub temporal_encoding: Option, + /// Optional pretrained temporal encoder checkpoint path. #[arg(long)] pub temporal: Option, + /// Root directory that document training paths are resolved against. #[arg(long)] pub document_root: Option, + /// DPI used when rasterising document pages to images. #[arg(long)] pub document_dpi: Option, + /// Maximum number of document pages to rasterise per row. #[arg(long)] pub max_document_pages: Option, + /// Layout encoding kind for document pages. #[arg(long)] pub layout_encoding: Option, + /// Optional pretrained layout-aware projector checkpoint path. #[arg(long)] pub layout: Option, + /// Freeze the vision projector during fine-tuning. #[arg(long)] pub freeze_projector: bool, + /// LoRA / DoRA adapter rank. #[arg(long, default_value_t = 16)] pub lora_rank: usize, + /// LoRA / DoRA scaling alpha; defaults to 2 * rank. #[arg(long)] pub lora_alpha: Option, + /// LoRA / DoRA dropout probability. #[arg(long, default_value_t = 0.05)] pub lora_dropout: f32, + /// Comma-separated target module list. #[arg( long, default_value = "attn.wq,attn.wk,attn.wv,attn.wo,ffn.w_gate,ffn.w_up,ffn.w_down" )] pub target_modules: String, + /// Training batch size. #[arg(long)] pub batch_size: Option, + /// Maximum optimiser steps (overrides max-epochs when set). #[arg(long)] pub max_steps: Option, + /// Maximum training epochs. #[arg(long)] pub max_epochs: Option, + /// Learning rate. #[arg(long)] pub lr: Option, + /// Gradient accumulation steps before an optimiser update. #[arg(long)] pub grad_accum_steps: Option, + /// Linear warmup steps before the cosine schedule. #[arg(long)] pub warmup_steps: Option, + /// Save an adapter every N optimiser steps. #[arg(long)] pub save_every_n_steps: Option, + /// Log training metrics every N optimiser steps. #[arg(long)] pub log_every_n_steps: Option, + /// Disable dataset shuffling between epochs. #[arg(long)] pub no_shuffle: bool, } diff --git a/aarambh-studio/src/cmd/infer.rs b/aarambh-studio/src/cmd/infer.rs index 44be4e0..771a44a 100644 --- a/aarambh-studio/src/cmd/infer.rs +++ b/aarambh-studio/src/cmd/infer.rs @@ -48,100 +48,148 @@ const ANSI_DIM: &str = "\x1b[2m"; const ANSI_RESET: &str = "\x1b[0m"; #[derive(Debug, Args)] +/// Generate text, multimodal, tool-use, speculative, best-of-N, or +/// self-learning completions from a trained checkpoint. pub struct InferArgs { + /// Training/model TOML configuration (provides architecture + device). #[arg(long, default_value = "configs/tiny_shakespeare.toml")] pub config: PathBuf, + /// Model checkpoint path; falls back to best.json/latest.json pointer. #[arg(long)] pub model: Option, + /// Optional tokenizer JSON path; falls back to the configured tokenizer. #[arg(long)] pub tokenizer: Option, + /// Image file path for vision (VQA) inference. #[arg(long)] pub image: Option, + /// Video file path for temporal video inference (mutually exclusive with --image). #[arg(long, conflicts_with = "image")] pub video: Option, + /// Document file path for layout-aware document inference. #[arg(long, conflicts_with_all = ["image", "video"])] pub document: Option, + /// Audio file path for audio-language inference. #[arg(long, conflicts_with_all = ["image", "video", "document"])] pub audio: Option, + /// Comma-separated 1-based page numbers to rasterise from the document. #[arg(long, requires = "document")] pub pages: Option, + /// DPI used when rasterising document pages to images. #[arg(long, requires = "document")] pub document_dpi: Option, + /// Maximum number of document pages to rasterise. #[arg(long, requires = "document")] pub max_document_pages: Option, + /// Number of frames to sample from a --video input. #[arg(long)] pub frames: Option, + /// Frame sampling strategy for --video: uniform or scene-aware. #[arg(long)] pub frame_sampling: Option, + /// Prompt text (or chat-template user message) fed to the model. #[arg(long)] pub prompt: String, + /// Maximum number of new tokens generated. #[arg(long, default_value_t = 256)] pub max_tokens: usize, + /// Sampling temperature for stochastic decoding. #[arg(long, default_value_t = 0.7)] pub temperature: f32, + /// Nucleus sampling probability mass. #[arg(long, default_value_t = 0.9)] pub top_p: f32, + /// Top-k sampling width. #[arg(long, default_value_t = 50)] pub top_k: usize, + /// Deterministic sampler seed. #[arg(long)] pub seed: Option, #[arg(long, default_value = "none")] /// Thinking budget: none, low, medium, high, or max. pub thinking: String, + /// Render the live next-token prediction view to stdout. #[arg(long)] pub predict_view: bool, + /// Stream tokens to stdout as they are generated. #[arg(long)] pub stream: bool, + /// Use greedy (argmax) decoding instead of stochastic sampling. #[arg(long)] pub greedy: bool, + /// Enable speculative decoding with an external draft model or MTP head. #[arg(long)] pub speculative: bool, + /// External draft model checkpoint path (requires --draft-config). #[arg(long)] pub draft_model: Option, + /// External draft model TOML config path. #[arg(long)] pub draft_config: Option, + /// External draft model tokenizer JSON path (defaults to the target). #[arg(long)] pub draft_tokenizer: Option, + /// Number of tokens the draft model proposes per target forward (MTP width). #[arg(long)] pub draft_tokens: Option, + /// Print generation, DSA, and MoE statistics to stderr after decoding. #[arg(long)] pub stats: bool, + /// JSON tool definitions file (native or OpenAI-compatible) for tool calling. #[arg(long)] pub tools: Option, + /// Tool-choice policy: auto, none, required, or a named tool. #[arg(long, default_value = "auto")] pub tool_choice: String, + /// Safety policy: strict, permissive, research, or none. #[arg(long, default_value = "strict")] pub safety: String, + /// JSONL safety audit log path. #[arg(long, default_value = "safety_audit.jsonl")] pub safety_audit_log: PathBuf, + /// Self-learning mode: disabled, cpu, or gpu. #[arg(long, default_value = "disabled")] pub self_learn: String, + /// Self-learning replay JSONL path (defaults to data/replay.jsonl). #[arg(long)] pub replay_path: Option, + /// Self-learning state directory for adapters and metrics. #[arg(long, default_value = "adapters/selflearn")] pub self_learn_state_dir: PathBuf, + /// Reference (frozen) checkpoint used for KL during self-learning. #[arg(long)] pub self_learn_reference: Option, + /// Built-in verifier kind: none, math, format, or math-format. #[arg(long, default_value = "none")] pub self_learn_verifier: String, + /// Grounded vision verifier: none, auto, count, color, presence, or exact. #[arg(long, default_value = "none")] pub self_learn_vision_verifier: String, + /// Ground-truth answer required when a verifier other than none is used. #[arg(long)] pub self_learn_ground_truth: Option, + /// Capability probe manifest path (enables self-learning forgetting analysis). #[arg(long)] pub forgetting_manifest: Option, + /// Forgetting curves store path (defaults to `/forgetting_curves.json`). #[arg(long)] pub forgetting_store: Option, + /// Optional JSONL export path for self-learning forgetting deltas. #[arg(long)] pub forgetting_jsonl: Option, + /// Absolute capability-score delta treated as significant forgetting. #[arg(long, default_value_t = 0.02)] pub forgetting_threshold: f64, + /// Maximum examples evaluated per capability probe during forgetting checks. #[arg(long, default_value_t = 8)] pub forgetting_max_examples: usize, + /// Allow code execution in capability probes during forgetting checks. #[arg(long)] pub forgetting_allow_code_exec: bool, + /// Require every manifest probe to run; otherwise missing probes are skipped. #[arg(long)] pub forgetting_require_all_probes: bool, + /// Baseline checkpoint or session id used to compute forgetting deltas. #[arg(long)] pub forgetting_baseline_id: Option, /// Generate N independent candidate completions and select the best one diff --git a/aarambh-studio/src/cmd/quantise.rs b/aarambh-studio/src/cmd/quantise.rs index 7a77284..2a0aa72 100644 --- a/aarambh-studio/src/cmd/quantise.rs +++ b/aarambh-studio/src/cmd/quantise.rs @@ -12,21 +12,30 @@ use candle_core::{Device, Tensor}; use clap::Args; #[derive(Debug, Args)] +/// Quantise a trained checkpoint into a smaller GGUF format. pub struct QuantiseArgs { + /// Training/model TOML configuration (provides architecture + device). #[arg(long, default_value = "configs/tiny_shakespeare.toml")] pub config: PathBuf, + /// Source model checkpoint path to quantise. #[arg(long)] pub model: PathBuf, + /// Optional tokenizer JSON path; falls back to the configured tokenizer. #[arg(long)] pub tokenizer: Option, + /// Quantisation method: int8, awq, gptq, q4_k_m, q5_k_m, or q8_0. #[arg(long, default_value = "int8")] pub method: String, + /// Target quantisation bit width (4 for awq/gptq, 5 for q5_k_m, 8 for int8/q8_0). #[arg(long, default_value_t = 8)] pub bits: u8, + /// Calibration plaintext dataset path (required for awq and gptq). #[arg(long)] pub calibration_data: Option, + /// Maximum calibration samples to draw from the dataset. #[arg(long, default_value_t = 128)] pub samples: usize, + /// Output quantised GGUF checkpoint path. #[arg(long)] pub output: PathBuf, } diff --git a/aarambh-studio/src/cmd/selflearn.rs b/aarambh-studio/src/cmd/selflearn.rs index d43ac33..8e6957d 100644 --- a/aarambh-studio/src/cmd/selflearn.rs +++ b/aarambh-studio/src/cmd/selflearn.rs @@ -12,6 +12,7 @@ use clap::{Args, Subcommand}; use crate::cmd::infer::{self, InferArgs}; #[derive(Debug, Args)] +/// Self-learning loop operator: start, flush, replay, stats, or reset. pub struct SelflearnArgs { #[command(subcommand)] pub command: SelflearnCommand, @@ -19,79 +20,116 @@ pub struct SelflearnArgs { #[derive(Debug, Subcommand)] pub enum SelflearnCommand { + /// Run a single self-learning inference (text or vision) step. Start(Box), + /// Flush pending self-learning gradients through the loop optimiser. FlushGradients(SelflearnRunArgs), + /// Run a self-learning replay fine-tune over the replay buffer. Replay(SelflearnRunArgs), + /// Print replay buffer, metrics, and forgetting-curve statistics. Stats(StatsArgs), + /// Print the stored forgetting-curve report and exit. ForgettingReport(ForgettingReportArgs), + /// Delete the replay buffer and self-learning state directory. Reset(ResetArgs), } #[derive(Debug, Args, Clone)] +/// Shared forgetting-probe arguments for `selflearn` subcommands. pub struct ForgettingArgs { + /// Capability probe manifest path (enables forgetting analysis). #[arg(long)] pub forgetting_manifest: Option, + /// Forgetting curves store path (defaults to `/forgetting_curves.json`). #[arg(long)] pub forgetting_store: Option, + /// Optional JSONL export path for forgetting deltas. #[arg(long)] pub forgetting_jsonl: Option, + /// Absolute capability-score delta treated as significant forgetting. #[arg(long, default_value_t = 0.02)] pub forgetting_threshold: f64, + /// Maximum examples evaluated per capability probe. #[arg(long, default_value_t = 8)] pub forgetting_max_examples: usize, + /// Allow code execution in capability probes. #[arg(long)] pub forgetting_allow_code_exec: bool, + /// Require every manifest probe to run; otherwise missing probes are skipped. #[arg(long)] pub require_all_probes: bool, + /// Baseline checkpoint or session id used to compute forgetting deltas. #[arg(long)] pub forgetting_baseline_id: Option, } #[derive(Debug, Args)] +/// `selflearn start` — run a single self-learning inference step. pub struct StartArgs { + /// Self-learning runtime mode: text or vision. #[arg(long, default_value = "text")] pub mode: String, + /// Training/model TOML configuration (provides architecture + device). #[arg(long, default_value = "configs/tiny_shakespeare.toml")] pub config: PathBuf, + /// Model checkpoint path; falls back to best.json/latest.json pointer. #[arg(long)] pub model: Option, + /// Optional tokenizer JSON path; falls back to the config. #[arg(long)] pub tokenizer: Option, + /// Image file path for vision self-learning (required when --mode vision). #[arg(long)] pub image: Option, + /// Prompt text fed to the self-learning loop. #[arg(long)] pub prompt: String, + /// Maximum number of new tokens generated. #[arg(long, default_value_t = 256)] pub max_tokens: usize, + /// Sampling temperature for stochastic decoding. #[arg(long, default_value_t = 0.7)] pub temperature: f32, + /// Nucleus sampling probability mass. #[arg(long, default_value_t = 0.9)] pub top_p: f32, + /// Top-k sampling width. #[arg(long, default_value_t = 50)] pub top_k: usize, + /// Deterministic sampler seed. #[arg(long)] pub seed: Option, + /// Stream tokens to stdout as they are generated. #[arg(long)] pub stream: bool, + /// Use greedy (argmax) decoding instead of stochastic sampling. #[arg(long)] pub greedy: bool, /// Thinking budget: none, low, medium, high, or max (Phase 39). #[arg(long, default_value = "none")] pub thinking: String, + /// Safety policy: strict, permissive, research, or none. #[arg(long, default_value = "strict")] pub safety: String, + /// JSONL safety audit log path. #[arg(long, default_value = "safety_audit.jsonl")] pub safety_audit_log: PathBuf, + /// Self-learning replay JSONL path (defaults to data/replay.jsonl). #[arg(long)] pub replay_path: Option, + /// Self-learning state directory for adapters and metrics. #[arg(long, default_value = "adapters/selflearn")] pub self_learn_state_dir: PathBuf, + /// Reference (frozen) checkpoint used for KL during self-learning. #[arg(long)] pub self_learn_reference: Option, + /// Built-in verifier kind: none, math, format, or math-format. #[arg(long, default_value = "none")] pub self_learn_verifier: String, + /// Grounded vision verifier: none, auto, count, color, presence, or exact. #[arg(long, default_value = "auto")] pub self_learn_vision_verifier: String, + /// Ground-truth answer required when a verifier other than none is used. #[arg(long)] pub self_learn_ground_truth: Option, #[command(flatten)] @@ -99,19 +137,27 @@ pub struct StartArgs { } #[derive(Debug, Args)] +/// `selflearn flush-gradients` / `selflearn replay` shared arguments. pub struct SelflearnRunArgs { + /// Training/model TOML configuration (provides architecture + device). #[arg(long, default_value = "configs/tiny_shakespeare.toml")] pub config: PathBuf, + /// Base (policy) checkpoint path. #[arg(long)] pub base: PathBuf, + /// Reference (frozen) checkpoint path; defaults to the base. #[arg(long)] pub reference: Option, + /// Optional tokenizer JSON path; falls back to the config. #[arg(long)] pub tokenizer: Option, + /// Self-learning runtime mode: cpu or gpu. #[arg(long, default_value = "cpu")] pub mode: String, + /// Self-learning replay JSONL path. #[arg(long, default_value = "data/replay.jsonl")] pub replay_path: PathBuf, + /// Self-learning state directory for adapters and metrics. #[arg(long, default_value = "adapters/selflearn")] pub self_learn_state_dir: PathBuf, #[command(flatten)] @@ -119,27 +165,37 @@ pub struct SelflearnRunArgs { } #[derive(Debug, Args)] +/// `selflearn stats` — print replay, metrics, and forgetting statistics. pub struct StatsArgs { + /// Self-learning runtime mode: text or vision. #[arg(long, default_value = "text")] pub mode: String, + /// Override the replay JSONL path (defaults by mode). #[arg(long)] pub replay_path: Option, + /// Self-learning state directory for adapters and metrics. #[arg(long, default_value = "adapters/selflearn")] pub self_learn_state_dir: PathBuf, } #[derive(Debug, Args)] +/// `selflearn reset` — delete the replay buffer and self-learning state. pub struct ResetArgs { + /// Replay JSONL path to delete. #[arg(long, default_value = "data/replay.jsonl")] pub replay_path: PathBuf, + /// Self-learning state directory to delete recursively. #[arg(long, default_value = "adapters/selflearn")] pub self_learn_state_dir: PathBuf, + /// Confirm the destructive reset (required to proceed). #[arg(long)] pub yes: bool, } #[derive(Debug, Args)] +/// `selflearn forgetting-report` — print the stored forgetting-curve report. pub struct ForgettingReportArgs { + /// Forgetting curves store JSON path to print. #[arg(long, default_value = "adapters/selflearn/forgetting_curves.json")] pub forgetting_store: PathBuf, } diff --git a/aarambh-studio/src/cmd/serve.rs b/aarambh-studio/src/cmd/serve.rs index f162fca..97b20cf 100644 --- a/aarambh-studio/src/cmd/serve.rs +++ b/aarambh-studio/src/cmd/serve.rs @@ -13,39 +13,55 @@ use serde::Deserialize; #[derive(Debug, Args)] /// Start the local OpenAI-compatible inference server. pub struct ServeArgs { + /// Training/model TOML configuration (provides architecture + device). #[arg(long, default_value = "configs/tiny_shakespeare.toml")] config: PathBuf, + /// Model checkpoint to serve. #[arg(long)] model: PathBuf, + /// Optional tokenizer JSON path; falls back to the configured tokenizer. #[arg(long)] tokenizer: Option, + /// Public model id advertised by the OpenAI-compatible API. #[arg(long, default_value = "aarambh-studio-local")] model_id: String, + /// Bind host IP address. #[arg(long, default_value = "127.0.0.1")] host: IpAddr, + /// Bind TCP port. #[arg(long, default_value_t = 8080)] port: u16, + /// Maximum requests processed in a single continuous batch. #[arg(long, default_value_t = 8)] max_batch_size: usize, + /// Maximum pending requests queued before backpressure applies. #[arg(long, default_value_t = 128)] queue_capacity: usize, + /// Milliseconds to wait for additional requests before flushing a batch. #[arg(long, default_value_t = 2)] batch_wait_ms: u64, + /// Maximum tokens prefilled per chunked prefill pass. #[arg(long, default_value_t = 128)] prefill_chunk_size: usize, + /// Maximum total tokens (prompt + completion) accepted per request. #[arg(long, default_value_t = 2048)] max_request_tokens: usize, #[arg(long, default_value = "none")] /// Default thinking budget: none, low, medium, high, or max. thinking: String, + /// Optional JSON tool definitions file advertised to clients. #[arg(long)] tools: Option, + /// Safety policy: strict, permissive, research, or none. #[arg(long, default_value = "strict")] safety: String, + /// JSONL safety audit log path. #[arg(long, default_value = "safety_audit.jsonl")] safety_audit_log: PathBuf, + /// Environment variable name holding the optional bearer API key. #[arg(long, default_value = "AARAMBH_STUDIO_STUDIO_API_KEY")] api_key_env: String, + /// Allowed CORS origin(s); repeat to enable multiple origins. #[arg(long)] cors_origin: Vec, } diff --git a/aarambh-studio/src/cmd/train.rs b/aarambh-studio/src/cmd/train.rs index ad3a0a0..ca726f6 100644 --- a/aarambh-studio/src/cmd/train.rs +++ b/aarambh-studio/src/cmd/train.rs @@ -14,7 +14,9 @@ use aarambh_studio_train::{ use clap::Args; #[derive(Debug, Args)] +/// Train a model checkpoint from a TOML training configuration. pub struct TrainArgs { + /// Training/model TOML configuration path. #[arg(long)] pub config: PathBuf, } diff --git a/docs/README.md b/docs/README.md index f65cf1c..202e63e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -70,6 +70,16 @@ existing `ToolChain`, the reference `read_file_in_workdir` and `lookup` executors, the `agent --execute-tools` CLI surface, the smoke workflow, and the honesty boundary (pure-Rust CPU sandbox, no OS-level isolation). +### 4c. `cli-commands.md` +**The full CLI command reference — every command, every flag, a worked example for each.** + +This is a human-readable index over every subcommand's `--help` output +(generated for `4.0.0-alpha.7`): `train`, `infer`, `agent` (incl. the +Phase 47 `--execute-tools` sandboxed-execution flags), `eval`, `quantise`, +`convert`, `finetune` (all subcommands incl. `rlaif`), `distill`, +`selflearn`, and `serve`. The verbatim `--help` output for every command +is also kept in `cli-commands-raw-help.txt` as an appendix. + ### 5. `phase38_forgetting.md` **Capability regression, MoE routing drift, and the Manas JSONL bridge.** diff --git a/docs/cli-commands-raw-help.txt b/docs/cli-commands-raw-help.txt new file mode 100644 index 0000000..481c1aa --- /dev/null +++ b/docs/cli-commands-raw-help.txt @@ -0,0 +1,1946 @@ +================================================================================ +aarambh-studio CLI — Full Command Reference (auto-generated from --help) +Version: aarambh-studio 4.0.0-alpha.7 +Regenerated after adding clap help text to every command/flag in the .rs sources. +================================================================================ + +### Top-level +``` +Aarambh AI command line tools + +Usage: aarambh-studio + +Commands: + agent Run a bounded caller-executed long-horizon tool-use chain + train Train a model checkpoint from a TOML training configuration + infer Generate text, multimodal, tool-use, speculative, best-of-N, or self-learning completions from a trained checkpoint + eval Evaluate a checkpoint on capability, forgetting, or KV-cache probes + quantise Quantise a trained checkpoint into a smaller GGUF format + convert Convert checkpoints between HF SafeTensors and GGUF, or expand vocabularies + distill Distil a smaller student model from a frozen local or dataset teacher + finetune Fine-tune adapters with SFT, DoRA, GRPO, DPO, RLAIF, or merge + selflearn Self-learning loop operator: start, flush, replay, stats, or reset + serve Start the local OpenAI-compatible inference server + help Print this message or the help of the given subcommand(s) + +Options: + -h, --help Print help + -V, --version Print version +``` + +================================================================================ +### train +``` +Train a model checkpoint from a TOML training configuration + +Usage: aarambh-studio train --config + +Options: + --config Training/model TOML configuration path + -h, --help Print help +``` + +================================================================================ +### infer +``` +Generate text, multimodal, tool-use, speculative, best-of-N, or self-learning completions from a trained checkpoint + +Usage: aarambh-studio infer [OPTIONS] --prompt + +Options: + --config + Training/model TOML configuration (provides architecture + device) [default: configs/tiny_shakespeare.toml] + --model + Model checkpoint path; falls back to best.json/latest.json pointer + --tokenizer + Optional tokenizer JSON path; falls back to the configured tokenizer + --image + Image file path for vision (VQA) inference + --video