From 6b94e7c14fd6cb7146e10ae6cf6c1bf74d087e89 Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Sat, 17 Oct 2026 18:31:11 +0200 Subject: [PATCH] perf(serve): prompt-routing seed is on by default when the tier config is read from the environment (LELEKA_ORIGINAL_SERVE_SEED=off disables) Operator decision: long-running agent sessions; a fresh process starts from the prompt's own routing. Measured first-request gain: docs/original-serve.md. Co-Authored-By: Claude Sonnet 5.5 --- .../src/qwen_forward/original_serve_residency.rs | 5 ++++- .../leleka-runtime/src/qwen_forward/original_serve_seed.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/leleka-runtime/src/qwen_forward/original_serve_residency.rs b/crates/leleka-runtime/src/qwen_forward/original_serve_residency.rs index e139480c..a0f506da 100644 --- a/crates/leleka-runtime/src/qwen_forward/original_serve_residency.rs +++ b/crates/leleka-runtime/src/qwen_forward/original_serve_residency.rs @@ -97,7 +97,7 @@ pub(crate) struct ExpertTierConfig { pub(crate) resident_budget_gib: f64, /// EXPERIMENTAL, port-only (`LELEKA_ORIGINAL_SERVE_SEED`): at the end of each request's prompt phase the experts the /// prompt's own prefill routed to replace the least-routed resident ones, in one batch of at most this many swaps - /// (0: off, the default). See `original_serve_seed`. + /// (0: off). Default when the configuration comes from the environment: `DEFAULT_SEED_SWAPS` (on); `ExpertTierConfig::off()` keeps 0. See `original_serve_seed`. pub(crate) seed_swaps: usize, /// `_SEED_KEEP`: routed-row credit given to every resident expert when ranking the seed's swaps (the blend with the /// starting profile; 0 = the prompt's counts alone). @@ -206,6 +206,9 @@ impl ExpertTierConfig { if let Some(v) = var("RESIDENT_BUDGET_GIB") { config.resident_budget_gib = v.parse().map_err(|_| Error::InvalidDimension)?; } + // Default ON (operator decision: long-running agent sessions; a fresh process starts from the prompt's own + // routing). `LELEKA_ORIGINAL_SERVE_SEED=off` restores the plain profile start. + config.seed_swaps = super::original_serve_seed::DEFAULT_SEED_SWAPS; if let Some(v) = var("SEED") { config.seed_swaps = match v.as_str() { "off" | "no" | "0" => 0, diff --git a/crates/leleka-runtime/src/qwen_forward/original_serve_seed.rs b/crates/leleka-runtime/src/qwen_forward/original_serve_seed.rs index 2f4fabf6..a6bff6dc 100644 --- a/crates/leleka-runtime/src/qwen_forward/original_serve_seed.rs +++ b/crates/leleka-runtime/src/qwen_forward/original_serve_seed.rs @@ -1,4 +1,4 @@ -//! EXPERIMENTAL, off by default (`LELEKA_ORIGINAL_SERVE_SEED`): residency seeded from the prompt's own routing. +//! ON by default when the configuration is read from the environment (`LELEKA_ORIGINAL_SERVE_SEED=off` disables; formerly experimental): residency seeded from the prompt's own routing. //! //! The Original's adaptive tier learns which experts to keep in VRAM from the verified windows, a few rounds at a time //! (`ADAPT_EVERY` rounds, at most `ADAPT_SWAPS` swaps), so a first request decodes on the starting profile's placement