openclaw / openclaw/openclaw-windows-node

local-ai: llama-server automatically unloads kv-cache causing 20 second hit on TTFT

Open
#1,214 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

clawsweeper:bulk-filed clawsweeper:needs-info clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:other issue-rating: 🦪 silver shellfish P1 stale
Dominant language
C#
Stars
2.1k
Forks
295
Avg merge
1d 6h
Merged PRs (30d)
99

Description

After some inactivity, llama-server unloads the kv-cache (and possibly also the model). This causes a 20 second hit on time-to-first-token (TTFT) where 27k tokens of the system prompt are pre-filled.

Investigate:

  1. Does kv-cache have timeout based eviction and if yes, can we avoid evicting system prompt?
  2. Does the model weights also unload?

Change llama-cpp settings to correctly address these.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting llama-server's handling of kv-cache timeout eviction and whether model weights are unloaded after inactivity. Review the current llama-cpp settings and measure the effect on the 27k-token system prompt and TTFT. Done means the unload behavior is confirmed and the settings address the unwanted 20-second delay.

Written by the indexing model from the issue text.

Assessment

Domain
ai, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.