Run many requests with detect_batch and adetect_batch
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
- 30/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- backend, machine-learning
Línea de trabajo
Start with the batch result type and failure reporting decision referenced in #126, then review the detector contract and the blocked work in #148, #156, #162, #166, and #169. Implement and check the batch contract across each detector, including concurrency, encoder batching, and the predict_prompt_batch adapters. Done means the listed acceptance criteria and existing tests pass.
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
A service developer sends a list of DetectRequest items to any detector and gets one result per request in input order, with the encoder scoring them in padded batches and the LLM-backed detectors running them concurrently under a limit the caller sets. One failed request doesn't throw away the results of the others, reported in the way the batch result decision defines.
The old predict_prompt_batch on every detector becomes an adapter over detect_batch. It keeps today's output, and it keeps raising on the first failure, as today.
Acceptance criteria
-
detect_batch(requests, *, min_score=0.0, include_tokens=False, include_detail=False)andadetect_batchexist on every detector, take any mix ofSourcesInputandPromptInput, and return one result per request in input order. An empty sequence returns an empty result. - The result type and the way a failed request is reported are the ones the batch result decision defines. Whatever it defines, the results of requests that succeeded are returned alongside the failures.
-
EncoderDetectorscores requests in padded groups ofconfig.batch_sizein one forward pass per group, and each result equals the result of a singledetectcall for the same request (includingusagefor that request). - Gathered
adetectcalls andadetect_batchcalls on oneEncoderDetector, single and padded-batch mixed, return the same results as the same requests run one by one (the encoder serialises scoring with its own lock, see task #148). -
LLMJudgeDetectorandGenerativeDetectorrun requests concurrently with at mostconfig.max_concurrencyclient calls in flight per detector instance (max_concurrencydefaults to 30), counted acrossdetect,adetect,detect_batchandadetect_batchtogether, and each result equals the singledetectresult. -
RAGFactCheckerDetectorruns its requests through the same concurrent path, bounded by itsmax_concurrencykeyword on concurrentdetectcalls. -
include_tokens=Trueandinclude_detail=TrueraiseInvalidInputErrorfor the whole batch on detectors that don't support them, before any request runs. -
adetect_batchis a coroutine function that runsdetect_batchin a worker thread and returns an equal result (results, order, per-request failures). It is inherited by every detector, including those that overridedetect_batch. -
adetect_batchleaves the event loop free while it waits. Its whole-batch errors (unsupported flags) come from the awaited call before any request runs, an empty sequence returns an empty result, andmax_concurrencystill bounds in-flight calls, also across gatheredadetect_batchcalls and a batch running next to singledetectoradetectcalls. - The detector contract suite gains a batch section that runs for every detector: order, empty input, equal to single calls,
adetect_batchequal todetect_batch, and the failure reporting once decided. -
predict_prompt_batchonTransformerDetector,LLMDetectorandRAGFactCheckerDetectorcallsdetect_batchand returns today's output (golden fixtures); a failed request raises the first error, as today. - 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
#148, #156, #162, #166, #169, and the decision elsewhere on the batch result type and failure reporting (see Further Notes in #126).
User stories covered
35, 36, 37, 38, 40, 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 16 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
-
Add AGENTS.md: one entry file for coding agents and new contributorsPosiblemente ocupada @ShryukGrandhi la tomó hace 17 días. Abiertodocumentation
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
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
strawberry-graphql/strawberry#4794 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
dataforgoodfr/cetolog#21 ·
-
security_citations_test fails against ecc 2026.11.6: SECURITY.md quotes ecc v2026.11.2's linesAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
btclib-org/btclib#2932 ·
Los mantenedores suelen responder en 1 día
-
metrics priority: medium
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
LearningCircuit/local-deep-research#8336 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100