NVIDIA / NVIDIA/SkillSpector

Add opt-in compact prompts mode to reduce LLM token usage

Open
#456 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
17.9k
Forks
1.5k
Avg merge
5d 10h
Merged PRs (30d)
66

Description

LLM analyzer prompts carry redundant content that inflates token consumption without improving detection quality:

  • Line numbers are zero-padded (L001: instead of L1:), adding ~3 wasted characters per line across every file sent to the LLM.
  • The meta-analyzer embeds each finding's context snippet in the prompt alongside the full line-numbered file content, duplicating the same code.
  • The OverallAssessment field in MetaAnalyzerResult is generated by the LLM but never consumed downstream (the report node computes its own risk score).
  • Several analyzer prompts (SSD, SDI, SQP, meta-analyzer, TP4) contain repeated phrasing, verbose formatting (horizontal rules, per-section rule-ID reminders already present in the
    summary table), and filler sentences.

Proposal: Introduce a SKILLSPECTOR_COMPACT_PROMPTS=true environment variable that activates condensed prompt variants. Default behavior stays identical for backward compatibility.
When enabled:

  1. Line numbers drop zero-padding (L1: instead of L001:)
  2. Meta-analyzer omits redundant finding context from the prompt
  3. Meta-analyzer uses a slimmer structured output schema (no OverallAssessment)
  4. All five LLM analyzer prompts use condensed variants (same semantic content, less formatting overhead)
  5. BASE_ANALYSIS_PROMPT output guidelines shortened from 5 lines to 2

Estimated savings per scan: 400-800 input tokens from prompt condensation, ~375 input tokens per call from line numbering (on a 500-line file), 30-50 output tokens per meta-analyzer call from schema reduction, plus variable savings from context omission.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the analyzer prompt definitions, BASE_ANALYSIS_PROMPT, MetaAnalyzerResult, and the line-number formatting described in the issue. Trace how prompt configuration is selected, then verify that the opt-in mode condenses all listed prompts and removes redundant meta-analyzer data while default behavior remains unchanged and the stated token savings are achieved.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.