Add LLM-based fallback for series matching via OpenAI #8307
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.
Introduces a new LLM (GPT) fallback mechanism for series matching when traditional parsing fails. Adds
ILlmSeriesMatchingServicewith OpenAI, caching, and rate-limiting implementations. Integrates LLM matching into ParsingService, adds new config options, and exposes a REST API for configuration and testing. Includes unit and integration tests, and updates DI and solution files. This improves matching for ambiguous, foreign, or scene releases in a safe and configurable way.Description
This PR adds an optional LLM-based fallback matching system for series identification when traditional parsing methods fail. The feature uses OpenAI-compatible APIs to intelligently match release titles to series in the user's library, significantly reducing manual import interventions.
Key Features:
ΓΒΌβΓΌ), foreign scripts (Japanese, Chinese, Korean, Cyrillic, Arabic), and various encoding issues common in release titlesArchitecture:
SeriesMatchType.Llmfor tracking match sourceDatabase Migration
YES - Adds the following configuration properties:
LlmMatchingEnabled(bool, default: false)OpenAiApiKey(string, encrypted)OpenAiApiEndpoint(string, default: OpenAI API)OpenAiModel(string, default: gpt-4o-mini)LlmConfidenceThreshold(double, default: 0.7)LlmMaxCallsPerHour(int, default: 60)LlmCacheEnabled(bool, default: true)LlmCacheDurationHours(int, default: 24)