use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InferenceConfig {
pub model_id: String,
pub filename: String,
pub prompt: String,
pub max_tokens: usize,
pub temperature: f64,
pub max_duration_secs: Option<u64>,
}
impl Default for InferenceConfig {
fn default() -> Self {
Self {
model_id: "bartowski/SmolLM2-360M-Instruct-GGUF".to_string(),
filename: "SmolLM2-360M-Instruct-Q4_K_M.gguf".to_string(),
prompt: "Tell me a story about a helpful robot.".to_string(),
max_tokens: 100,
temperature: 0.7,
max_duration_secs: Some(10),
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InferenceResult {
pub tokens_per_second: f64,
pub total_tokens: usize,
pub duration_ms: u64,
pub generated_text: String,
pub device_used: String,
}