feat: add LLM enrichment for model name extraction#63
Open
cassiocouto wants to merge 2 commits intoTrusera:mainfrom
Open
feat: add LLM enrichment for model name extraction#63cassiocouto wants to merge 2 commits intoTrusera:mainfrom
cassiocouto wants to merge 2 commits intoTrusera:mainfrom
Conversation
Zie619
approved these changes
Mar 14, 2026
Contributor
Zie619
left a comment
There was a problem hiding this comment.
Great feature addition! Well-designed and thoroughly tested:
- Clean module structure (
enrichment/package with separate prompts, enricher, init) - Smart filtering — only enriches
llm_provider/modeltypes with emptymodel_name - Privacy-conscious with Ollama recommendation and cloud API warnings
- Batched LLM calls with graceful fallback to individual calls on error
- Model registry cross-referencing for provider/deprecation metadata
- 39 mocked tests covering all paths (parsing, batching, errors, CLI integration)
- Good docs in
enrichment.md - Also fixes the SARIF relative path bug
LGTM — merging once CI passes.
Contributor
|
CI caught formatting issues — 3 files need Quick fix: ruff format src/ai_bom/enrichment/llm_enricher.py tests/test_enrichment/test_cli_llm_enrich.py tests/test_enrichment/test_llm_enricher.pyOnce formatted, this is ready to merge! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #36 — adds optional LLM-based enrichment to extract specific model names (e.g.,
gpt-4o,claude-3-opus-20240229) from code snippets around detected AI components.--llm-enrichCLI flag with--llm-model,--llm-api-key, and--llm-base-urloptionsllm_providerandmodelcomponent types with emptymodel_name(filters out containers, tools, MCP servers, etc.)ollama/*for sensitive codebasesdocs/enrichment.mdwith usage guide, privacy section, and cost guidancetest_demo_command,test_sarif_relative_path_calculationon Windows)Test plan
pytest tests/test_enrichment/— 39 tests pass (prompt templates, JSON parsing, component filtering, batch/single enrichment, error handling, CLI flags, privacy warnings)pytest tests/— full suite: 786 passed, 0 failedruff check— no lint errors on new/modified files--llm-enrich --llm-model ollama/llama3against a real project (requires Ollama running locally)