Keep LLMDetector working as a warning adapter
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 38/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
Read the parent issue #126, blockers #156 and #162, and the Errors and logging section of CONTRIBUTING.md; branch from stateless_core. Locate LLMDetector, LLMJudgeDetector, GenerativeDetector, HallucinationDetector, and the golden fixtures and existing tests. Compare current behavior with the acceptance criteria, then verify the old outputs, typed errors, warning behavior, and cache behavior against those tests.
索引モデルが issue の本文から書いたものです。
説明
Parent
#126
Branch
Branch from stateless_core and open the pull request against it, not main. Close this ticket by hand once its pull request merges there: GitHub only closes issues automatically on merges into main.
What to build
Everyone who builds LLMDetector today keeps working and learns what to change. LLMDetector becomes a thin adapter: it chooses LLMJudgeDetector or GenerativeDetector by today's name rule or by native=, builds the client and the cache the old way when the caller passes none, and warns for each deprecated use, naming the replacement. The default cache file inside the installed package directory is gone: a file is written only when the caller passes cache_file.
The old predict* output, including the token output of the LLM detector, stays as today's golden fixtures record it.
Acceptance criteria
- Constructing
LLMDetectorfrom outside the package warnsLettuceDetectDeprecationWarningnamingLLMJudgeDetectorandGenerativeDetector; constructing it from inside the package does not warn. -
LLMDetectorpicksGenerativeDetectorfor a model name that matches today's rule, andLLMJudgeDetectorfor any other.native=Trueornative=Falseoverrides the rule. -
native=True(or a name that matches the rule) together withzero_shot,fewshot_pathorprompt_pathraisesConfigurationError(native_options_conflict, withparam), as today'sValueErrorcase does. - Without
client,LLMDetectorbuilds one fromproviderand**client_kwargsas today and warns that the client should be passed; passingproviderorclient_kwargswarns as a deprecated argument. -
cache_filebuilds aFileCacheand warns as a deprecated argument namingcache=. With nocache_filethe detector has no cache and no file is written anywhere. -
predict,predict_promptandpredict_prompt_batchconvert the new detector'sDetectioninto today's dicts, withconfidencetaken fromscoreand each key present exactly as today (golden fixtures), apart from spans that had noconfidencenow carrying 1.0. -
predict(output_format="tokens")still returns onetoken,predandprobdict per whitespace token, withprobthe overlapping span'sconfidencewhen there is one, else 0.9 for a flagged token and 0.1 for the others, as in the golden fixtures. - The old methods raise
InvalidInputError(unsupported_output_format,length_mismatch,invalid_min_score) and surface the typed errors of the new detector. -
predict_prompt_batchis unchanged apart from the above until the batch task. -
LLMDetectoralso exposesdetectandadetect, forwarding to the chosen delegate: the result equals the delegate's,model_idis the delegate's, and no warning is added beyond the one at construction. -
LLMDetectorhas the docstring note from the deprecation mechanism, andHallucinationDetector(method="llm", ...)returns today's output without a warning. - The existing tests pass unchanged.
- The changed code follows the Errors and logging section of
CONTRIBUTING.md, and no customer text is logged outsidelettucedetect.content.
Blocked by
#156, #162
User stories covered
40, 44, 45, 46, 47, 48, 57
- 主要言語
- Python
- スター
- 615
- フォーク
- 60
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 10
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
KRLabsOrg/LettuceDetect のほかの issue
-
Stop-hook --min-confidence drops every --llm-model span (missing confidence treated as 0.0), reporting hallucinated answers as clean対応中かも @Clannad47 が 18 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
KRLabsOrg/LettuceDetect#117 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
KRLabsOrg/LettuceDetect#108 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 半日 初心者へのやさしさ 70/100
KRLabsOrg/LettuceDetect#104 ·
メンテナーはふだん 1 日以内に返信
-
ready-for-agent
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
KRLabsOrg/LettuceDetect#181 ·
メンテナーはふだん 1 日以内に返信
-
ready-for-agent
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
KRLabsOrg/LettuceDetect#180 ·
メンテナーはふだん 1 日以内に返信
KRLabsOrg/LettuceDetect の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
igormcsouza/tether#278 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
aws-samples/sample-per-model-bedrock#803 ·
メンテナーはふだん 1 日以内に返信
-
documentation p1
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
huggingface/accelerate#4511 ·
メンテナーはふだん 1 日以内に返信
-
follow-up
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信