Skip to content

feat(llm): configurable analyzer fan-out concurrency via SKILLSPECTOR_MAX_LLM_CONCURRENCY (part of #303)#305

Open
Mark2Mac wants to merge 1 commit into
NVIDIA:mainfrom
Mark2Mac:feat/configurable-llm-concurrency
Open

feat(llm): configurable analyzer fan-out concurrency via SKILLSPECTOR_MAX_LLM_CONCURRENCY (part of #303)#305
Mark2Mac wants to merge 1 commit into
NVIDIA:mainfrom
Mark2Mac:feat/configurable-llm-concurrency

Conversation

@Mark2Mac

Copy link
Copy Markdown

What

arun_batches fans out up to a hardcoded max_concurrency=10. On a rate-limited provider (free tiers with a low RPM) that burst guarantees 429s, and — per the method's own contract — 429'd batches are logged and omitted from the result. The scan silently loses analyzer coverage, including the security-critical semantic_security_discovery batch, while still emitting a full risk_assessment. A genuinely malicious skill can then read as clean.

This adds an env knob so users on such tiers can serialize the fan-out and stay under the limit:

SKILLSPECTOR_MAX_LLM_CONCURRENCY=1 skillspector scan ./skill/
  • Default unchanged (10). An explicit max_concurrency= argument still wins.
  • Invalid values fall back to the default; values < 1 clamp to 1.

Test

TestResolveMaxConcurrency: unset→default, valid→value, blank→default, invalid→default, 0→1. Full test_llm_analyzer_base.py suite green (116 passed); ruff clean.

Scope

This is the first of the three asks in #303 (configurable concurrency). The retry/backoff on 429 and surfacing a partial LLM pass in the verdict are larger changes left for separate PRs / discussion.

Refs #303

`arun_batches` bursts up to a hardcoded `max_concurrency=10`. On a rate-limited
provider (free tiers with a low RPM) that burst guarantees 429s, and 429'd
batches are dropped from the result — silently losing analyzer coverage,
including the security-critical `semantic_security_discovery` batch, while the
report still renders a full risk_assessment.

Add `SKILLSPECTOR_MAX_LLM_CONCURRENCY` so users can serialize the fan-out
(set it to 1) and stay under the provider's rate limit. The default stays 10;
an explicit `max_concurrency=` argument still wins. Invalid values fall back to
the default, values < 1 clamp to 1.

Part of NVIDIA#303 (the retry/backoff and partial-pass surfacing are separate). Adds
unit tests for the env resolution.

Signed-off-by: Mark2Mac <Mark2Mac@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant