Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Confident ai Deepeval Synthesizer

From Leeroopedia
Sources Domains Last Updated
DeepEval Synthetic_Data, LLM_Evaluation, Data_Management 2026-02-14 09:00 GMT

Overview

The Synthesizer class is the central orchestrator for synthetic evaluation data generation in DeepEval. It provides methods for generating evaluation goldens from documents, contexts, and existing golden templates.

Description

Synthesizer manages the entire synthetic data generation pipeline, including LLM configuration, async execution, quality filtration, query evolution, and output styling. It accepts an LLM model (string identifier or custom DeepEvalBaseLLM), configurable concurrency settings, and optional configuration objects for filtration, evolution, and styling. The class exposes methods such as generate_goldens_from_docs, generate_goldens_from_contexts, and others for different generation workflows.

Usage

Instantiate a Synthesizer with the desired LLM and configuration, then call one of its generation methods to produce evaluation goldens.

Code Reference

Source Location: Repository: confident-ai/deepeval, File: deepeval/synthesizer/synthesizer.py (L110-157)

Signature:

class Synthesizer:
    def __init__(
        self,
        model: Optional[Union[str, DeepEvalBaseLLM]] = None,
        async_mode: bool = True,
        max_concurrent: int = 100,
        filtration_config: Optional[FiltrationConfig] = None,
        evolution_config: Optional[EvolutionConfig] = None,
        styling_config: Optional[StylingConfig] = None,
        conversational_styling_config: Optional[ConversationalStylingConfig] = None,
        cost_tracking: bool = False,
    ):
        ...

Import:

from deepeval.synthesizer import Synthesizer

I/O Contract

Inputs:

Parameter Type Required Description
model Optional[Union[str, DeepEvalBaseLLM]] No LLM for synthetic data generation (defaults to framework default)
async_mode bool No Enable asynchronous generation (default: True)
max_concurrent int No Maximum number of parallel generation tasks (default: 100)
filtration_config Optional[FiltrationConfig] No Configuration for quality filtering of generated goldens
evolution_config Optional[EvolutionConfig] No Configuration for query evolution strategies
styling_config Optional[StylingConfig] No Configuration for output formatting and styling
conversational_styling_config Optional[ConversationalStylingConfig] No Configuration for conversational output styling
cost_tracking bool No Enable token cost tracking during generation (default: False)

Outputs:

  • Synthesizer instance -- configured synthesizer ready to generate evaluation goldens via its generation methods

Usage Examples

from deepeval.synthesizer import Synthesizer

# Basic instantiation with default model
synthesizer = Synthesizer()

# With explicit model and configuration
synthesizer = Synthesizer(
    model="gpt-4o",
    async_mode=True,
    max_concurrent=50,
    cost_tracking=True,
)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment