From 5225b54901d91297277ee5a4054c56180f82b7da Mon Sep 17 00:00:00 2001 From: Michal Date: Fri, 24 Jul 2026 14:28:44 +0100 Subject: [PATCH] =?UTF-8?q?feat(gate):=20MCPCTL=5FGATE=5FSELECTION=5FLLM?= =?UTF-8?q?=20=E2=80=94=20pin=20a=20dedicated=20fast=20selection=20Llm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lets ops route gate prompt-selection at a fast (no-think) server Llm independent of the project's chat llmProvider — so selection stays ~1-2s while chat keeps its thinking model. Overrides the project llmProvider for the gate's server-selection path; unset → prior behavior (use the project's llmProvider). Pairs with the litellm qwen3-fast no-think alias (kubernetes-deployment) + a `vllm-fast` mcpd Llm. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/mcplocal/src/http/project-mcp-endpoint.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mcplocal/src/http/project-mcp-endpoint.ts b/src/mcplocal/src/http/project-mcp-endpoint.ts index 4a38d37..274b6b7 100644 --- a/src/mcplocal/src/http/project-mcp-endpoint.ts +++ b/src/mcplocal/src/http/project-mcp-endpoint.ts @@ -147,10 +147,14 @@ export function registerProjectMcpEndpoint(app: FastifyInstance, mcpdClient: Mcp providerRegistry: effectiveRegistry, }; if (resolvedModel) pluginConfig.modelOverride = resolvedModel; - // Route gate prompt-selection through this project's server Llm (mcpd - // inference proxy) so cloud/server keys stay at the k8s level; the local - // personal-token provider is the fallback. See credential-tiering. - if (mcpdConfig.llmProvider) pluginConfig.llmProvider = mcpdConfig.llmProvider; + // Route gate prompt-selection through a server Llm (mcpd inference proxy) + // so cloud/server keys stay at the k8s level; the local personal-token + // provider is the fallback. See credential-tiering. A dedicated fast + // (no-think) selection Llm can be pinned globally via + // MCPCTL_GATE_SELECTION_LLM — it overrides the project's chat llmProvider so + // selection stays fast while chat keeps its (thinking) model. + const gateSelectionLlm = process.env['MCPCTL_GATE_SELECTION_LLM'] || mcpdConfig.llmProvider; + if (gateSelectionLlm) pluginConfig.llmProvider = gateSelectionLlm; const basePlugin = createDefaultPlugin(pluginConfig); // Optional favourite-index presentation: curated favourite/ + full // all// + a "prefer favourite/" instruction. Composed AFTER