From 56a6fe0ecbf73ad0a9cd35e97162d109d7980bc9 Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Thu, 5 Nov 2026 11:02:19 +0100 Subject: [PATCH] engine: the expert-bank admission accepts a binding without KAR under LELEKA_ORIGINAL_SERVE_GGUF_PLE=1; quality job sets it for the GGUF arm Co-Authored-By: Claude Sonnet 5.5 --- .../model_binding/qwen4exp_resident_expert_source.rs | 12 +++++++++--- scripts/e2e/kar-off/kar_off_quality_job.sh | 2 +- scripts/e2e/kar-off/kar_off_stubs.sh | 4 +++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/crates/leleka-runtime/src/model_binding/qwen4exp_resident_expert_source.rs b/crates/leleka-runtime/src/model_binding/qwen4exp_resident_expert_source.rs index 3555364b..aa39fe3d 100644 --- a/crates/leleka-runtime/src/model_binding/qwen4exp_resident_expert_source.rs +++ b/crates/leleka-runtime/src/model_binding/qwen4exp_resident_expert_source.rs @@ -2,6 +2,12 @@ use super::*; use leleka_model_format::qwen4exp::{ResidentExpertSourceError, ResidentExpertSourceReport}; +/// EXPERIMENTAL `LELEKA_ORIGINAL_SERVE_GGUF_PLE=1` (profile `rtx5090-32g-gguf-ple`): a binding without a KAR archive (PLE rows from the GGUF shard, +/// `qwen4exp-native-mtp-v1`) may take the expert bank too. Off by default: without it a binding needs both providers, as before. +fn gguf_ple_opt_in() -> bool { + std::env::var("LELEKA_ORIGINAL_SERVE_GGUF_PLE").is_ok_and(|v| v == "1") +} + impl ModelBinding { /// Root invokes this on its fresh mutable selected binding after actual /// KAR/MTP admission, before Driver, preload, sessions or Ready publication. @@ -10,7 +16,7 @@ impl ModelBinding { pub(crate) fn load_resident_expert_source( &mut self, ) -> InputResult { - if self.kar_ple.is_none() || self.mtp.is_none() { + if (self.kar_ple.is_none() && !gguf_ple_opt_in()) || self.mtp.is_none() { return Err(InputBindingError::Metadata); } self.mtp_weights()?; @@ -31,7 +37,7 @@ impl ModelBinding { pub(crate) fn load_mapped_expert_source( &mut self, ) -> InputResult { - if self.kar_ple.is_none() || self.mtp.is_none() { + if (self.kar_ple.is_none() && !gguf_ple_opt_in()) || self.mtp.is_none() { return Err(InputBindingError::Metadata); } self.mtp_weights()?; @@ -64,7 +70,7 @@ impl ModelBinding { &mut self, capture: leleka_model_format::qwen4exp::ProvisionalExpertSource, ) -> InputResult { - if self.kar_ple.is_none() || self.mtp.is_none() { + if (self.kar_ple.is_none() && !gguf_ple_opt_in()) || self.mtp.is_none() { return Err(InputBindingError::Metadata); } self.mtp_weights()?; diff --git a/scripts/e2e/kar-off/kar_off_quality_job.sh b/scripts/e2e/kar-off/kar_off_quality_job.sh index 4221313f..25cb2edf 100644 --- a/scripts/e2e/kar-off/kar_off_quality_job.sh +++ b/scripts/e2e/kar-off/kar_off_quality_job.sh @@ -41,7 +41,7 @@ for src in ${KQ_ARMS:-kar gguf}; do LELEKA_ORIGINAL_SERVE_REPLAY=yes LELEKA_REPLAY_DIR=$Q/inputs/data/cap-both LELEKA_REPLAY_FORCE=1 "LELEKA_REPLAY_ARMS=$ARMS" LELEKA_REPLAY_PREFIX_MIB=6144 ) [ -z "${KQ_MAX_NEW:-}" ] || DEFAULTS+=(LELEKA_REPLAY_MAX_NEW=$KQ_MAX_NEW) - [ "$src" = gguf ] && DEFAULTS+=(LELEKA_REPLAY_GGUF_PLE=1) + [ "$src" = gguf ] && DEFAULTS+=(LELEKA_REPLAY_GGUF_PLE=1 LELEKA_ORIGINAL_SERVE_GGUF_PLE=1) got=0 for _ in $(seq 1 4320); do if mkdir $LOCK 2>/dev/null; then echo "kar-off-quality $src $(date -u +%FT%TZ)" >$LOCK/owner; got=1; break; fi diff --git a/scripts/e2e/kar-off/kar_off_stubs.sh b/scripts/e2e/kar-off/kar_off_stubs.sh index 95b37196..ea504009 100644 --- a/scripts/e2e/kar-off/kar_off_stubs.sh +++ b/scripts/e2e/kar-off/kar_off_stubs.sh @@ -13,12 +13,14 @@ name=kar-off-$KIND [ -e "$J/$name.sh" ] && { echo "$J/$name.sh exists"; exit 1; } case $KIND in smoke) payload=kar_off_speed_job.sh; env_words="KO_ORDER=\"gguf kar\" KO_MAX=2 KO_OUT=$K/runs/smoke";; + smoke2) payload=kar_off_speed_job.sh; env_words="KO_ORDER=\"gguf kar\" KO_MAX=2 KO_OUT=$K/runs/smoke2";; speed) payload=kar_off_speed_job.sh; env_words="KO_OUT=$K/runs/speed";; codex) payload=kar_off_codex_job.sh; env_words="KO_OUT=$K/runs/codex";; quality) payload=kar_off_quality_job.sh; env_words="";; + quality2) payload=kar_off_quality_job.sh; env_words="KQ_ARMS=gguf KQ_OUT=$K/runs/quality2";; *) echo "unknown kind"; exit 2;; esac -if [ "$KIND" = quality ]; then +if [ "${KIND%2}" = quality ]; then cat > "$J/$name.sh" <