Enable DeepSeek cache warming + HTTP/2 compression (v0.9.1)
Three improvements for DeepSeek API cost/performance: 1. Daemon cache warming: export DEEPSEEK_API_KEY, COLIBRI_CACHE_WARMING=true, COLIBRI_CACHE_WARMING_INTERVAL_HOURS=6 in rc.d prestart. Keeps DeepSeek prefix cache warm across sessions (~3,500 free tokens/request). 2. pi HTTP/2: change allowH2:false → true in http-dispatcher.js after npm install. Enables HPACK header compression and multiplexing for API calls (Node 24 + undici 8.3 handle this correctly). 3. Live verification: cache warming triggered and confirmed cache HIT with 3,584 hit tokens on first warm cycle. Tested: daemon restart, cache warming log, CLI status confirms enabled.
This commit is contained in:
parent
14e04d30de
commit
2605465e7e
2 changed files with 19 additions and 0 deletions
10
build.sh
10
build.sh
|
|
@ -902,6 +902,16 @@ install_live_npm_globals() {
|
|||
echo "ERROR: /opt/clawdie/npm-global ownership is ${_npm_owner}, expected clawdie:clawdie"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Fix pi HTTP/2: the bundled http-dispatcher sets allowH2:false to
|
||||
# work around a Node 26.0 undici decompression bug. We run Node 24
|
||||
# with undici 8.3, where H2 works correctly. Enabling HTTP/2 gives
|
||||
# HPACK header compression and multiplexing for API calls.
|
||||
_pi_dispatcher="${_live_prefix}/lib/node_modules/@earendil-works/pi-coding-agent/dist/core/http-dispatcher.js"
|
||||
if [ -f "${_pi_dispatcher}" ]; then
|
||||
sed -i '' 's/allowH2: false/allowH2: true/' "${_pi_dispatcher}"
|
||||
echo " pi http-dispatcher: allowH2 → true"
|
||||
fi
|
||||
}
|
||||
|
||||
seed_live_ai_source_repo() {
|
||||
|
|
|
|||
|
|
@ -103,6 +103,15 @@ sed -i '' '/socket ready/a\
|
|||
chmod 644 "${pidfile}" 2>/dev/null || true' \
|
||||
"${RC_DIR}/colibri_daemon"
|
||||
|
||||
# Add DeepSeek API key and cache warming to daemon environment.
|
||||
# These are injected into the rc.d prestart so the daemon picks them up
|
||||
# without needing a separate config file.
|
||||
sed -i '' '/export COLIBRI_COST_MODE/a\
|
||||
export DEEPSEEK_API_KEY="${DEEPSEEK_API_KEY:-}"\
|
||||
export COLIBRI_CACHE_WARMING="true"\
|
||||
export COLIBRI_CACHE_WARMING_INTERVAL_HOURS="6"' \
|
||||
"${RC_DIR}/colibri_daemon"
|
||||
|
||||
cat > "${ETC_DIR}/rc.conf.sample" <<EOF
|
||||
# Colibri control plane service defaults for the Clawdie ISO.
|
||||
# Merge into /etc/rc.conf or /etc/rc.conf.d/colibri_daemon.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue