feat(gate): MCPCTL_GATE_SELECTION_LLM — pin a dedicated fast selection Llm
Some checks failed
CI/CD / lint (pull_request) Successful in 1m2s
CI/CD / typecheck (pull_request) Successful in 2m7s
CI/CD / test (pull_request) Successful in 1m19s
CI/CD / build (pull_request) Successful in 2m11s
CI/CD / smoke (pull_request) Failing after 2m47s
CI/CD / publish (pull_request) Has been skipped

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) <noreply@anthropic.com>
This commit is contained in:
Michal
2026-07-24 14:28:44 +01:00
parent 27480181bf
commit 5225b54901

View File

@@ -147,10 +147,14 @@ export function registerProjectMcpEndpoint(app: FastifyInstance, mcpdClient: Mcp
providerRegistry: effectiveRegistry, providerRegistry: effectiveRegistry,
}; };
if (resolvedModel) pluginConfig.modelOverride = resolvedModel; if (resolvedModel) pluginConfig.modelOverride = resolvedModel;
// Route gate prompt-selection through this project's server Llm (mcpd // Route gate prompt-selection through a server Llm (mcpd inference proxy)
// inference proxy) so cloud/server keys stay at the k8s level; the local // so cloud/server keys stay at the k8s level; the local personal-token
// personal-token provider is the fallback. See credential-tiering. // provider is the fallback. See credential-tiering. A dedicated fast
if (mcpdConfig.llmProvider) pluginConfig.llmProvider = mcpdConfig.llmProvider; // (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); const basePlugin = createDefaultPlugin(pluginConfig);
// Optional favourite-index presentation: curated favourite/<tool> + full // Optional favourite-index presentation: curated favourite/<tool> + full
// all/<server>/<tool> + a "prefer favourite/" instruction. Composed AFTER // all/<server>/<tool> + a "prefer favourite/" instruction. Composed AFTER