feat(gate): terse selection prompt (~2s on no-think model) #89
@@ -95,7 +95,11 @@ export class LlmPromptSelector {
|
|||||||
): Promise<LlmSelectionResult> {
|
): Promise<LlmSelectionResult> {
|
||||||
const { getSystemPromptFn, signal, serverInfer } = opts;
|
const { getSystemPromptFn, signal, serverInfer } = opts;
|
||||||
|
|
||||||
const DEFAULT_SYSTEM_PROMPT = `You are a context selection assistant. Given a developer's task keywords and a list of available project prompts, select which prompts are relevant to their work. Return a JSON object with "selectedNames" (array of prompt names) and "reasoning" (brief explanation). Priority 10 prompts must always be included.`;
|
// Keep the answer SHORT: latency is proportional to output length (a
|
||||||
|
// no-think model runs ~10-13 tok/s), and a verbose reasoning field pushes a
|
||||||
|
// selection past the gate's responsiveness budget. Ask for compact JSON with
|
||||||
|
// a <=8-word reasoning — ~2s vs ~9s for a prose reasoning.
|
||||||
|
const DEFAULT_SYSTEM_PROMPT = `You are a context selection assistant. Given a developer's task keywords and available project prompts, select the relevant ones. Return ONLY compact JSON: {"selectedNames":[...],"reasoning":"<=8 words"}. No prose outside the JSON. Priority 10 prompts must always be included.`;
|
||||||
const systemPrompt = getSystemPromptFn
|
const systemPrompt = getSystemPromptFn
|
||||||
? await getSystemPromptFn('llm-gate-context-selector', DEFAULT_SYSTEM_PROMPT)
|
? await getSystemPromptFn('llm-gate-context-selector', DEFAULT_SYSTEM_PROMPT)
|
||||||
: DEFAULT_SYSTEM_PROMPT;
|
: DEFAULT_SYSTEM_PROMPT;
|
||||||
|
|||||||
Reference in New Issue
Block a user