lm-deluge 0.0.33__py3-none-any.whl → 0.0.34__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.

Potentially problematic release.


This version of lm-deluge might be problematic. Click here for more details.

@@ -1,7 +1,7 @@
1
1
  import json
2
2
  import os
3
3
  import warnings
4
-
4
+ from typing import Any
5
5
  from aiohttp import ClientResponse
6
6
 
7
7
  from lm_deluge.request_context import RequestContext
@@ -37,11 +37,12 @@ async def _build_gemini_request(
37
37
 
38
38
  # Handle reasoning models (thinking)
39
39
  if model.reasoning_model:
40
- thinking_config = None
40
+ thinking_config: dict[str, Any] | None = None
41
41
  effort = sampling_params.reasoning_effort
42
42
  if effort is None or effort == "none":
43
+ budget = 128 if "2.5-pro" in model.id else 0
43
44
  # Explicitly disable thoughts when no effort is requested
44
- thinking_config = {"includeThoughts": False, "thinkingBudget": 0}
45
+ thinking_config = {"includeThoughts": False, "thinkingBudget": budget}
45
46
  else:
46
47
  thinking_config = {"includeThoughts": True}
47
48
  if effort in {"low", "medium", "high"} and "flash" in model.id:
lm_deluge/client.py CHANGED
@@ -773,10 +773,54 @@ class _LLMClient(BaseModel):
773
773
 
774
774
  # Clean factory function with perfect IDE support
775
775
  @overload
776
- def LLMClient(model_names: str, **kwargs) -> _LLMClient: ...
776
+ def LLMClient(
777
+ model_names: str,
778
+ *,
779
+ max_requests_per_minute: int = 1_000,
780
+ max_tokens_per_minute: int = 100_000,
781
+ max_concurrent_requests: int = 225,
782
+ sampling_params: list[SamplingParams] | None = None,
783
+ model_weights: list[float] | Literal["uniform", "dynamic"] = "uniform",
784
+ max_attempts: int = 5,
785
+ request_timeout: int = 30,
786
+ cache: Any = None,
787
+ extra_headers: dict[str, str] | None = None,
788
+ temperature: float = 0.75,
789
+ top_p: float = 1.0,
790
+ json_mode: bool = False,
791
+ max_new_tokens: int = 512,
792
+ reasoning_effort: Literal["low", "medium", "high", None] = None,
793
+ logprobs: bool = False,
794
+ top_logprobs: int | None = None,
795
+ force_local_mcp: bool = False,
796
+ progress: Literal["rich", "tqdm", "manual"] = "rich",
797
+ ) -> _LLMClient: ...
798
+
799
+
800
+ @overload
801
+ def LLMClient(
802
+ model_names: list[str],
803
+ *,
804
+ max_requests_per_minute: int = 1_000,
805
+ max_tokens_per_minute: int = 100_000,
806
+ max_concurrent_requests: int = 225,
807
+ sampling_params: list[SamplingParams] | None = None,
808
+ model_weights: list[float] | Literal["uniform", "dynamic"] = "uniform",
809
+ max_attempts: int = 5,
810
+ request_timeout: int = 30,
811
+ cache: Any = None,
812
+ extra_headers: dict[str, str] | None = None,
813
+ temperature: float = 0.75,
814
+ top_p: float = 1.0,
815
+ json_mode: bool = False,
816
+ max_new_tokens: int = 512,
817
+ reasoning_effort: Literal["low", "medium", "high", None] = None,
818
+ logprobs: bool = False,
819
+ top_logprobs: int | None = None,
820
+ force_local_mcp: bool = False,
821
+ progress: Literal["rich", "tqdm", "manual"] = "rich",
822
+ ) -> _LLMClient: ...
777
823
 
778
- @overload
779
- def LLMClient(model_names: list[str], **kwargs) -> _LLMClient: ...
780
824
 
781
825
  def LLMClient(
782
826
  model_names: str | list[str] = "gpt-4.1-mini",
@@ -802,18 +846,18 @@ def LLMClient(
802
846
  ) -> _LLMClient:
803
847
  """
804
848
  Create an LLMClient with model_names as a positional argument.
805
-
849
+
806
850
  Args:
807
851
  model_names: Model name(s) to use - can be a single string or list of strings
808
852
  **kwargs: All other LLMClient configuration options (keyword-only)
809
-
853
+
810
854
  Returns:
811
855
  Configured LLMClient instance
812
856
  """
813
857
  # Handle default for mutable argument
814
858
  if sampling_params is None:
815
859
  sampling_params = []
816
-
860
+
817
861
  # Simply pass everything to the Pydantic constructor
818
862
  return _LLMClient(
819
863
  model_names=model_names,
lm_deluge/models.py CHANGED
@@ -1275,7 +1275,7 @@ def register_model(
1275
1275
  reasoning_model: bool = False,
1276
1276
  regions: list[str] | dict[str, int] = field(default_factory=list),
1277
1277
  tokens_per_minute: int | None = None,
1278
- requests_per_minute: int | None = None
1278
+ requests_per_minute: int | None = None,
1279
1279
  ) -> APIModel:
1280
1280
  """Register a model configuration and return the created APIModel."""
1281
1281
  model = APIModel(
@@ -1292,7 +1292,7 @@ def register_model(
1292
1292
  reasoning_model=reasoning_model,
1293
1293
  regions=regions,
1294
1294
  tokens_per_minute=tokens_per_minute,
1295
- requests_per_minute=requests_per_minute
1295
+ requests_per_minute=requests_per_minute,
1296
1296
  )
1297
1297
  registry[model.id] = model
1298
1298
  return model
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lm_deluge
3
- Version: 0.0.33
3
+ Version: 0.0.34
4
4
  Summary: Python utility for using LLM API models.
5
5
  Author-email: Benjamin Anderson <ben@trytaylor.ai>
6
6
  Requires-Python: >=3.10
@@ -2,14 +2,14 @@ lm_deluge/__init__.py,sha256=mAztMuxINmh7dGbYnT8tsmw1eryQAvd0jpY8yHzd0EE,315
2
2
  lm_deluge/agent.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  lm_deluge/batches.py,sha256=vJXVnuuGkIQnXoDPODPERrvdG9X1Ov1jnXExnPe6ZAc,21772
4
4
  lm_deluge/cache.py,sha256=VB1kv8rM2t5XWPR60uhszFcxLDnVKOe1oA5hYjVDjIo,4375
5
- lm_deluge/client.py,sha256=82Q0nWmOhYgFQojlsxMXJyfTNmgpNn0QpDb_MjPj6-g,32833
5
+ lm_deluge/client.py,sha256=mTC_gxydu1JBtjXcEp8_GuAj4U6cAvZzAQjj4_0gCt0,34287
6
6
  lm_deluge/config.py,sha256=H1tQyJDNHGFuwxqQNL5Z-CjWAC0luHSBA3iY_pxmACM,932
7
7
  lm_deluge/embed.py,sha256=CO-TOlC5kOTAM8lcnicoG4u4K664vCBwHF1vHa-nAGg,13382
8
8
  lm_deluge/errors.py,sha256=oHjt7YnxWbh-eXMScIzov4NvpJMo0-2r5J6Wh5DQ1tk,209
9
9
  lm_deluge/file.py,sha256=FGomcG8s2go_55Z2CChflHgmU-UqgFftgFY8c7f_G70,5631
10
10
  lm_deluge/gemini_limits.py,sha256=V9mpS9JtXYz7AY6OuKyQp5TuIMRH1BVv9YrSNmGmHNA,1569
11
11
  lm_deluge/image.py,sha256=Qpa0k5yXfrpSaHzVUwW_TEn7yEgmwzYGL17Sa7-KhSA,7729
12
- lm_deluge/models.py,sha256=WkbGoaWUJLRwB9ug9RBjKL-ykSOmf8oKEzcWh2dcCO4,51758
12
+ lm_deluge/models.py,sha256=L1vL24I74QNL7AgAGSmUMNFW9gSMBc8xinDBcQXu158,51760
13
13
  lm_deluge/prompt.py,sha256=cfwzCAmT-1K0v7SfEMUrxpBkJGgf7IFlWfNLJrCcoBM,37025
14
14
  lm_deluge/request_context.py,sha256=o33LSEwnK6YPhZeulUoSE_VrdKCXiCQa0tjjixK2K6M,2540
15
15
  lm_deluge/rerank.py,sha256=-NBAJdHz9OB-SWWJnHzkFmeVO4wR6lFV7Vw-SxG7aVo,11457
@@ -21,7 +21,7 @@ lm_deluge/api_requests/anthropic.py,sha256=d22ainIrH2PgOgQZcygFZK-cvs6O4XCJCnyx2
21
21
  lm_deluge/api_requests/base.py,sha256=EVHNFtlttKbN7Tt1MnLaO-NjvKHPSV5CqlRv-OnpVAE,5593
22
22
  lm_deluge/api_requests/bedrock.py,sha256=FZMhF590JzJtAYDugbDtG93RhPt5efWZ0Wn4V8U8Dgw,11031
23
23
  lm_deluge/api_requests/common.py,sha256=BZ3vRO5TB669_UsNKugkkuFSzoLHOYJIKt4nV4sf4vc,422
24
- lm_deluge/api_requests/gemini.py,sha256=W4NjQ0buBsdS7RYpzDahrXNQWMzDHRMLNRSphCOmIqg,7685
24
+ lm_deluge/api_requests/gemini.py,sha256=tXk6AfioN7xv7B_HYw7Va7kQsm0hLJhSZfYNP6hAwgM,7792
25
25
  lm_deluge/api_requests/mistral.py,sha256=S_LpOfCGbCVEROH_od3P-tYeNYTKFMamMTL-c_wFCBI,4597
26
26
  lm_deluge/api_requests/openai.py,sha256=hsJIMRO4wpalrczD0bVc--RWFu2BoXEp0USAwRlLQEA,21763
27
27
  lm_deluge/api_requests/response.py,sha256=FtkVYk_rDH93Kj9pqbB-l7a4dQHzVr6ivKL9khYKLbs,5966
@@ -48,8 +48,8 @@ lm_deluge/util/logprobs.py,sha256=UkBZakOxWluaLqHrjARu7xnJ0uCHVfLGHJdnYlEcutk,11
48
48
  lm_deluge/util/spatial.py,sha256=BsF_UKhE-x0xBirc-bV1xSKZRTUhsOBdGqsMKme20C8,4099
49
49
  lm_deluge/util/validation.py,sha256=hz5dDb3ebvZrZhnaWxOxbNSVMI6nmaOODBkk0htAUhs,1575
50
50
  lm_deluge/util/xml.py,sha256=Ft4zajoYBJR3HHCt2oHwGfymGLdvp_gegVmJ-Wqk4Ck,10547
51
- lm_deluge-0.0.33.dist-info/licenses/LICENSE,sha256=uNNXGXPCw2TC7CUs7SEBkA-Mz6QBQFWUUEWDMgEs1dU,1058
52
- lm_deluge-0.0.33.dist-info/METADATA,sha256=USqmVPTkUJkLSrMeChb-PyxELn6aMkBB-XK9UL8a2zs,13295
53
- lm_deluge-0.0.33.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
54
- lm_deluge-0.0.33.dist-info/top_level.txt,sha256=hqU-TJX93yBwpgkDtYcXyLr3t7TLSCCZ_reytJjwBaE,10
55
- lm_deluge-0.0.33.dist-info/RECORD,,
51
+ lm_deluge-0.0.34.dist-info/licenses/LICENSE,sha256=uNNXGXPCw2TC7CUs7SEBkA-Mz6QBQFWUUEWDMgEs1dU,1058
52
+ lm_deluge-0.0.34.dist-info/METADATA,sha256=7vzU_xBUX93r35eUF08MmB0jhBN2SrYH4yhj7snPi2g,13295
53
+ lm_deluge-0.0.34.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
54
+ lm_deluge-0.0.34.dist-info/top_level.txt,sha256=hqU-TJX93yBwpgkDtYcXyLr3t7TLSCCZ_reytJjwBaE,10
55
+ lm_deluge-0.0.34.dist-info/RECORD,,