Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Allow Ollama Model KeepAlive to be None, defaulting to indefinite (#13059)

Kyle Kelley53f702c92f79
diff --git a/crates/assistant/src/completion_provider/ollama.rs b/crates/assistant/src/completion_provider/ollama.rs
index a2d7f82554b..e3a80de5325 100644
--- a/crates/assistant/src/completion_provider/ollama.rs
+++ b/crates/assistant/src/completion_provider/ollama.rs
@@ -240,7 +240,7 @@ impl OllamaCompletionProvider {
},
})
.collect(),
- keep_alive: model.keep_alive,
+ keep_alive: model.keep_alive.unwrap_or_default(),
stream: true,
options: Some(ChatOptions {
num_ctx: Some(model.max_tokens),
diff --git a/crates/ollama/src/ollama.rs b/crates/ollama/src/ollama.rs
index dbed4828404..d2dfd2155db 100644
--- a/crates/ollama/src/ollama.rs
+++ b/crates/ollama/src/ollama.rs
@@ -66,7 +66,7 @@ impl Default for KeepAlive {
pub struct Model {
pub name: String,
pub max_tokens: usize,
- pub keep_alive: KeepAlive,
+ pub keep_alive: Option<KeepAlive>,
}
impl Model {
@@ -74,7 +74,7 @@ impl Model {
Self {
name: name.to_owned(),
max_tokens: 2048,
- keep_alive: KeepAlive::indefinite(),
+ keep_alive: Some(KeepAlive::indefinite()),
}
}