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

@@ -60,7 +60,8 @@ def _build_anthropic_request(
60
60
  "type": "enabled",
61
61
  "budget_tokens": budget,
62
62
  }
63
- request_json.pop("top_p")
63
+ if "top_p" in request_json:
64
+ request_json["top_p"] = max(request_json["top_p"], 0.95)
64
65
  request_json["temperature"] = 1.0
65
66
  request_json["max_tokens"] += budget
66
67
  else:
@@ -70,6 +71,11 @@ def _build_anthropic_request(
70
71
  if system_message is not None:
71
72
  request_json["system"] = system_message
72
73
 
74
+ # handle temp + top_p for opus 4.1/sonnet 4.5
75
+ if model.name in ["claude-sonnet-4-5-20250929", "claude-opus-4-1-20250805"]:
76
+ if "temperature" in request_json and "top_p" in request_json:
77
+ request_json.pop("top_p")
78
+
73
79
  if tools:
74
80
  mcp_servers = []
75
81
  tool_definitions = []
@@ -89,6 +95,9 @@ def _build_anthropic_request(
89
95
  _add_beta(base_headers, "computer-use-2025-01-24")
90
96
  elif tool["type"] == "code_execution_20250522":
91
97
  _add_beta(base_headers, "code-execution-2025-05-22")
98
+ elif tool["type"] in ["memory_20250818", "clear_tool_uses_20250919"]:
99
+ _add_beta(base_headers, "context-management-2025-06-27")
100
+
92
101
  elif isinstance(tool, MCPServer):
93
102
  _add_beta(base_headers, "mcp-client-2025-04-04")
94
103
  mcp_servers.append(tool.for_anthropic())
lm_deluge/client.py CHANGED
@@ -427,8 +427,8 @@ class _LLMClient(BaseModel):
427
427
  try:
428
428
  response = await self.process_single_request(ctx, retry_queue)
429
429
  results[ctx.task_id] = response
430
- except Exception as e:
431
- # Create an error response for validation errors and other exceptions
430
+ except BaseException as exc:
431
+ # Capture cancellations and other BaseExceptions before fallback response fires.
432
432
  error_response = APIResponse(
433
433
  id=ctx.task_id,
434
434
  model_internal=ctx.model_name,
@@ -436,12 +436,13 @@ class _LLMClient(BaseModel):
436
436
  sampling_params=ctx.sampling_params,
437
437
  status_code=None,
438
438
  is_error=True,
439
- error_message=str(e),
439
+ error_message=f"{type(exc).__name__}: {exc}",
440
+ raw_response={"exception_repr": repr(exc)},
440
441
  )
441
442
  results[ctx.task_id] = error_response
442
- # Mark task as completed so the main loop can finish
443
443
  if ctx.status_tracker:
444
444
  ctx.status_tracker.task_failed(ctx.task_id)
445
+ raise
445
446
 
446
447
  task = asyncio.create_task(process_and_store(next_context))
447
448
  inflight_tasks.add(task)
@@ -10,6 +10,18 @@ ANTHROPIC_MODELS = {
10
10
  # ░███
11
11
  # █████
12
12
  #
13
+ "claude-4.5-sonnet": {
14
+ "id": "claude-4.5-sonnet",
15
+ "name": "claude-sonnet-4-5-20250929",
16
+ "api_base": "https://api.anthropic.com/v1",
17
+ "api_key_env_var": "ANTHROPIC_API_KEY",
18
+ "supports_json": False,
19
+ "api_spec": "anthropic",
20
+ "input_cost": 3.0,
21
+ "output_cost": 15.0,
22
+ "requests_per_minute": 4_000,
23
+ "tokens_per_minute": 400_000,
24
+ },
13
25
  "claude-4.1-opus": {
14
26
  "id": "claude-4.1-opus",
15
27
  "name": "claude-opus-4-1-20250805",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lm_deluge
3
- Version: 0.0.52
3
+ Version: 0.0.53
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
@@ -3,7 +3,7 @@ lm_deluge/agent.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  lm_deluge/batches.py,sha256=rQocJLyIs3Ko_nRdAE9jT__5cKWYxiIRAH_Lw3L0E1k,24653
4
4
  lm_deluge/cache.py,sha256=xO2AIYvP3tUpTMKQjwQQYfGRJSRi6e7sMlRhLjsS-u4,4873
5
5
  lm_deluge/cli.py,sha256=Ilww5gOw3J5v0NReq_Ra4hhxU4BCIJBl1oTGxJZKedc,12065
6
- lm_deluge/client.py,sha256=WIz1M6PLZi08Y3SFhGS3Pxs1fP8P0nKSLMYzFUdNnOQ,35814
6
+ lm_deluge/client.py,sha256=oqsEDejrXfV12Oneeye4JStarIzwLHVUg2CFpb3FhWA,35880
7
7
  lm_deluge/config.py,sha256=H1tQyJDNHGFuwxqQNL5Z-CjWAC0luHSBA3iY_pxmACM,932
8
8
  lm_deluge/embed.py,sha256=CO-TOlC5kOTAM8lcnicoG4u4K664vCBwHF1vHa-nAGg,13382
9
9
  lm_deluge/errors.py,sha256=oHjt7YnxWbh-eXMScIzov4NvpJMo0-2r5J6Wh5DQ1tk,209
@@ -17,7 +17,7 @@ lm_deluge/tool.py,sha256=3weKo09E_srEKwHlz2WMVhk2BuDr5pJpi1UP0-qlcmo,16210
17
17
  lm_deluge/tracker.py,sha256=EHFPsS94NmsON2u97rSE70q1t6pwCsixUmGV-kIphMs,11531
18
18
  lm_deluge/usage.py,sha256=VMEKghePFIID5JFBObqYxFpgYxnbYm_dnHy7V1-_T6M,4866
19
19
  lm_deluge/api_requests/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
20
- lm_deluge/api_requests/anthropic.py,sha256=8MledxnN0S-H_fZRq8DGUokcjZPQ154mr8tPWAussJ8,7992
20
+ lm_deluge/api_requests/anthropic.py,sha256=Iy-AMo1o7xliwWhamFIUc601PZ0YWLhwAgszgfws42I,8467
21
21
  lm_deluge/api_requests/base.py,sha256=EVHNFtlttKbN7Tt1MnLaO-NjvKHPSV5CqlRv-OnpVAE,5593
22
22
  lm_deluge/api_requests/bedrock.py,sha256=GmVxXz3ERAeQ7e52Nlztt81O4H9eJOQeOnS6b65vjm4,15453
23
23
  lm_deluge/api_requests/common.py,sha256=BZ3vRO5TB669_UsNKugkkuFSzoLHOYJIKt4nV4sf4vc,422
@@ -44,7 +44,7 @@ lm_deluge/llm_tools/ocr.py,sha256=7fDlvs6uUOvbxMasvGGNJx5Fj6biM6z3lijKZaGN26k,23
44
44
  lm_deluge/llm_tools/score.py,sha256=9oGA3-k2U5buHQXkXaEI9M4Wb5yysNhTLsPbGeghAlQ,2580
45
45
  lm_deluge/llm_tools/translate.py,sha256=iXyYvQZ8bC44FWhBk4qpdqjKM1WFF7Shq-H2PxhPgg4,1452
46
46
  lm_deluge/models/__init__.py,sha256=Dh2CuTZeCAddIIXwWJXOjM10B0CpKqjTdMXWYuBP0s8,4289
47
- lm_deluge/models/anthropic.py,sha256=3pW7fyBY9Xh1m1RtfncU9amWTtKnjGZD0STjpu8iUSQ,5700
47
+ lm_deluge/models/anthropic.py,sha256=zTOjwNh00OYPZMFiaTniZzTtwL1Vmnlm750GhVaczqk,6112
48
48
  lm_deluge/models/bedrock.py,sha256=PIaXvho2agCm1hSSAEy8zHCITjApXT2eUOGDKW425tE,5424
49
49
  lm_deluge/models/cerebras.py,sha256=u2FMXJF6xMr0euDRKLKMo_NVTOcvSrrEpehbHr8sSeE,2050
50
50
  lm_deluge/models/cohere.py,sha256=M_7cVA9QD4qe1X4sZXCpKEkKrKz2jibaspiTnzsZ1GU,3998
@@ -66,8 +66,8 @@ lm_deluge/util/logprobs.py,sha256=UkBZakOxWluaLqHrjARu7xnJ0uCHVfLGHJdnYlEcutk,11
66
66
  lm_deluge/util/spatial.py,sha256=BsF_UKhE-x0xBirc-bV1xSKZRTUhsOBdGqsMKme20C8,4099
67
67
  lm_deluge/util/validation.py,sha256=hz5dDb3ebvZrZhnaWxOxbNSVMI6nmaOODBkk0htAUhs,1575
68
68
  lm_deluge/util/xml.py,sha256=Ft4zajoYBJR3HHCt2oHwGfymGLdvp_gegVmJ-Wqk4Ck,10547
69
- lm_deluge-0.0.52.dist-info/licenses/LICENSE,sha256=uNNXGXPCw2TC7CUs7SEBkA-Mz6QBQFWUUEWDMgEs1dU,1058
70
- lm_deluge-0.0.52.dist-info/METADATA,sha256=X1JJBjExVA0NNXSaoB2NkOpT9f660AFe9u58BmKdb2w,13443
71
- lm_deluge-0.0.52.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
72
- lm_deluge-0.0.52.dist-info/top_level.txt,sha256=hqU-TJX93yBwpgkDtYcXyLr3t7TLSCCZ_reytJjwBaE,10
73
- lm_deluge-0.0.52.dist-info/RECORD,,
69
+ lm_deluge-0.0.53.dist-info/licenses/LICENSE,sha256=uNNXGXPCw2TC7CUs7SEBkA-Mz6QBQFWUUEWDMgEs1dU,1058
70
+ lm_deluge-0.0.53.dist-info/METADATA,sha256=OpxbcRFe3rFPYWkJc0iNWLYX1e6VFA5WAbukQzNKZy4,13443
71
+ lm_deluge-0.0.53.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
72
+ lm_deluge-0.0.53.dist-info/top_level.txt,sha256=hqU-TJX93yBwpgkDtYcXyLr3t7TLSCCZ_reytJjwBaE,10
73
+ lm_deluge-0.0.53.dist-info/RECORD,,