> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/datadesigner/llms.txt.
> For full documentation content, see https://docs.nvidia.com/nemo/datadesigner/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/datadesigner/_mcp/server.

# data\_designer.config.models

## Module Contents

### Classes

| Name                                                                                       | Description                                                                   |
| ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------- |
| [`Modality`](#data_designerconfigmodelsmodality)                                           | Supported modality types for multimodal model data.                           |
| [`ModalityDataType`](#data_designerconfigmodelsmodalitydatatype)                           | Data type formats for multimodal data.                                        |
| [`DistributionType`](#data_designerconfigmodelsdistributiontype)                           | Types of distributions for sampling inference parameters.                     |
| [`ModalityContext`](#data_designerconfigmodelsmodalitycontext)                             | Helper class that provides a standard way to create an ABC using inheritance. |
| [`ImageContext`](#data_designerconfigmodelsimagecontext)                                   | Configuration for providing image context to multimodal models.               |
| [`Distribution`](#data_designerconfigmodelsdistribution)                                   | Helper class that provides a standard way to create an ABC using inheritance. |
| [`ManualDistributionParams`](#data_designerconfigmodelsmanualdistributionparams)           | Parameters for manual distribution sampling.                                  |
| [`ManualDistribution`](#data_designerconfigmodelsmanualdistribution)                       | Manual (discrete) distribution for sampling inference parameters.             |
| [`UniformDistributionParams`](#data_designerconfigmodelsuniformdistributionparams)         | Parameters for uniform distribution sampling.                                 |
| [`UniformDistribution`](#data_designerconfigmodelsuniformdistribution)                     | Uniform distribution for sampling inference parameters.                       |
| [`GenerationType`](#data_designerconfigmodelsgenerationtype)                               | str(object='') -> str str(bytes\_or\_buffer\[, encoding\[, errors]]) -> str   |
| [`BaseInferenceParams`](#data_designerconfigmodelsbaseinferenceparams)                     | Base configuration for inference parameters.                                  |
| [`ChatCompletionInferenceParams`](#data_designerconfigmodelschatcompletioninferenceparams) | Configuration for LLM inference parameters.                                   |
| [`EmbeddingInferenceParams`](#data_designerconfigmodelsembeddinginferenceparams)           | Configuration for embedding generation parameters.                            |
| [`ImageInferenceParams`](#data_designerconfigmodelsimageinferenceparams)                   | Configuration for image generation models.                                    |
| [`ModelConfig`](#data_designerconfigmodelsmodelconfig)                                     | Configuration for a model used for generation.                                |
| [`ModelProvider`](#data_designerconfigmodelsmodelprovider)                                 | Configuration for a custom model provider.                                    |

### Functions

| Name                                                                 | Description |
| -------------------------------------------------------------------- | ----------- |
| [`load_model_configs`](#data_designerconfigmodelsload_model_configs) | None        |

### Data

[`logger`](#data_designerconfigmodelslogger)
[`DistributionParamsT`](#data_designerconfigmodelsdistributionparamst)
[`DistributionT`](#data_designerconfigmodelsdistributiont)
[`InferenceParamsT`](#data_designerconfigmodelsinferenceparamst)

### API

```python
logger = getLogger(...)
```

```python
class data_designer.config.models.Modality
```

**Bases**: `str`, `enum.Enum`

Supported modality types for multimodal model data.

**Initialization:**

Initialize self.  See help(type(self)) for accurate signature.

```python
IMAGE = image
```

```python
class data_designer.config.models.ModalityDataType
```

**Bases**: `str`, `enum.Enum`

Data type formats for multimodal data.

**Initialization:**

Initialize self.  See help(type(self)) for accurate signature.

```python
URL = url
```

```python
BASE64 = base64
```

```python
class data_designer.config.models.DistributionType
```

**Bases**: `str`, `enum.Enum`

Types of distributions for sampling inference parameters.

**Initialization:**

Initialize self.  See help(type(self)) for accurate signature.

```python
UNIFORM = uniform
```

```python
MANUAL = manual
```

```python
class data_designer.config.models.ModalityContext(
    /,
    **data: typing.Any
)
```

**Bases**: `abc.ABC`, `pydantic.BaseModel`

```python
modality: data_designer.config.models.Modality
```

```python
column_name: str
```

```python
data_type: data_designer.config.models.ModalityDataType | None
```

```python
get_contexts(
    record: dict,
    *,
    base_path: str | None = None
) -> list[dict[str, typing.Any]]
```

```python
class data_designer.config.models.ImageContext(
    /,
    **data: typing.Any
)
```

**Bases**: `data_designer.config.models.ModalityContext`

Configuration for providing image context to multimodal models.

**Parameters:**

The modality type (always "image").

Name of the column containing image data.

Format of the image data ("url", "base64", or None for auto-detection).
When None, the format is auto-detected: URLs are passed through, file paths that
exist under base\_path are loaded as base64, and other values are assumed to be base64.

Image format (required when data\_type is explicitly "base64").

**Attributes:**

The modality type (always "image").

Name of the column containing image data.

Format of the image data ("url", "base64", or None for auto-detection).
When None, the format is auto-detected: URLs are passed through, file paths that
exist under base\_path are loaded as base64, and other values are assumed to be base64.

Image format (required when data\_type is explicitly "base64").

**Initialization:**

Create a new model by parsing and validating input data from keyword arguments.

Raises \[`ValidationError`]\[pydantic\_core.ValidationError] if the input data cannot be
validated to form a valid model.

`self` is explicitly positional-only to allow `self` as a field name.

```python
modality: data_designer.config.models.Modality
```

```python
image_format: data_designer.config.utils.image_helpers.ImageFormat | None
```

```python
get_contexts(
    record: dict,
    *,
    base_path: str | None = None
) -> list[dict[str, typing.Any]]
```

Get the contexts for the image modality.

**Parameters:**

The record containing the image data. The data can be:

* A JSON serialized list of strings
* A list of strings
* A single string

Optional base path for resolving relative file paths.
When provided, file paths that exist under this directory are loaded
and converted to base64. This enables generated images (stored as relative
paths in create mode) to be sent to remote model endpoints.

**Returns:**

`list[dict[str, typing.Any]]`

A list of image contexts.

```python
_auto_resolve_context_value(
    context_value: str,
    base_path: str | None
) -> dict[str, str]
```

Auto-detect the format of a context value and resolve it.

Resolution rules:

* File path that exists under base\_path → load to base64 (generated artifact)
* URL (http/https) → pass through as-is
* Otherwise → assume base64 data

```python
_format_base64_context(base64_data: str) -> dict[str, str]
```

Format base64 image data as an image\_url context dict.

Uses self.image\_format if set, otherwise detects from the image bytes.

```python
_validate_image_format() -> typing_extensions.Self
```

```python
DistributionParamsT = TypeVar(...)
```

```python
class data_designer.config.models.Distribution(
    /,
    **data: typing.Any
)
```

**Bases**: `abc.ABC`, `data_designer.config.base.ConfigBase`, `typing.Generic[data_designer.config.models.DistributionParamsT]`

```python
distribution_type: data_designer.config.models.DistributionType
```

```python
params: data_designer.config.models.DistributionParamsT
```

```python
sample() -> float
```

```python
class data_designer.config.models.ManualDistributionParams(
    /,
    **data: typing.Any
)
```

**Bases**: `data_designer.config.base.ConfigBase`

Parameters for manual distribution sampling.

**Parameters:**

List of possible values to sample from.

Optional list of weights for each value. If not provided, all values have equal probability.

**Attributes:**

List of possible values to sample from.

Optional list of weights for each value. If not provided, all values have equal probability.

**Initialization:**

Create a new model by parsing and validating input data from keyword arguments.

Raises \[`ValidationError`]\[pydantic\_core.ValidationError] if the input data cannot be
validated to form a valid model.

`self` is explicitly positional-only to allow `self` as a field name.

```python
values: list[float] = Field(...)
```

```python
weights: list[float] | None
```

```python
_normalize_weights() -> typing_extensions.Self
```

```python
_validate_equal_lengths() -> typing_extensions.Self
```

```python
class data_designer.config.models.ManualDistribution
```

**Bases**: `data_designer.config.models.Distribution[data_designer.config.models.ManualDistributionParams]`

Manual (discrete) distribution for sampling inference parameters.

Samples from a discrete set of values with optional weights. Useful for testing
specific values or creating custom probability distributions for temperature or top\_p.

**Attributes:**

Type of distribution ("manual").

Distribution parameters (values, weights).

```python
distribution_type: data_designer.config.models.DistributionType | None = manual
```

```python
params: data_designer.config.models.ManualDistributionParams
```

```python
sample() -> float
```

Sample a value from the manual distribution.

**Returns:**

`float`

A float value sampled from the manual distribution.

```python
class data_designer.config.models.UniformDistributionParams(
    /,
    **data: typing.Any
)
```

**Bases**: `data_designer.config.base.ConfigBase`

Parameters for uniform distribution sampling.

**Parameters:**

Lower bound (inclusive).

Upper bound (exclusive).

**Attributes:**

Lower bound (inclusive).

Upper bound (exclusive).

**Initialization:**

Create a new model by parsing and validating input data from keyword arguments.

Raises \[`ValidationError`]\[pydantic\_core.ValidationError] if the input data cannot be
validated to form a valid model.

`self` is explicitly positional-only to allow `self` as a field name.

```python
low: float
```

```python
high: float
```

```python
_validate_low_lt_high() -> typing_extensions.Self
```

```python
class data_designer.config.models.UniformDistribution
```

**Bases**: `data_designer.config.models.Distribution[data_designer.config.models.UniformDistributionParams]`

Uniform distribution for sampling inference parameters.

Samples values uniformly between low and high bounds. Useful for exploring
a continuous range of values for temperature or top\_p.

**Attributes:**

Type of distribution ("uniform").

Distribution parameters (low, high).

```python
distribution_type: data_designer.config.models.DistributionType | None = uniform
```

```python
params: data_designer.config.models.UniformDistributionParams
```

```python
sample() -> float
```

Sample a value from the uniform distribution.

**Returns:**

`float`

A float value sampled from the uniform distribution.

```python
class data_designer.config.models.GenerationType
```

**Bases**: `str`, `enum.Enum`

```python
CHAT_COMPLETION = chat-completion
```

```python
EMBEDDING = embedding
```

```python
IMAGE = image
```

```python
class data_designer.config.models.BaseInferenceParams(
    /,
    **data: typing.Any
)
```

**Bases**: `data_designer.config.base.ConfigBase`, `abc.ABC`

Base configuration for inference parameters.

**Parameters:**

Type of generation (chat-completion, embedding, or image). Acts as discriminator.

Maximum number of parallel requests to the model API.

Timeout in seconds for each request.

Additional parameters to pass to the model API.

**Attributes:**

Type of generation (chat-completion, embedding, or image). Acts as discriminator.

Maximum number of parallel requests to the model API.

Timeout in seconds for each request.

Additional parameters to pass to the model API.

**Initialization:**

Create a new model by parsing and validating input data from keyword arguments.

Raises \[`ValidationError`]\[pydantic\_core.ValidationError] if the input data cannot be
validated to form a valid model.

`self` is explicitly positional-only to allow `self` as a field name.

```python
generation_type: data_designer.config.models.GenerationType
```

```python
max_parallel_requests: int = Field(...)
```

```python
timeout: int | None = Field(...)
```

```python
extra_body: dict[str, typing.Any] | None
```

```python
generate_kwargs: dict[str, typing.Any]
```

Get the generate kwargs for the inference parameters.

**Returns:**

`Any`

A dictionary of the generate kwargs.

```python
format_for_display() -> str
```

Format inference parameters for display as a single line.

**Returns:**

`str`

Formatted string of inference parameters

```python
get_formatted_params() -> list[str]
```

Get a list of formatted parameter strings.

**Returns:**

`list[str]`

List of formatted parameter strings (e.g., \["temperature=0.70", "max\_tokens=100"])

```python
_format_value(
    key: str,
    value: typing.Any
) -> str
```

Format a single parameter value. Override in subclasses for custom formatting.

**Parameters:**

Parameter name

Parameter value

**Returns:**

`str`

Formatted string representation of the value

```python
class data_designer.config.models.ChatCompletionInferenceParams(
    /,
    **data: typing.Any
)
```

**Bases**: `data_designer.config.models.BaseInferenceParams`

Configuration for LLM inference parameters.

**Parameters:**

Type of generation, always "chat-completion" for this class.

Sampling temperature (0.0-2.0). Can be a fixed value or a distribution for dynamic sampling.

Nucleus sampling probability (0.0-1.0). Can be a fixed value or a distribution for dynamic sampling.

Maximum number of tokens to generate in the response.

**Attributes:**

Type of generation, always "chat-completion" for this class.

Sampling temperature (0.0-2.0). Can be a fixed value or a distribution for dynamic sampling.

Nucleus sampling probability (0.0-1.0). Can be a fixed value or a distribution for dynamic sampling.

Maximum number of tokens to generate in the response.

**Initialization:**

Create a new model by parsing and validating input data from keyword arguments.

Raises \[`ValidationError`]\[pydantic\_core.ValidationError] if the input data cannot be
validated to form a valid model.

`self` is explicitly positional-only to allow `self` as a field name.

```python
generation_type: typing.Literal[data_designer.config.models.GenerationType]
```

```python
temperature: float | data_designer.config.models.DistributionT | None
```

```python
top_p: float | data_designer.config.models.DistributionT | None
```

```python
max_tokens: int | None = Field(...)
```

```python
generate_kwargs: dict[str, typing.Any]
```

```python
_validate_temperature() -> typing_extensions.Self
```

```python
_validate_top_p() -> typing_extensions.Self
```

```python
_run_validation(
    value: float | data_designer.config.models.DistributionT | None,
    param_name: str,
    min_value: float,
    max_value: float
) -> typing_extensions.Self
```

```python
_is_value_in_range(
    value: float,
    min_value: float,
    max_value: float
) -> bool
```

```python
_format_value(
    key: str,
    value: typing.Any
) -> str
```

Format chat completion parameter values, including distributions.

**Parameters:**

Parameter name

Parameter value

**Returns:**

`str`

Formatted string representation of the value

```python
class data_designer.config.models.EmbeddingInferenceParams(
    /,
    **data: typing.Any
)
```

**Bases**: `data_designer.config.models.BaseInferenceParams`

Configuration for embedding generation parameters.

**Parameters:**

Type of generation, always "embedding" for this class.

Format of the embedding encoding ("float" or "base64").

Number of dimensions for the embedding.

**Attributes:**

Type of generation, always "embedding" for this class.

Format of the embedding encoding ("float" or "base64").

Number of dimensions for the embedding.

**Initialization:**

Create a new model by parsing and validating input data from keyword arguments.

Raises \[`ValidationError`]\[pydantic\_core.ValidationError] if the input data cannot be
validated to form a valid model.

`self` is explicitly positional-only to allow `self` as a field name.

```python
generation_type: typing.Literal[data_designer.config.models.GenerationType]
```

```python
encoding_format: typing.Literal[float, base64] = float
```

```python
dimensions: int | None
```

```python
generate_kwargs: dict[str, float | int]
```

```python
class data_designer.config.models.ImageInferenceParams(
    /,
    **data: typing.Any
)
```

**Bases**: `data_designer.config.models.BaseInferenceParams`

Configuration for image generation models.

Works for both diffusion and autoregressive image generation models. Pass all model-specific image options via `extra_body`.

**Parameters:**

Type of generation, always "image" for this class.

**Attributes:**

Type of generation, always "image" for this class.

**Example:**

```python
# OpenAI-style (DALL·E): quality and size in extra_body or as top-level kwargs
dd.ImageInferenceParams(
    extra_body={"size": "1024x1024", "quality": "hd"}
)

# Gemini-style: generationConfig.imageConfig
dd.ImageInferenceParams(
    extra_body={
        "generationConfig": {
            "imageConfig": {
                "aspectRatio": "1:1",
                "imageSize": "1024"
            }
        }
    }
)
```

**Initialization:**

Create a new model by parsing and validating input data from keyword arguments.

Raises \[`ValidationError`]\[pydantic\_core.ValidationError] if the input data cannot be
validated to form a valid model.

`self` is explicitly positional-only to allow `self` as a field name.

```python
generation_type: typing.Literal[data_designer.config.models.GenerationType]
```

```python
class data_designer.config.models.ModelConfig(
    /,
    **data: typing.Any
)
```

**Bases**: `data_designer.config.base.ConfigBase`

Configuration for a model used for generation.

**Parameters:**

User-defined alias to reference in column configurations.

Model identifier (e.g., from build.nvidia.com or other providers).

Inference parameters for the model (temperature, top\_p, max\_tokens, etc.).
The generation\_type is determined by the type of inference\_parameters.

Name of the model provider. Required in a future release. Leaving
`provider` unset (or `None`) currently routes through the registry's
implicit default and is **deprecated**; specify `provider=` explicitly.
See issue #589.

Whether to skip the health check for this model. Defaults to False.

**Attributes:**

User-defined alias to reference in column configurations.

Model identifier (e.g., from build.nvidia.com or other providers).

Inference parameters for the model (temperature, top\_p, max\_tokens, etc.).
The generation\_type is determined by the type of inference\_parameters.

Name of the model provider. Required in a future release. Leaving
`provider` unset (or `None`) currently routes through the registry's
implicit default and is **deprecated**; specify `provider=` explicitly.
See issue #589.

Whether to skip the health check for this model. Defaults to False.

**Initialization:**

Create a new model by parsing and validating input data from keyword arguments.

Raises \[`ValidationError`]\[pydantic\_core.ValidationError] if the input data cannot be
validated to form a valid model.

`self` is explicitly positional-only to allow `self` as a field name.

```python
alias: str
```

```python
model: str
```

```python
inference_parameters: data_designer.config.models.InferenceParamsT = Field(...)
```

```python
provider: str | None
```

```python
skip_health_check: bool = False
```

```python
generation_type: data_designer.config.models.GenerationType
```

Get the generation type from the inference parameters.

```python
_convert_inference_parameters(value: typing.Any) -> typing.Any
```

Convert raw dict to appropriate inference parameters type based on field presence.

```python
_warn_on_implicit_provider() -> typing_extensions.Self
```

```python
class data_designer.config.models.ModelProvider(
    /,
    **data: typing.Any
)
```

**Bases**: `data_designer.config.base.ConfigBase`

Configuration for a custom model provider.

**Parameters:**

Name of the model provider.

API endpoint URL for the provider.

Provider type (default: "openai"). Determines the API format to use.

Optional API key for authentication.

Additional parameters to pass in API requests.

Additional headers to pass in API requests.

**Attributes:**

Name of the model provider.

API endpoint URL for the provider.

Provider type (default: "openai"). Determines the API format to use.

Optional API key for authentication.

Additional parameters to pass in API requests.

Additional headers to pass in API requests.

**Initialization:**

Create a new model by parsing and validating input data from keyword arguments.

Raises \[`ValidationError`]\[pydantic\_core.ValidationError] if the input data cannot be
validated to form a valid model.

`self` is explicitly positional-only to allow `self` as a field name.

```python
name: str
```

```python
endpoint: str
```

```python
provider_type: str = openai
```

```python
api_key: str | None
```

```python
extra_body: dict[str, typing.Any] | None
```

```python
extra_headers: dict[str, str] | None
```

```python
normalize_provider_type(v: str) -> str
```

```python
data_designer.config.models.load_model_configs(model_configs: list[data_designer.config.models.ModelConfig] | str | pathlib.Path) -> list[data_designer.config.models.ModelConfig]
```