Multi-stage evidence-grounded inference architecture replacing the monolithic 9B model extraction pipeline. CPU-first specialist services handle routine extraction while the 9B vLLM model is preserved for semantic adjudication of ambiguous cases. Key components: - Capability-aware inference gateway (OpenAI-compatible + Ollama) - Endpoint registry with DB migrations and REST API - Sentence-aware document segmenter (property tests) - Deterministic financial parsing with offset integrity - Symbol resolution with ambiguity detection - Specialist service (GLiNER2, dynamic batching, K8s deployment) - Company-specific sentiment (FinBERT, calibration) - Retrieval-based novelty and duplicate detection - Confidence calibration pipeline - Deterministic routing engine (property tests) - 9B adjudication layer with VRAM gating - Stock-specific impact model (features, labels, baseline, trained) - Pipeline orchestrator (state machine, queues, leases, feature flags) - Bounded parallelism (async workers, semaphore, load shedding) - Observability (tracing, metrics, alerts) - Compatibility adapter (v3→v2 golden mapping tests) - Shadow/canary promotion framework - Active learning and fine-tuning pipeline Test results: 1,161 tests pass, ruff lint clean. All 282 spec tasks completed.
61 lines
1.7 KiB
Python
61 lines
1.7 KiB
Python
"""Adjudication layer for Intelligence Pipeline v3.
|
|
|
|
This package provides:
|
|
- Schemas for adjudication candidates, conflicts, evidence, questions, and decisions
|
|
- Focused adjudication prompt building with strict JSON Schema output
|
|
- 9B adjudicator deployment configuration and VRAM gating
|
|
- Post-adjudication verification ensuring evidence grounding
|
|
"""
|
|
|
|
from services.intelligence_pipeline_v3.adjudication.deployment import (
|
|
APPROVED_MODEL,
|
|
APPROVED_VLLM_VERSION,
|
|
AlertConfig,
|
|
ConcurrencySemaphore,
|
|
check_vram_gate,
|
|
verify_structured_output,
|
|
)
|
|
from services.intelligence_pipeline_v3.adjudication.prompts import (
|
|
AdjudicationPacket,
|
|
PromptMetadata,
|
|
build_adjudication_packet,
|
|
)
|
|
from services.intelligence_pipeline_v3.adjudication.schemas import (
|
|
AdjudicationCandidate,
|
|
AdjudicationDecision,
|
|
AdjudicationQuestion,
|
|
ConflictDescription,
|
|
EvidencePacket,
|
|
)
|
|
from services.intelligence_pipeline_v3.adjudication.verification import (
|
|
AdjudicationRecord,
|
|
RejectionResult,
|
|
preserve_pre_and_post,
|
|
reject_unsupported_decisions,
|
|
route_repeated_failures,
|
|
verify_evidence_references,
|
|
)
|
|
|
|
__all__ = [
|
|
"APPROVED_MODEL",
|
|
"APPROVED_VLLM_VERSION",
|
|
"AdjudicationCandidate",
|
|
"AdjudicationDecision",
|
|
"AdjudicationPacket",
|
|
"AdjudicationQuestion",
|
|
"AdjudicationRecord",
|
|
"AlertConfig",
|
|
"ConcurrencySemaphore",
|
|
"ConflictDescription",
|
|
"EvidencePacket",
|
|
"PromptMetadata",
|
|
"RejectionResult",
|
|
"build_adjudication_packet",
|
|
"check_vram_gate",
|
|
"preserve_pre_and_post",
|
|
"reject_unsupported_decisions",
|
|
"route_repeated_failures",
|
|
"verify_evidence_references",
|
|
"verify_structured_output",
|
|
]
|