Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ ModelConfig(
alias="nv-reasoning",
model="openai/gpt-oss-20b",
provider="nvidia",
inference_parameters=InferenceParameters(
inference_parameters=ChatCompletionInferenceParams(
temperature=0.3,
top_p=0.9,
max_tokens=4096,
Expand Down
2 changes: 1 addition & 1 deletion docs/code_reference/models.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Models

The `models` module defines configuration objects for model-based generation. [ModelProvider](#data_designer.config.models.ModelProvider), specifies connection and authentication details for custom providers. [ModelConfig](#data_designer.config.models.ModelConfig) encapsulates model details including the model alias, identifier, and inference parameters. [InferenceParameters](#data_designer.config.models.InferenceParameters) controls model behavior through settings like `temperature`, `top_p`, and `max_tokens`, with support for both fixed values and distribution-based sampling. The module includes [ImageContext](#data_designer.config.models.ImageContext) for providing image inputs to multimodal models.
The `models` module defines configuration objects for model-based generation. [ModelProvider](#data_designer.config.models.ModelProvider), specifies connection and authentication details for custom providers. [ModelConfig](#data_designer.config.models.ModelConfig) encapsulates model details including the model alias, identifier, and inference parameters. [Inference Parameters](../concepts/models/inference-parameters.md) controls model behavior through settings like `temperature`, `top_p`, and `max_tokens`, with support for both fixed values and distribution-based sampling. The module includes [ImageContext](#data_designer.config.models.ImageContext) for providing image inputs to multimodal models.

For more information on how they are used, see below:

Expand Down
3 changes: 0 additions & 3 deletions docs/concepts/models/inference-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ When you create a `ModelConfig`, you can specify inference parameters to adjust

The `ChatCompletionInferenceParams` class controls how models generate text completions (for text, code, and structured data generation). It provides fine-grained control over generation behavior and supports both static values and dynamic distribution-based sampling.

!!! warning "InferenceParameters is Deprecated"
The `InferenceParameters` class is deprecated and will be removed in a future version. Use `ChatCompletionInferenceParams` instead. The old `InferenceParameters` class now shows a deprecation warning when used.

### Fields

| Field | Type | Required | Description |
Expand Down
2 changes: 0 additions & 2 deletions src/data_designer/config/exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
GenerationType,
ImageContext,
ImageFormat,
InferenceParameters,
ManualDistribution,
ManualDistributionParams,
Modality,
Expand Down Expand Up @@ -103,7 +102,6 @@ def get_config_exports() -> list[str]:
InfoType.__name__,
ImageContext.__name__,
ImageFormat.__name__,
InferenceParameters.__name__,
JudgeScoreProfilerConfig.__name__,
LLMCodeColumnConfig.__name__,
LLMJudgeColumnConfig.__name__,
Expand Down
21 changes: 4 additions & 17 deletions src/data_designer/config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from abc import ABC, abstractmethod
from enum import Enum
from pathlib import Path
from typing import Any, Generic, Literal, TypeVar
from typing import Annotated, Any, Generic, Literal, TypeVar

import numpy as np
from pydantic import BaseModel, Field, field_validator, model_validator
Expand Down Expand Up @@ -357,21 +357,6 @@ def _format_value(self, key: str, value: Any) -> str:
return super()._format_value(key, value)


# Maintain backwards compatibility with a deprecation warning
class InferenceParameters(ChatCompletionInferenceParams):
"""
Deprecated: Use ChatCompletionInferenceParams instead.
This alias will be removed in a future version.
"""

def __init__(self, *args: Any, **kwargs: Any) -> None:
logger.warning(
"InferenceParameters is deprecated and will be removed in a future version. "
"Use ChatCompletionInferenceParams instead."
)
super().__init__(*args, **kwargs)


class EmbeddingInferenceParams(BaseInferenceParams):
"""Configuration for embedding generation parameters.
Expand All @@ -395,7 +380,9 @@ def generate_kwargs(self) -> dict[str, float | int]:
return result


InferenceParamsT: TypeAlias = ChatCompletionInferenceParams | EmbeddingInferenceParams | InferenceParameters
InferenceParamsT: TypeAlias = Annotated[
ChatCompletionInferenceParams | EmbeddingInferenceParams, Field(discriminator="generation_type")
]


class ModelConfig(ConfigBase):
Expand Down
3 changes: 0 additions & 3 deletions tests/essentials/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
GenerationType,
ImageContext,
ImageFormat,
InferenceParameters,
JudgeScoreProfilerConfig,
LLMCodeColumnConfig,
LLMJudgeColumnConfig,
Expand Down Expand Up @@ -111,7 +110,6 @@ def test_model_config_imports():
"""Test model configuration imports"""
assert ImageContext is not None
assert ImageFormat is not None
assert InferenceParameters is not None
assert ChatCompletionInferenceParams is not None
assert EmbeddingInferenceParams is not None
assert GenerationType is not None
Expand Down Expand Up @@ -271,7 +269,6 @@ def test_all_contains_model_configs():
"""Test __all__ contains model configuration classes"""
assert "ImageContext" in __all__
assert "ImageFormat" in __all__
assert "InferenceParameters" in __all__
assert "ChatCompletionInferenceParams" in __all__
assert "EmbeddingInferenceParams" in __all__
assert "GenerationType" in __all__
Expand Down