pub struct LlamaCppServerConfig {
pub endpoint: String,
pub model_name: String,
pub max_tokens: usize,
pub temperature: f32,
pub top_p: f32,
pub timeout_secs: u64,
pub chat_template: Option<ChatTemplate>,
}Expand description
llama-server 設定
Fields§
§endpoint: Stringサーバーエンドポイント (e.g., “http://localhost:8080”)
model_name: Stringモデル名(表示用、サーバー側で設定済み)
max_tokens: usize最大生成トークン数
temperature: f32Temperature
top_p: f32Top-p
timeout_secs: u64リクエストタイムアウト(秒)
chat_template: Option<ChatTemplate>Chat template format (Some = 使用, None = 使用しない)
Implementations§
Source§impl LlamaCppServerConfig
impl LlamaCppServerConfig
Sourcepub fn new(endpoint: impl Into<String>) -> LlamaCppServerConfig
pub fn new(endpoint: impl Into<String>) -> LlamaCppServerConfig
新しい設定を作成
Sourcepub fn with_model_name(self, name: impl Into<String>) -> LlamaCppServerConfig
pub fn with_model_name(self, name: impl Into<String>) -> LlamaCppServerConfig
モデル名を設定
Sourcepub fn with_max_tokens(self, max_tokens: usize) -> LlamaCppServerConfig
pub fn with_max_tokens(self, max_tokens: usize) -> LlamaCppServerConfig
最大トークン数を設定
Sourcepub fn with_temperature(self, temperature: f32) -> LlamaCppServerConfig
pub fn with_temperature(self, temperature: f32) -> LlamaCppServerConfig
Temperature を設定
Sourcepub fn with_top_p(self, top_p: f32) -> LlamaCppServerConfig
pub fn with_top_p(self, top_p: f32) -> LlamaCppServerConfig
Top-p を設定
Sourcepub fn with_timeout(self, secs: u64) -> LlamaCppServerConfig
pub fn with_timeout(self, secs: u64) -> LlamaCppServerConfig
タイムアウトを設定
Sourcepub fn with_chat_template(self, template: ChatTemplate) -> LlamaCppServerConfig
pub fn with_chat_template(self, template: ChatTemplate) -> LlamaCppServerConfig
Chat template を設定
Sourcepub fn without_chat_template(self) -> LlamaCppServerConfig
pub fn without_chat_template(self) -> LlamaCppServerConfig
Chat template を無効化
Trait Implementations§
Source§impl Clone for LlamaCppServerConfig
impl Clone for LlamaCppServerConfig
Source§fn clone(&self) -> LlamaCppServerConfig
fn clone(&self) -> LlamaCppServerConfig
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 LlamaCppServerConfig
impl Debug for LlamaCppServerConfig
Source§impl Default for LlamaCppServerConfig
impl Default for LlamaCppServerConfig
Source§fn default() -> LlamaCppServerConfig
fn default() -> LlamaCppServerConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LlamaCppServerConfig
impl RefUnwindSafe for LlamaCppServerConfig
impl Send for LlamaCppServerConfig
impl Sync for LlamaCppServerConfig
impl Unpin for LlamaCppServerConfig
impl UnwindSafe for LlamaCppServerConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more