Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 5959819

Browse files
authored
Merge pull request #480 from janhq/479-bug-weird-caching-behavior
bug: enable and fix the cache again
2 parents fdd770d + dc77ce1 commit 5959819

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

context/llama_server_context.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ struct llama_server_context {
471471
llama_batch batch;
472472

473473
bool multimodal = false;
474-
bool clean_kv_cache = true;
474+
bool clean_kv_cache = false;
475475
bool all_slots_are_idle = false;
476476
bool add_bos_token = true;
477477

@@ -860,7 +860,6 @@ struct llama_server_context {
860860
void kv_cache_clear() {
861861
// clear the entire KV cache
862862
llama_kv_cache_clear(ctx);
863-
clean_kv_cache = false;
864863
}
865864

866865
void update_system_prompt() {

controllers/llamaCPP.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ bool llamaCPP::LoadModelImpl(std::shared_ptr<Json::Value> jsonBody) {
615615
params.cont_batching = jsonBody->get("cont_batching", false).asBool();
616616
this->clean_cache_threshold =
617617
jsonBody->get("clean_cache_threshold", 5).asInt();
618-
this->caching_enabled = jsonBody->get("caching_enabled", false).asBool();
618+
this->caching_enabled = jsonBody->get("caching_enabled", true).asBool();
619619
this->user_prompt = jsonBody->get("user_prompt", "USER: ").asString();
620620
this->ai_prompt = jsonBody->get("ai_prompt", "ASSISTANT: ").asString();
621621
this->system_prompt =

0 commit comments

Comments
 (0)