use clap::{Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Subcommand, Debug)]
pub enum Commands {
Infer(InferArgs),
Discover(DiscoverArgs),
List,
#[cfg(feature = "chat")]
Chat(ChatArgs),
Serve(ServeArgs),
}
#[derive(Parser, Debug)]
pub struct InferArgs {
pub model: String,
pub prompt: String,
#[arg(short, long)]
pub n_len: Option<u32>,
#[arg(short, long)]
pub temperature: Option<f32>,
#[arg(short = 'k', long)]
pub top_k: Option<i32>,
#[arg(short = 'p', long)]
pub top_p: Option<f32>,
#[arg(short = 'r', long)]
pub repeat_penalty: Option<f32>,
#[arg(short = 'c', long)]
pub n_ctx: Option<i32>,
}
#[derive(Parser, Debug)]
pub struct DiscoverArgs {
#[arg(short, long)]
pub all: bool,
}
#[cfg(feature = "chat")]
#[derive(Parser, Debug)]
pub struct ChatArgs {
pub model: String,
}
#[derive(Parser, Debug)]
pub struct ServeArgs {
#[arg(long, default_value = "0.0.0.0")]
pub host: String,
#[arg(short, long, default_value_t = 8080)]
pub port: u16,
#[arg(long)]
pub system_prompt: Option<String>,
}