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
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This file provides guidance to agents when working with code in this repository.
**DataDesigner** is an NVIDIA NeMo project for creating synthetic datasets from scratch. It's a comprehensive framework that generates structured data using multiple generation strategies:

- **Sampled data**: Built-in generators (UUID, DateTime, etc.) and Faker integration
- **LLM-generated content**: Text, code, and structured data via LiteLLM
- **LLM-generated content**: Text, code, and structured data via native HTTP adapters
- **Expression-based columns**: Derived columns using Jinja2 templates
- **Validation & scoring**: Python, SQL, and remote validators; LLM-based judge scoring
- **Seed dataset-based generation**: Generate from existing datasets
Expand All @@ -25,7 +25,7 @@ The project follows a layered architecture:
2. **Engine Layer** ([packages/data-designer-engine/src/data_designer/engine/](packages/data-designer-engine/src/data_designer/engine/)): Internal generation and processing
- `column_generators/`: Generates individual columns from configs
- `dataset_builders/`: Orchestrates full dataset generation with DAG-based dependency management
- `models/`: LLM integration via LiteLLM with response parsing
- `models/`: LLM integration via native HTTP adapters with response parsing
- `validators/`: Column validation (Python, SQL, Code, Remote)
- `sampling_gen/`: Sophisticated person/entity sampling

Expand Down
15 changes: 14 additions & 1 deletion docs/concepts/models/model-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,24 @@ The `ModelProvider` class has the following fields:
|-------|------|----------|-------------|
| `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 |
| `provider_type` | `str` | No | Provider type: `"openai"` (default) or `"anthropic"`. See [Supported Provider Types](#supported-provider-types) below |
| `api_key` | `str` | No | API key or environment variable name (e.g., `"NVIDIA_API_KEY"`) |
| `extra_body` | `dict[str, Any]` | No | Additional parameters to include in the request body of all API requests to the provider. |
| `extra_headers` | `dict[str, str]` | No | Additional headers to include in all API requests to the provider. |

## Supported Provider Types

Data Designer supports two provider types:

| Type | Description |
|------|-------------|
| `"openai"` | OpenAI-compatible chat completion API. This is the default and works with most providers, including NVIDIA NIM, vLLM, TGI, OpenRouter, Together AI, and OpenAI itself. |
| `"anthropic"` | Anthropic's native Messages API for Claude models. Use this when connecting directly to Anthropic's API. |

Most self-hosted and third-party endpoints expose an OpenAI-compatible API, so `provider_type="openai"` is the right choice in the majority of cases. Only use `"anthropic"` when connecting directly to Anthropic's API at `https://api.anthropic.com`.

> **Note:** Previous versions of Data Designer supported additional provider types (e.g., `"azure"`, `"bedrock"`, `"vertex_ai"`) via a LiteLLM bridge. These are no longer supported. If you were using one of these types, switch to `provider_type="openai"` and point the `endpoint` to an OpenAI-compatible proxy or gateway for that service.

## API Key Configuration

The `api_key` field can be specified in two ways:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def inject_sampler_type_into_params(cls, data: dict) -> dict:
class LLMTextColumnConfig(SingleColumnConfig):
"""Configuration for text generation columns using Large Language Models.

LLM text columns generate free-form text content using language models via LiteLLM.
LLM text columns generate free-form text content using language models.
Prompts support Jinja2 templating to reference values from other columns, enabling
context-aware generation. The generated text can optionally include message traces
capturing the full conversation history.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"pq": "pyarrow.parquet",
"pa": "pyarrow",
"faker": "faker",
"litellm": "litellm",
"sqlfluff": "sqlfluff",
"httpx": "httpx",
"duckdb": "duckdb",
Expand Down
2 changes: 1 addition & 1 deletion packages/data-designer-engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Generation engine for NeMo Data Designer synthetic data generation framework.

This package contains the execution engine that powers Data Designer. It depends on `data-designer-config` and includes heavy dependencies like pandas, numpy, and LLM integration via litellm.
This package contains the execution engine that powers Data Designer. It depends on `data-designer-config` and includes heavy dependencies like pandas, numpy, and native HTTP-based LLM integration.

## Installation

Expand Down
1 change: 0 additions & 1 deletion packages/data-designer-engine/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ dependencies = [
"json-repair>=0.48.0,<1",
"jsonpath-rust-bindings>=1.0,<2",
"jsonschema>=4.0.0,<5",
"litellm>=1.77.0,<1.80.12",
"lxml>=6.0.2,<7",
"marko>=2.1.2,<3",
"mcp>=1.26.0,<2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
(TaskGroup)

Singleton Event Loop:
The background loop is a process-wide singleton. LiteLLM and similar
libraries bind internal async state to a specific event loop, so creating
per-call or per-instance loops breaks connection reuse and triggers
cross-loop errors. ``ensure_async_engine_loop()`` creates one daemon
loop thread and reuses it for all executor instances.
The background loop is a process-wide singleton. Async-stateful
resources (connection pools, semaphores) bind internal state to a
specific event loop, so creating per-call or per-instance loops breaks
connection reuse and triggers cross-loop errors.
``ensure_async_engine_loop()`` creates one daemon loop thread and
reuses it for all executor instances.

Startup Handshake:
Loop creation uses a ``threading.Event`` readiness handshake. The
Expand Down Expand Up @@ -90,8 +91,8 @@ def ensure_async_engine_loop() -> asyncio.AbstractEventLoop:
"""Get or create a persistent event loop for async engine work.

A single event loop is shared across all AsyncConcurrentExecutor instances
to avoid breaking libraries (like LiteLLM) that bind internal async state
to a specific event loop.
to avoid breaking async-stateful resources (connection pools, semaphores)
that bind internal state to a specific event loop.
"""
global _loop, _thread
with _lock:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from __future__ import annotations

from data_designer.engine.models.clients.adapters.anthropic import AnthropicClient
from data_designer.engine.models.clients.adapters.litellm_bridge import LiteLLMBridgeClient, LiteLLMRouter
from data_designer.engine.models.clients.adapters.openai_compatible import OpenAICompatibleClient

__all__ = ["AnthropicClient", "LiteLLMBridgeClient", "LiteLLMRouter", "OpenAICompatibleClient"]
__all__ = ["AnthropicClient", "OpenAICompatibleClient"]

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ def map_http_error_to_provider_error(


def extract_message_from_exception_string(raw: str) -> str:
"""Extract a human-readable message from a stringified LiteLLM exception.
"""Extract a human-readable message from a stringified provider exception.

LiteLLM often formats errors as ``"Error code: 400 - {json}"``. This
Some providers format errors as ``"Error code: 400 - {json}"``. This
mirrors the structured-key lookup in ``_extract_structured_message`` but
operates on a raw string instead of an ``HttpResponse``.
"""
Expand Down
Loading
Loading