data-designer 0.3.5__py3-none-any.whl → 0.3.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data_designer/_version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.3.5'
32
- __version_tuple__ = version_tuple = (0, 3, 5)
31
+ __version__ = version = '0.3.7'
32
+ __version_tuple__ = version_tuple = (0, 3, 7)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -1,30 +1,42 @@
1
1
  # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
+
5
+ """
6
+ LiteLLM overrides and customizations.
7
+
8
+ Note on imports: This module uses direct (eager) imports for litellm rather than lazy loading.
9
+ This is intentional because:
10
+
11
+ 1. Class inheritance requires base classes to be resolved at class definition time,
12
+ making lazy imports incompatible with our ThreadSafeCache and CustomRouter classes.
13
+
14
+ 2. This module is already lazily loaded at the application level - it's only imported
15
+ by facade.py, which itself is imported inside the create_model_registry() factory
16
+ function. So litellm is only loaded when models are actually needed.
17
+
18
+ 3. Attempting to use lazy imports here causes intermittent ImportErrors.
19
+ """
20
+
4
21
  from __future__ import annotations
5
22
 
6
23
  import random
7
24
  import threading
8
- from typing import TYPE_CHECKING
9
25
 
26
+ import httpx
27
+ import litellm
28
+ from litellm import RetryPolicy
29
+ from litellm.caching.in_memory_cache import InMemoryCache
30
+ from litellm.litellm_core_utils.logging_callback_manager import LoggingCallbackManager
31
+ from litellm.router import Router
10
32
  from pydantic import BaseModel, Field
11
33
  from typing_extensions import override
12
34
 
13
- from data_designer.lazy_heavy_imports import httpx, litellm
14
35
  from data_designer.logging import quiet_noisy_logger
15
36
 
16
- if TYPE_CHECKING:
17
- import httpx
18
- import litellm
19
-
20
37
  DEFAULT_MAX_CALLBACKS = 1000
21
38
 
22
39
 
23
- def _get_logging_callback_manager():
24
- """Lazy accessor for LoggingCallbackManager to avoid loading litellm at import time."""
25
- return litellm.litellm_core_utils.logging_callback_manager.LoggingCallbackManager
26
-
27
-
28
40
  class LiteLLMRouterDefaultKwargs(BaseModel):
29
41
  ## Number of seconds to wait initially after a connection
30
42
  ## failure.
@@ -40,15 +52,15 @@ class LiteLLMRouterDefaultKwargs(BaseModel):
40
52
 
41
53
  ## Sets the default retry policy, including the number
42
54
  ## of retries to use in particular scenarios.
43
- retry_policy: litellm.RetryPolicy = Field(
44
- default_factory=lambda: litellm.RetryPolicy(
55
+ retry_policy: RetryPolicy = Field(
56
+ default_factory=lambda: RetryPolicy(
45
57
  RateLimitErrorRetries=3,
46
58
  TimeoutErrorRetries=3,
47
59
  )
48
60
  )
49
61
 
50
62
 
51
- class ThreadSafeCache(litellm.caching.in_memory_cache.InMemoryCache):
63
+ class ThreadSafeCache(InMemoryCache):
52
64
  def __init__(self, *args, **kwargs):
53
65
  super().__init__(*args, **kwargs)
54
66
 
@@ -83,7 +95,7 @@ class ThreadSafeCache(litellm.caching.in_memory_cache.InMemoryCache):
83
95
  super().flush_cache()
84
96
 
85
97
 
86
- class CustomRouter(litellm.router.Router):
98
+ class CustomRouter(Router):
87
99
  def __init__(
88
100
  self,
89
101
  *args,
@@ -160,7 +172,7 @@ def apply_litellm_patches():
160
172
  litellm.in_memory_llm_clients_cache = ThreadSafeCache()
161
173
 
162
174
  # Workaround for the litellm issue described in https://github.com/BerriAI/litellm/issues/9792
163
- _get_logging_callback_manager().MAX_CALLBACKS = DEFAULT_MAX_CALLBACKS
175
+ LoggingCallbackManager.MAX_CALLBACKS = DEFAULT_MAX_CALLBACKS
164
176
 
165
177
  quiet_noisy_logger("httpx")
166
178
  quiet_noisy_logger("LiteLLM")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: data-designer
3
- Version: 0.3.5
3
+ Version: 0.3.7
4
4
  Summary: General framework for synthetic data generation
5
5
  License-Expression: Apache-2.0
6
6
  License-File: LICENSE
@@ -1,5 +1,5 @@
1
1
  data_designer/__init__.py,sha256=iLr6FpW41-DFbGexuXCJ6gN1xBMNUZ2jfj9XxySmQhk,502
2
- data_designer/_version.py,sha256=UAb2Toi6SAdScDfq1uKRRv5QpMUuRtJqqwNxTMGe5Q4,704
2
+ data_designer/_version.py,sha256=CszCydqJjxQ_CbTrTy0L1k2j2gCfwJlahui0bCcdNp4,704
3
3
  data_designer/errors.py,sha256=r1pBvmvRBAsPmb7oF_veubhkxZ2uPo9cGEDwykLziX4,220
4
4
  data_designer/lazy_heavy_imports.py,sha256=wULSEPQRUOZXvOnb0tdf6wNbRBpaaczYfAjY-pstCBM,1512
5
5
  data_designer/logging.py,sha256=gRi9BOqm95UC1-u4pn6n-G4EySy9HhwKVyKLRO4aqm4,5382
@@ -114,7 +114,7 @@ data_designer/engine/models/__init__.py,sha256=XLO09Ei8g0lU7hYlzKCvhvQhLFBe5CBwE
114
114
  data_designer/engine/models/errors.py,sha256=k9oZnmk8DRD8U2SVKJJRLwrcdsCcVoJiOb_Q7ZyEdvg,12271
115
115
  data_designer/engine/models/facade.py,sha256=UBMpw_o2JcsWpJsPdpTPKfFZCh_i0eeG_oaWi1XeKds,12582
116
116
  data_designer/engine/models/factory.py,sha256=2NjI0iiGv8ayQ1c249lsJtha4pDmvmtSjdwvlvitRds,1581
117
- data_designer/engine/models/litellm_overrides.py,sha256=4qsTLZ2UHmh1YxdgqdvDBPt1taM348CVhtNZ5omnQRM,5742
117
+ data_designer/engine/models/litellm_overrides.py,sha256=e9IZCFQ6BhNWlOTncm8ErL8w4rtE1_4USh2mtUYxCZI,6207
118
118
  data_designer/engine/models/registry.py,sha256=7hZ6TQwwZf259yRZmc3ZI20a4wAo3PCOozPi9Mc5KLo,6827
119
119
  data_designer/engine/models/telemetry.py,sha256=wmuekvPRZjNz7p7ImKx5H_hqDRhTv_dSB-u2S6Ze3uo,12502
120
120
  data_designer/engine/models/usage.py,sha256=A0LV9Ycuj_7snOsaqnirs4mlkAjozv2mzj2om2FpDoU,2410
@@ -189,8 +189,8 @@ data_designer/plugins/registry.py,sha256=Cnt33Q25o9bS2v2YDbV3QPM57VNrtIBKAb4ERQR
189
189
  data_designer/plugins/testing/__init__.py,sha256=yyxrrH_i3q0Xb56QO9Ma35WtHlQ5PJF1b2pQoKa16xU,296
190
190
  data_designer/plugins/testing/stubs.py,sha256=9tUF209ayZR6f0Q1LsRDW4kEOTgPoIxV8jlq4QoWuW0,3498
191
191
  data_designer/plugins/testing/utils.py,sha256=a9LEgK827cnIzHEkgXOdgywrKDLBE36cyttrpG1ctT4,973
192
- data_designer-0.3.5.dist-info/METADATA,sha256=W1hr3pOCTlU0ZAfXpWZfOBLcvvWNlSLY5p-AtaW5dwQ,8119
193
- data_designer-0.3.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
194
- data_designer-0.3.5.dist-info/entry_points.txt,sha256=NWWWidyDxN6CYX6y664PhBYMhbaYTQTyprqfYAgkyCg,57
195
- data_designer-0.3.5.dist-info/licenses/LICENSE,sha256=cSWJDwVqHyQgly8Zmt3pqXJ2eQbZVYwN9qd0NMssxXY,11336
196
- data_designer-0.3.5.dist-info/RECORD,,
192
+ data_designer-0.3.7.dist-info/METADATA,sha256=-Ibzqy6fzBp72fF6Xo99QdJG1Urz1tysoWf00226uIU,8119
193
+ data_designer-0.3.7.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
194
+ data_designer-0.3.7.dist-info/entry_points.txt,sha256=NWWWidyDxN6CYX6y664PhBYMhbaYTQTyprqfYAgkyCg,57
195
+ data_designer-0.3.7.dist-info/licenses/LICENSE,sha256=cSWJDwVqHyQgly8Zmt3pqXJ2eQbZVYwN9qd0NMssxXY,11336
196
+ data_designer-0.3.7.dist-info/RECORD,,