Keep LLMDetector working as a warning adapter
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- backend-api-design
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Python
- Estrellas
- 615
- Forks
- 60
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 10
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de KRLabsOrg/LettuceDetect
-
Stop-hook --min-confidence drops every --llm-model span (missing confidence treated as 0.0), reporting hallucinated answers as cleanPosiblemente ocupada @Clannad47 la tomó hace 18 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
KRLabsOrg/LettuceDetect#117 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
KRLabsOrg/LettuceDetect#108 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 Medio día Aptitud para principiantes 70/100
KRLabsOrg/LettuceDetect#104 ·
Los mantenedores suelen responder en 1 día
-
ready-for-agent
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
KRLabsOrg/LettuceDetect#181 ·
Los mantenedores suelen responder en 1 día
-
ready-for-agent
Dificultad 5/5 Más de una semana Aptitud para principiantes 22/100
KRLabsOrg/LettuceDetect#180 ·
Los mantenedores suelen responder en 1 día
Todos los issues de KRLabsOrg/LettuceDetect
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
igormcsouza/tether#278 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
aws-samples/sample-per-model-bedrock#803 ·
Los mantenedores suelen responder en 1 día
-
documentation p1
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
huggingface/accelerate#4511 ·
Los mantenedores suelen responder en 1 día
-
follow-up
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día