pub struct ModelConfig {
pub model: String,
pub temperature: Option<f32>,
pub max_tokens: Option<u32>,
pub top_p: Option<f32>,
pub frequency_penalty: Option<f32>,
pub presence_penalty: Option<f32>,
pub stop: Option<Vec<String>>,
pub stream: bool,
}Expand description
Model configuration
Fields§
§model: StringModel name/identifier
temperature: Option<f32>Temperature for sampling (0.0 to 2.0)
max_tokens: Option<u32>Maximum tokens to generate
top_p: Option<f32>Top-p sampling parameter
frequency_penalty: Option<f32>Frequency penalty
presence_penalty: Option<f32>Presence penalty
stop: Option<Vec<String>>Stop sequences
stream: boolWhether to stream responses
Implementations§
Source§impl ModelConfig
impl ModelConfig
Sourcepub fn validate(&self) -> RsllmResult<()>
pub fn validate(&self) -> RsllmResult<()>
Validate model configuration
Note: This validation intentionally does NOT restrict model names to a predefined list. Users can specify custom models for:
- Custom fine-tuned models
- Self-hosted LLM endpoints
- Future models not yet in the library
- Alternative model naming schemes
Trait Implementations§
Source§impl Clone for ModelConfig
impl Clone for ModelConfig
Source§fn clone(&self) -> ModelConfig
fn clone(&self) -> ModelConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelConfig
impl Debug for ModelConfig
Source§impl Default for ModelConfig
impl Default for ModelConfig
Source§impl<'de> Deserialize<'de> for ModelConfig
impl<'de> Deserialize<'de> for ModelConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ModelConfig
impl RefUnwindSafe for ModelConfig
impl Send for ModelConfig
impl Sync for ModelConfig
impl Unpin for ModelConfig
impl UnwindSafe for ModelConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more