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 docs/concepts/models/custom-model-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ preview_result.display_sample_record()
```

!!! note "Default Providers Always Available"
When you only specify `model_configs`, the default model providers (NVIDIA and OpenAI) are still available. You only need to create custom providers if you want to connect to different endpoints or modify provider settings.
When you only specify `model_configs`, the default model providers (NVIDIA, OpenAI, and OpenRouter) are still available. You only need to create custom providers if you want to connect to different endpoints or modify provider settings.

!!! tip "Mixing Custom and Default Models"
When you provide custom `model_configs` to `DataDesignerConfigBuilder`, they **replace** the defaults entirely. To use custom model configs in addition to the default configs, use the add_model_config method:
Expand Down
47 changes: 35 additions & 12 deletions docs/concepts/models/default-model-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Data Designer ships with pre-configured model providers and model configurations

## Model Providers

Data Designer includes two default model providers that are configured automatically:
Data Designer includes a few default model providers that are configured automatically:

### NVIDIA Provider (`nvidia`)

Expand All @@ -24,6 +24,15 @@ The NVIDIA provider gives you access to state-of-the-art models including Nemotr

The OpenAI provider gives you access to GPT models and other OpenAI offerings.

### OpenRouter Provider (`openrouter`)

- **Endpoint**: `https://openrouter.ai/api/v1`
- **API Key**: Set via `OPENROUTER_API_KEY` environment variable
- **Models**: Access to a wide variety of models through OpenRouter's unified API
- **Getting Started**: Get your API key from [openrouter.ai](https://openrouter.ai)

The OpenRouter provider gives you access to a unified interface for many different language models from various providers.

## Model Configurations

Data Designer provides pre-configured model aliases for common use cases. When you create a `DataDesignerConfigBuilder` without specifying `model_configs`, these default configurations are automatically available.
Expand All @@ -32,22 +41,35 @@ Data Designer provides pre-configured model aliases for common use cases. When y

The following model configurations are automatically available when `NVIDIA_API_KEY` is set:

| Alias | Model | Use Case | Temperature | Top P |
|-------|-------|----------|-------------|-------|
| `nvidia-text` | `nvidia/nemotron-3-nano-30b-a3b` | General text generation | 0.85 | 0.95 |
| `nvidia-reasoning` | `openai/gpt-oss-20b` | Reasoning and analysis tasks | 0.35 | 0.95 |
| `nvidia-vision` | `nvidia/nemotron-nano-12b-v2-vl` | Vision and image understanding | 0.85 | 0.95 |
| Alias | Model | Use Case | Inference Parameters |
|-------|-------|----------|---------------------|
| `nvidia-text` | `nvidia/nemotron-3-nano-30b-a3b` | General text generation | `temperature=1.0, top_p=1.0` |
| `nvidia-reasoning` | `openai/gpt-oss-20b` | Reasoning and analysis tasks | `temperature=0.35, top_p=0.95` |
| `nvidia-vision` | `nvidia/nemotron-nano-12b-v2-vl` | Vision and image understanding | `temperature=0.85, top_p=0.95` |
| `nvidia-embedding` | `nvidia/llama-3.2-nv-embedqa-1b-v2` | Text embeddings | `encoding_format="float", extra_body={"input_type": "query"}` |


### OpenAI Models

The following model configurations are automatically available when `OPENAI_API_KEY` is set:

| Alias | Model | Use Case | Temperature | Top P |
|-------|-------|----------|-------------|-------|
| `openai-text` | `gpt-4.1` | General text generation | 0.85 | 0.95 |
| `openai-reasoning` | `gpt-5` | Reasoning and analysis tasks | 0.35 | 0.95 |
| `openai-vision` | `gpt-5` | Vision and image understanding | 0.85 | 0.95 |
| Alias | Model | Use Case | Inference Parameters |
|-------|-------|----------|---------------------|
| `openai-text` | `gpt-4.1` | General text generation | `temperature=0.85, top_p=0.95` |
| `openai-reasoning` | `gpt-5` | Reasoning and analysis tasks | `temperature=0.35, top_p=0.95` |
| `openai-vision` | `gpt-5` | Vision and image understanding | `temperature=0.85, top_p=0.95` |
| `openai-embedding` | `text-embedding-3-large` | Text embeddings | `encoding_format="float"` |

### OpenRouter Models

The following model configurations are automatically available when `OPENROUTER_API_KEY` is set:

| Alias | Model | Use Case | Inference Parameters |
|-------|-------|----------|---------------------|
| `openrouter-text` | `nvidia/nemotron-3-nano-30b-a3b` | General text generation | `temperature=1.0, top_p=1.0` |
| `openrouter-reasoning` | `openai/gpt-oss-20b` | Reasoning and analysis tasks | `temperature=0.35, top_p=0.95` |
| `openrouter-vision` | `nvidia/nemotron-nano-12b-v2-vl` | Vision and image understanding | `temperature=0.85, top_p=0.95` |
| `openrouter-embedding` | `openai/text-embedding-3-large` | Text embeddings | `encoding_format="float"` |


## Using Default Settings
Expand Down Expand Up @@ -83,7 +105,7 @@ Both methods operate on the same files, ensuring consistency across your entire
## Important Notes

!!! warning "API Key Requirements"
While default model configurations are always available, you need to set the appropriate API key environment variable (`NVIDIA_API_KEY` or `OPENAI_API_KEY`) to actually use the corresponding models for data generation. Without a valid API key, any attempt to generate data using that provider's models will fail.
While default model configurations are always available, you need to set the appropriate API key environment variable (`NVIDIA_API_KEY`, `OPENAI_API_KEY`, or `OPENROUTER_API_KEY`) to actually use the corresponding models for data generation. Without a valid API key, any attempt to generate data using that provider's models will fail.

!!! tip "Environment Variables"
Store your API keys in environment variables rather than hardcoding them in your scripts:
Expand All @@ -92,6 +114,7 @@ Both methods operate on the same files, ensuring consistency across your entire
# In your .bashrc, .zshrc, or similar
export NVIDIA_API_KEY="your-api-key-here"
export OPENAI_API_KEY="your-openai-api-key-here"
export OPENROUTER_API_KEY="your-openrouter-api-key-here"
```

## See Also
Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/models/model-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The `ModelConfig` class has the following fields:
| `alias` | `str` | Yes | Unique identifier for this model configuration (e.g., `"my-text-model"`, `"reasoning-model"`) |
| `model` | `str` | Yes | Model identifier as recognized by the provider (e.g., `"nvidia/nemotron-3-nano-30b-a3b"`, `"gpt-4"`) |
| `inference_parameters` | `InferenceParamsT` | No | Controls model behavior during generation. Use `ChatCompletionInferenceParams` for text/code/structured generation or `EmbeddingInferenceParams` for embeddings. Defaults to `ChatCompletionInferenceParams()` if not provided. The generation type is automatically determined by the inference parameters type. See [Inference Parameters](inference_parameters.md) for details. |
| `provider` | `str` | No | Reference to the name of the Provider to use (e.g., `"nvidia"`, `"openai"`). If not specified, one set as the default provider, which may resolve to the first provider if there are more than one |
| `provider` | `str` | No | Reference to the name of the Provider to use (e.g., `"nvidia"`, `"openai"`, `"openrouter"`). If not specified, one set as the default provider, which may resolve to the first provider if there are more than one |


## Examples
Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/models/model-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The `ModelProvider` class has the following fields:

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `name` | `str` | Yes | Unique identifier for the provider (e.g., `"nvidia"`, `"openai"`) |
| `name` | `str` | Yes | Unique identifier for the provider (e.g., `"nvidia"`, `"openai"`, `"openrouter"`) |
| `endpoint` | `str` | Yes | API endpoint URL (e.g., `"https://integrate.api.nvidia.com/v1"`) |
| `provider_type` | `str` | No | Provider type (default: `"openai"`). Uses OpenAI-compatible API format |
| `api_key` | `str` | No | API key or environment variable name (e.g., `"NVIDIA_API_KEY"`) |
Expand Down
3 changes: 3 additions & 0 deletions docs/notebook_source/_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ export NVIDIA_API_KEY="your-api-key-here"

# For OpenAI
export OPENAI_API_KEY="your-api-key-here"

# For OpenRouter
export OPENROUTER_API_KEY="your-api-key-here"
```

For more information, check the [Quick Start](../quick-start.md), [Default Model Settings](../concepts/models/default-model-settings.md) and how to [Configure Model Settings Using The CLI](../concepts/models/configure-model-settings-with-the-cli.md).
Expand Down
3 changes: 3 additions & 0 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ Before you begin, you'll need an API key from one of the default providers:

- **NVIDIA API Key**: Get yours from [build.nvidia.com](https://build.nvidia.com)
- **OpenAI API Key** (optional): Get yours from [platform.openai.com](https://platform.openai.com/api-keys)
- **OpenRouter API Key** (optional): Get yours from [openrouter.ai](https://openrouter.ai)

Set your API key as an environment variable:

```bash
export NVIDIA_API_KEY="your-api-key-here"
# Or for OpenAI
export OPENAI_API_KEY="your-openai-api-key-here"
# Or for OpenRouter
export OPENROUTER_API_KEY="your-openrouter-api-key-here"
```

## Example
Expand Down
29 changes: 27 additions & 2 deletions src/data_designer/config/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ class NordColor(Enum):

OPENAI_API_KEY_ENV_VAR_NAME = "OPENAI_API_KEY"

OPENROUTER_PROVIDER_NAME = "openrouter"

OPENROUTER_API_KEY_ENV_VAR_NAME = "OPENROUTER_API_KEY"

PREDEFINED_PROVIDERS = [
{
"name": NVIDIA_PROVIDER_NAME,
Expand All @@ -295,18 +299,27 @@ class NordColor(Enum):
"provider_type": "openai",
"api_key": OPENAI_API_KEY_ENV_VAR_NAME,
},
{
"name": OPENROUTER_PROVIDER_NAME,
"endpoint": "https://openrouter.ai/api/v1",
"provider_type": "openai",
"api_key": OPENROUTER_API_KEY_ENV_VAR_NAME,
},
]


DEFAULT_TEXT_INFERENCE_PARAMS = {"temperature": 0.85, "top_p": 0.95}
DEFAULT_REASONING_INFERENCE_PARAMS = {"temperature": 0.35, "top_p": 0.95}
DEFAULT_VISION_INFERENCE_PARAMS = {"temperature": 0.85, "top_p": 0.95}
DEFAULT_EMBEDDING_INFERENCE_PARAMS = {"encoding_format": "float"}

NEMOTRON_3_NANO_30B_A3B_INFERENCE_PARAMS = {"temperature": 1.0, "top_p": 1.0}

PREDEFINED_PROVIDERS_MODEL_MAP = {
NVIDIA_PROVIDER_NAME: {
"text": {"model": "nvidia/nemotron-3-nano-30b-a3b", "inference_parameters": {"temperature": 1.0, "top_p": 1.0}},
"text": {
"model": "nvidia/nemotron-3-nano-30b-a3b",
"inference_parameters": NEMOTRON_3_NANO_30B_A3B_INFERENCE_PARAMS,
},
"reasoning": {"model": "openai/gpt-oss-20b", "inference_parameters": DEFAULT_REASONING_INFERENCE_PARAMS},
"vision": {"model": "nvidia/nemotron-nano-12b-v2-vl", "inference_parameters": DEFAULT_VISION_INFERENCE_PARAMS},
"embedding": {
Expand All @@ -320,6 +333,18 @@ class NordColor(Enum):
"vision": {"model": "gpt-5", "inference_parameters": DEFAULT_VISION_INFERENCE_PARAMS},
"embedding": {"model": "text-embedding-3-large", "inference_parameters": DEFAULT_EMBEDDING_INFERENCE_PARAMS},
},
OPENROUTER_PROVIDER_NAME: {
"text": {
"model": "nvidia/nemotron-3-nano-30b-a3b",
"inference_parameters": NEMOTRON_3_NANO_30B_A3B_INFERENCE_PARAMS,
},
"reasoning": {"model": "openai/gpt-oss-20b", "inference_parameters": DEFAULT_REASONING_INFERENCE_PARAMS},
"vision": {"model": "nvidia/nemotron-nano-12b-v2-vl", "inference_parameters": DEFAULT_VISION_INFERENCE_PARAMS},
"embedding": {
"model": "openai/text-embedding-3-large",
"inference_parameters": DEFAULT_EMBEDDING_INFERENCE_PARAMS,
},
},
}

# Persona locale metadata - used by the CLI and the person sampler.
Expand Down
22 changes: 19 additions & 3 deletions tests/config/test_default_model_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_get_default_inference_parameters():

def test_get_builtin_model_configs():
builtin_model_configs = get_builtin_model_configs()
assert len(builtin_model_configs) == 8
assert len(builtin_model_configs) == 12
assert builtin_model_configs[0].alias == "nvidia-text"
assert builtin_model_configs[0].model == "nvidia/nemotron-3-nano-30b-a3b"
assert builtin_model_configs[0].provider == "nvidia"
Expand All @@ -79,11 +79,23 @@ def test_get_builtin_model_configs():
assert builtin_model_configs[7].alias == "openai-embedding"
assert builtin_model_configs[7].model == "text-embedding-3-large"
assert builtin_model_configs[7].provider == "openai"
assert builtin_model_configs[8].alias == "openrouter-text"
assert builtin_model_configs[8].model == "nvidia/nemotron-3-nano-30b-a3b"
assert builtin_model_configs[8].provider == "openrouter"
assert builtin_model_configs[9].alias == "openrouter-reasoning"
assert builtin_model_configs[9].model == "openai/gpt-oss-20b"
assert builtin_model_configs[9].provider == "openrouter"
assert builtin_model_configs[10].alias == "openrouter-vision"
assert builtin_model_configs[10].model == "nvidia/nemotron-nano-12b-v2-vl"
assert builtin_model_configs[10].provider == "openrouter"
assert builtin_model_configs[11].alias == "openrouter-embedding"
assert builtin_model_configs[11].model == "openai/text-embedding-3-large"
assert builtin_model_configs[11].provider == "openrouter"


def test_get_builtin_model_providers():
builtin_model_providers = get_builtin_model_providers()
assert len(builtin_model_providers) == 2
assert len(builtin_model_providers) == 3
assert builtin_model_providers[0].name == "nvidia"
assert builtin_model_providers[0].endpoint == "https://integrate.api.nvidia.com/v1"
assert builtin_model_providers[0].provider_type == "openai"
Expand All @@ -92,6 +104,10 @@ def test_get_builtin_model_providers():
assert builtin_model_providers[1].endpoint == "https://api.openai.com/v1"
assert builtin_model_providers[1].provider_type == "openai"
assert builtin_model_providers[1].api_key == "OPENAI_API_KEY"
assert builtin_model_providers[2].name == "openrouter"
assert builtin_model_providers[2].endpoint == "https://openrouter.ai/api/v1"
assert builtin_model_providers[2].provider_type == "openai"
assert builtin_model_providers[2].api_key == "OPENROUTER_API_KEY"


def test_get_default_model_configs_path_exists(tmp_path: Path):
Expand Down Expand Up @@ -177,4 +193,4 @@ def test_resolve_seed_default_model_settings(tmp_path: Path):
@patch("data_designer.config.default_model_settings.os.environ.get")
def test_get_default_model_providers_missing_api_keys(mock_environ_get):
mock_environ_get.return_value = None
assert get_default_model_providers_missing_api_keys() == ["NVIDIA_API_KEY", "OPENAI_API_KEY"]
assert get_default_model_providers_missing_api_keys() == ["NVIDIA_API_KEY", "OPENAI_API_KEY", "OPENROUTER_API_KEY"]