Interceptors#
Interceptors provide fine-grained control over request and response processing during model evaluation through a configurable pipeline architecture.
Overview#
The adapter system processes model API calls through a configurable pipeline of interceptors. Each interceptor can inspect, modify, or augment requests and responses as they flow through the evaluation process.
graph LR
A[Evaluation Request] --> B[Adapter System]
B --> C[Interceptor Pipeline]
C --> D[Model API]
D --> E[Response Pipeline]
E --> F[Processed Response]
subgraph "Request Processing"
C --> G[System Message]
G --> H[Payload Modifier]
H --> I[Request Logging]
I --> J[Caching Check]
J --> K[Endpoint Call]
end
subgraph "Response Processing"
E --> L[Response Logging]
L --> M[Reasoning Extraction]
M --> N[Progress Tracking]
N --> O[Cache Storage]
end
style B fill:#f3e5f5
style C fill:#e1f5fe
style E fill:#e8f5e8
Request Interceptors#
Modify system messages in requests.
Add, remove, or modify request parameters.
Logs requests for debugging, analysis, and audit purposes.
Request-Response Interceptors#
Cache requests and responses to improve performance and reduce API calls.
Communicates with the model endpoint.
Response#
Logs responses for debugging, analysis, and audit purposes.
Track evaluation progress and status updates.
Allows to fail fast on non-retryable client errors
Handle reasoning tokens and track reasoning metrics.
Collects statistics from API responses for metrics collection and analysis.
Process Post-Evaluation Results#
Run additional processing, reporting, or cleanup after evaluations complete.