lm-deluge 0.0.10__py3-none-any.whl → 0.0.11__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.
- lm_deluge/api_requests/mistral.py +1 -0
- lm_deluge/models.py +36 -24
- lm_deluge/tool.py +1 -1
- {lm_deluge-0.0.10.dist-info → lm_deluge-0.0.11.dist-info}/METADATA +30 -2
- {lm_deluge-0.0.10.dist-info → lm_deluge-0.0.11.dist-info}/RECORD +8 -8
- {lm_deluge-0.0.10.dist-info → lm_deluge-0.0.11.dist-info}/WHEEL +0 -0
- {lm_deluge-0.0.10.dist-info → lm_deluge-0.0.11.dist-info}/licenses/LICENSE +0 -0
- {lm_deluge-0.0.10.dist-info → lm_deluge-0.0.11.dist-info}/top_level.txt +0 -0
lm_deluge/models.py
CHANGED
|
@@ -445,30 +445,6 @@ registry = {
|
|
|
445
445
|
"requests_per_minute": 4_000,
|
|
446
446
|
"tokens_per_minute": 400_000,
|
|
447
447
|
},
|
|
448
|
-
"claude-3-haiku": {
|
|
449
|
-
"id": "claude-3-haiku",
|
|
450
|
-
"name": "claude-3-haiku-20240307",
|
|
451
|
-
"api_base": "https://api.anthropic.com/v1",
|
|
452
|
-
"api_key_env_var": "ANTHROPIC_API_KEY",
|
|
453
|
-
"supports_json": False,
|
|
454
|
-
"api_spec": "anthropic",
|
|
455
|
-
"input_cost": 0.25,
|
|
456
|
-
"output_cost": 1.25,
|
|
457
|
-
"requests_per_minute": 10_000,
|
|
458
|
-
"tokens_per_minute": 4_000_000, # supposed to be this but they fucked up
|
|
459
|
-
},
|
|
460
|
-
"claude-3.5-haiku": {
|
|
461
|
-
"id": "claude-3.5-haiku",
|
|
462
|
-
"name": "claude-3-5-haiku-20241022",
|
|
463
|
-
"api_base": "https://api.anthropic.com/v1",
|
|
464
|
-
"api_key_env_var": "ANTHROPIC_API_KEY",
|
|
465
|
-
"supports_json": False,
|
|
466
|
-
"api_spec": "anthropic",
|
|
467
|
-
"input_cost": 1.00,
|
|
468
|
-
"output_cost": 5.00,
|
|
469
|
-
"requests_per_minute": 20_000,
|
|
470
|
-
"tokens_per_minute": 4_000_000, # supposed to be this but they fucked up
|
|
471
|
-
},
|
|
472
448
|
"claude-3.7-sonnet": {
|
|
473
449
|
"id": "claude-3.7-sonnet",
|
|
474
450
|
"name": "claude-3-7-sonnet-20250219",
|
|
@@ -518,6 +494,42 @@ registry = {
|
|
|
518
494
|
"requests_per_minute": 4_000,
|
|
519
495
|
"tokens_per_minute": 400_000,
|
|
520
496
|
},
|
|
497
|
+
"claude-3-sonnet": {
|
|
498
|
+
"id": "claude-3-sonnet",
|
|
499
|
+
"name": "claude-3-sonnet-20240229",
|
|
500
|
+
"api_base": "https://api.anthropic.com/v1",
|
|
501
|
+
"api_key_env_var": "ANTHROPIC_API_KEY",
|
|
502
|
+
"supports_json": False,
|
|
503
|
+
"api_spec": "anthropic",
|
|
504
|
+
"input_cost": 15.0,
|
|
505
|
+
"output_cost": 75.0,
|
|
506
|
+
"requests_per_minute": 4_000,
|
|
507
|
+
"tokens_per_minute": 400_000,
|
|
508
|
+
},
|
|
509
|
+
"claude-3.5-haiku": {
|
|
510
|
+
"id": "claude-3.5-haiku",
|
|
511
|
+
"name": "claude-3-5-haiku-20241022",
|
|
512
|
+
"api_base": "https://api.anthropic.com/v1",
|
|
513
|
+
"api_key_env_var": "ANTHROPIC_API_KEY",
|
|
514
|
+
"supports_json": False,
|
|
515
|
+
"api_spec": "anthropic",
|
|
516
|
+
"input_cost": 1.00,
|
|
517
|
+
"output_cost": 5.00,
|
|
518
|
+
"requests_per_minute": 20_000,
|
|
519
|
+
"tokens_per_minute": 4_000_000, # supposed to be this but they fucked up
|
|
520
|
+
},
|
|
521
|
+
"claude-3-haiku": {
|
|
522
|
+
"id": "claude-3-haiku",
|
|
523
|
+
"name": "claude-3-haiku-20240307",
|
|
524
|
+
"api_base": "https://api.anthropic.com/v1",
|
|
525
|
+
"api_key_env_var": "ANTHROPIC_API_KEY",
|
|
526
|
+
"supports_json": False,
|
|
527
|
+
"api_spec": "anthropic",
|
|
528
|
+
"input_cost": 0.25,
|
|
529
|
+
"output_cost": 1.25,
|
|
530
|
+
"requests_per_minute": 10_000,
|
|
531
|
+
"tokens_per_minute": 4_000_000, # supposed to be this but they fucked up
|
|
532
|
+
},
|
|
521
533
|
# █████ █████ █████
|
|
522
534
|
# ░░███ ░░███ ░░███
|
|
523
535
|
# ░███ ░███ ██████ ████████ ███████ ██████ █████ █████
|
lm_deluge/tool.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lm_deluge
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.11
|
|
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
|
|
@@ -69,7 +69,7 @@ To distribute your requests across models, just provide a list of more than one
|
|
|
69
69
|
from lm_deluge import LLMClient
|
|
70
70
|
|
|
71
71
|
client = LLMClient.basic(
|
|
72
|
-
["gpt-4o-mini", "claude-haiku
|
|
72
|
+
["gpt-4o-mini", "claude-3-haiku"],
|
|
73
73
|
max_requests_per_minute=10_000
|
|
74
74
|
)
|
|
75
75
|
resps = client.process_prompts_sync(
|
|
@@ -123,6 +123,34 @@ resps = client.process_prompts_sync([prompt])
|
|
|
123
123
|
|
|
124
124
|
This just works. Images can be local images on disk, URLs, bytes, base64 data URLs... go wild. You can use `Conversation.to_openai` or `Conversation.to_anthropic` to format your messages for the OpenAI or Anthropic clients directly.
|
|
125
125
|
|
|
126
|
+
## Basic Tool Use
|
|
127
|
+
|
|
128
|
+
Define tools from Python functions and use them with any model:
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
from lm_deluge import LLMClient, Tool
|
|
132
|
+
|
|
133
|
+
def get_weather(city: str) -> str:
|
|
134
|
+
return f"The weather in {city} is sunny and 72°F"
|
|
135
|
+
|
|
136
|
+
tool = Tool.from_function(get_weather)
|
|
137
|
+
client = LLMClient.basic("claude-3-haiku")
|
|
138
|
+
resp = client.process_prompts_sync(["What's the weather in Paris?"], tools=[tool])
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## MCP Integration
|
|
142
|
+
|
|
143
|
+
Connect to MCP servers to extend your models with external tools:
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
from lm_deluge import LLMClient, Tool
|
|
147
|
+
|
|
148
|
+
# Connect to a local MCP server
|
|
149
|
+
mcp_tool = Tool.from_mcp("filesystem", command="npx -y @modelcontextprotocol/server-filesystem", args=["/path/to/directory"])
|
|
150
|
+
client = LLMClient.basic("gpt-4o-mini", tools=[mcp_tool])
|
|
151
|
+
resp = client.process_prompts_sync(["List the files in the current directory"])
|
|
152
|
+
```
|
|
153
|
+
|
|
126
154
|
## Caching
|
|
127
155
|
|
|
128
156
|
`lm_deluge.cache` includes LevelDB, SQLite and custom dictionary based caches. Pass an instance via `LLMClient(..., cache=my_cache)` and previously seen prompts will not be re‑sent across different `process_prompts_[...]` calls.
|
|
@@ -5,18 +5,18 @@ lm_deluge/embed.py,sha256=m-X8UK4gV9KKD7Wv3yarAceMQaj7gR1JwzD_sB0MOQY,13183
|
|
|
5
5
|
lm_deluge/errors.py,sha256=oHjt7YnxWbh-eXMScIzov4NvpJMo0-2r5J6Wh5DQ1tk,209
|
|
6
6
|
lm_deluge/gemini_limits.py,sha256=V9mpS9JtXYz7AY6OuKyQp5TuIMRH1BVv9YrSNmGmHNA,1569
|
|
7
7
|
lm_deluge/image.py,sha256=hFbRajqEVQbkirAfOxsTPkeq-27Zl-so4AWBFeUbpBI,7161
|
|
8
|
-
lm_deluge/models.py,sha256=
|
|
8
|
+
lm_deluge/models.py,sha256=oYrt0x0iVfTwoHjP-l1WWennzEDGwnZczj6ds6a6-xc,45406
|
|
9
9
|
lm_deluge/prompt.py,sha256=_pJYwgjL39lDzMNmae8pPIBoORm_ekSM_9qU2iGGpOc,25445
|
|
10
10
|
lm_deluge/rerank.py,sha256=tW1c3gQCAqaF8Ez-r-4qxYAcdKqxnLMxwHApKOUKwk4,11289
|
|
11
11
|
lm_deluge/sampling_params.py,sha256=E2kewh1vz-1Qcy5xNBCzihfGgT_GcHYMfzaWb3FLiXs,739
|
|
12
|
-
lm_deluge/tool.py,sha256=
|
|
12
|
+
lm_deluge/tool.py,sha256=5nFbHchv12C1jkL8nkEh6v9WfxpC0O6rALP25z60WsI,9476
|
|
13
13
|
lm_deluge/tracker.py,sha256=Dk99scN_NeDEO0gkLO5efXiZq11Ga-k6cerUHWN7IWY,1292
|
|
14
14
|
lm_deluge/api_requests/__init__.py,sha256=_aSpD6CJL9g6OpLPoChXiHjl4MH_OlGcKgfZaW8cgLM,71
|
|
15
15
|
lm_deluge/api_requests/anthropic.py,sha256=MMI_w9hVbevQpcqP3NVVindpTmLb2KHqjJQpIzCi5RM,7240
|
|
16
16
|
lm_deluge/api_requests/base.py,sha256=w0MEOCIccxxy2c67Y2Y-QBox9rinIxQ7MLnp8953sjQ,15954
|
|
17
17
|
lm_deluge/api_requests/bedrock.py,sha256=cvB85BFvL9HKTUsP9qFUCLQzJh83IQNAcLXuW6ReZK8,10520
|
|
18
18
|
lm_deluge/api_requests/common.py,sha256=U0mX_wC3Tzg2-1u9nYUCTQqYzuYJqvLrICCNW_dbbJM,287
|
|
19
|
-
lm_deluge/api_requests/mistral.py,sha256=
|
|
19
|
+
lm_deluge/api_requests/mistral.py,sha256=lU9AOyb46uTzRjKw6Sd5iojEbBIMF432fRex7q6Xtwk,5423
|
|
20
20
|
lm_deluge/api_requests/openai.py,sha256=BuMiM_2zJQXfnUjTT94JxJi3ZX5V-KQQueRG-R0SGuc,7361
|
|
21
21
|
lm_deluge/api_requests/deprecated/bedrock.py,sha256=WrcIShCoO8JCUSlFOCHxg6KQCNTZfw3TpYTvSpYk4mA,11320
|
|
22
22
|
lm_deluge/api_requests/deprecated/cohere.py,sha256=KgDScD6_bWhAzOY5BHZQKSA3kurt4KGENqC4wLsGmcU,5142
|
|
@@ -31,8 +31,8 @@ lm_deluge/util/json.py,sha256=dCeG9j1D17rXmQJbKJH79X0CGof4Wlqd55TDg4D6ky8,5388
|
|
|
31
31
|
lm_deluge/util/logprobs.py,sha256=UkBZakOxWluaLqHrjARu7xnJ0uCHVfLGHJdnYlEcutk,11768
|
|
32
32
|
lm_deluge/util/validation.py,sha256=hz5dDb3ebvZrZhnaWxOxbNSVMI6nmaOODBkk0htAUhs,1575
|
|
33
33
|
lm_deluge/util/xml.py,sha256=Ft4zajoYBJR3HHCt2oHwGfymGLdvp_gegVmJ-Wqk4Ck,10547
|
|
34
|
-
lm_deluge-0.0.
|
|
35
|
-
lm_deluge-0.0.
|
|
36
|
-
lm_deluge-0.0.
|
|
37
|
-
lm_deluge-0.0.
|
|
38
|
-
lm_deluge-0.0.
|
|
34
|
+
lm_deluge-0.0.11.dist-info/licenses/LICENSE,sha256=uNNXGXPCw2TC7CUs7SEBkA-Mz6QBQFWUUEWDMgEs1dU,1058
|
|
35
|
+
lm_deluge-0.0.11.dist-info/METADATA,sha256=jdPdmbo_F8ecKTAHtPTg2GeyCOFmmsJ6T4-4RUleU24,9210
|
|
36
|
+
lm_deluge-0.0.11.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
37
|
+
lm_deluge-0.0.11.dist-info/top_level.txt,sha256=hqU-TJX93yBwpgkDtYcXyLr3t7TLSCCZ_reytJjwBaE,10
|
|
38
|
+
lm_deluge-0.0.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|