pub struct OllamaConfig {Show 13 fields
pub enabled: bool,
pub host: String,
pub port: u16,
pub embedding_model: String,
pub chat_model: String,
pub timeout_seconds: u64,
pub max_retries: u32,
pub fallback_to_hash: bool,
pub max_tokens: Option<u32>,
pub temperature: Option<f32>,
pub enable_caching: bool,
pub keep_alive: Option<String>,
pub num_ctx: Option<u32>,
}Expand description
Ollama configuration
Fields§
§enabled: boolEnable Ollama integration
host: StringOllama host URL
port: u16Ollama port
embedding_model: StringModel for embeddings
chat_model: StringModel for chat/generation
timeout_seconds: u64Timeout in seconds
max_retries: u32Maximum retry attempts
fallback_to_hash: boolFallback to hash-based IDs on error
max_tokens: Option<u32>Maximum tokens to generate
temperature: Option<f32>Temperature for generation (0.0 - 1.0)
enable_caching: boolEnable model caching
keep_alive: Option<String>How long to keep the model loaded in memory between requests (e.g. “1h”, “30m”, “0”).
Without this, Ollama may unload the model between requests, destroying the KV cache and forcing full re-evaluation of long document contexts on every request. Set to “1h” when processing multiple chunks from the same document.
num_ctx: Option<u32>Default context window size for generation requests.
Ollama silently truncates prompts exceeding this value (default is often 2048-8192).
For long-document processing, set this to at least:
tokens(document) + tokens(max_chunk) + tokens(instructions) + 150 output tokens
Use None to let Ollama use its model default.
Trait Implementations§
Source§impl Clone for OllamaConfig
impl Clone for OllamaConfig
Source§fn clone(&self) -> OllamaConfig
fn clone(&self) -> OllamaConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OllamaConfig
impl Debug for OllamaConfig
Source§impl Default for OllamaConfig
impl Default for OllamaConfig
Source§impl<'de> Deserialize<'de> for OllamaConfig
impl<'de> Deserialize<'de> for OllamaConfig
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>,
Auto Trait Implementations§
impl Freeze for OllamaConfig
impl RefUnwindSafe for OllamaConfig
impl Send for OllamaConfig
impl Sync for OllamaConfig
impl Unpin for OllamaConfig
impl UnsafeUnpin for OllamaConfig
impl UnwindSafe for OllamaConfig
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
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>
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>
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