dependabit / detector/src / LLMProvider
Interface: LLMProvider
Defined in: packages/detector/src/llm/client.ts:148
Contract that all LLM provider implementations must satisfy.
Remarks
The only method called by the Detector is analyze. getSupportedModels, getRateLimit, and validateConfig exist for diagnostic and health-check purposes.
Use When
You need to plug in a custom or self-hosted language model as the classification backend for the detector.
Avoid When
You only need programmatic heuristics — constructing a stub provider that always returns an empty dependencies array has a small overhead but is safe.
Pitfalls
- Provider implementations must return valid JSON matching the
LLMResponseshape. Returning plain text causes the detector to silently produce zero LLM-sourced results. - Do NOT cache the
analyzeresponse across differentmodelvalues — classification schemes differ between model versions.
Methods
analyze()
analyze(content, prompt): Promise<LLMResponse>;Defined in: packages/detector/src/llm/client.ts:155
Analyze content and detect external dependencies
Parameters
| Parameter | Type | Description |
|---|---|---|
content | string | Text content to analyze (README, code, etc.) |
prompt | string | Detection prompt template |
Returns
Promise<LLMResponse>
LLM response with detected dependencies
getRateLimit()
getRateLimit(): Promise<RateLimitInfo>;Defined in: packages/detector/src/llm/client.ts:165
Get current rate limit status
Returns
Promise<RateLimitInfo>
getSupportedModels()
getSupportedModels(): string[];Defined in: packages/detector/src/llm/client.ts:160
Get list of supported models for this provider
Returns
string[]
validateConfig()
validateConfig(): boolean;Defined in: packages/detector/src/llm/client.ts:170
Validate provider configuration
Returns
boolean