lm-deluge 0.0.35__tar.gz → 0.0.106__tar.gz

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.
Files changed (176) hide show
  1. {lm_deluge-0.0.35/src/lm_deluge.egg-info → lm_deluge-0.0.106}/PKG-INFO +40 -22
  2. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/README.md +22 -19
  3. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/pyproject.toml +16 -3
  4. lm_deluge-0.0.106/src/lm_deluge/__init__.py +19 -0
  5. lm_deluge-0.0.106/src/lm_deluge/api_requests/anthropic.py +433 -0
  6. lm_deluge-0.0.106/src/lm_deluge/api_requests/base.py +325 -0
  7. lm_deluge-0.0.106/src/lm_deluge/api_requests/bedrock.py +459 -0
  8. lm_deluge-0.0.35/src/lm_deluge/api_requests/bedrock.py → lm_deluge-0.0.106/src/lm_deluge/api_requests/bedrock_nova.py +95 -87
  9. lm_deluge-0.0.106/src/lm_deluge/api_requests/chat_reasoning.py +4 -0
  10. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/api_requests/common.py +2 -0
  11. lm_deluge-0.0.35/src/lm_deluge/request_context.py → lm_deluge-0.0.106/src/lm_deluge/api_requests/context.py +24 -17
  12. lm_deluge-0.0.106/src/lm_deluge/api_requests/gemini.py +367 -0
  13. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/api_requests/mistral.py +17 -10
  14. lm_deluge-0.0.106/src/lm_deluge/api_requests/openai.py +769 -0
  15. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/api_requests/response.py +35 -5
  16. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/batches.py +134 -62
  17. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/cache.py +11 -2
  18. lm_deluge-0.0.106/src/lm_deluge/cli.py +746 -0
  19. lm_deluge-0.0.106/src/lm_deluge/client/__init__.py +1737 -0
  20. lm_deluge-0.0.106/src/lm_deluge/config.py +23 -0
  21. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/embed.py +2 -6
  22. lm_deluge-0.0.106/src/lm_deluge/mcp/__init__.py +38 -0
  23. lm_deluge-0.0.106/src/lm_deluge/mcp/client.py +204 -0
  24. lm_deluge-0.0.106/src/lm_deluge/mcp/sse.py +92 -0
  25. lm_deluge-0.0.106/src/lm_deluge/mcp/transports.py +245 -0
  26. lm_deluge-0.0.106/src/lm_deluge/mcp/types.py +59 -0
  27. lm_deluge-0.0.106/src/lm_deluge/models/__init__.py +278 -0
  28. lm_deluge-0.0.106/src/lm_deluge/models/anthropic.py +169 -0
  29. lm_deluge-0.0.106/src/lm_deluge/models/arcee.py +16 -0
  30. lm_deluge-0.0.106/src/lm_deluge/models/azure.py +269 -0
  31. lm_deluge-0.0.106/src/lm_deluge/models/bedrock.py +162 -0
  32. lm_deluge-0.0.106/src/lm_deluge/models/cerebras.py +66 -0
  33. lm_deluge-0.0.106/src/lm_deluge/models/cohere.py +84 -0
  34. lm_deluge-0.0.106/src/lm_deluge/models/deepseek.py +59 -0
  35. lm_deluge-0.0.106/src/lm_deluge/models/fireworks.py +18 -0
  36. lm_deluge-0.0.106/src/lm_deluge/models/google.py +196 -0
  37. lm_deluge-0.0.106/src/lm_deluge/models/grok.py +110 -0
  38. lm_deluge-0.0.106/src/lm_deluge/models/groq.py +78 -0
  39. lm_deluge-0.0.106/src/lm_deluge/models/kimi.py +59 -0
  40. lm_deluge-0.0.106/src/lm_deluge/models/meta.py +59 -0
  41. lm_deluge-0.0.106/src/lm_deluge/models/minimax.py +18 -0
  42. lm_deluge-0.0.106/src/lm_deluge/models/mistral.py +110 -0
  43. lm_deluge-0.0.106/src/lm_deluge/models/openai.py +445 -0
  44. lm_deluge-0.0.106/src/lm_deluge/models/openrouter.py +329 -0
  45. lm_deluge-0.0.106/src/lm_deluge/models/together.py +110 -0
  46. lm_deluge-0.0.106/src/lm_deluge/models/zai.py +62 -0
  47. {lm_deluge-0.0.35/src/lm_deluge/llm_tools → lm_deluge-0.0.106/src/lm_deluge/pipelines}/extract.py +11 -10
  48. lm_deluge-0.0.106/src/lm_deluge/pipelines/gepa/__init__.py +95 -0
  49. lm_deluge-0.0.106/src/lm_deluge/pipelines/gepa/core.py +354 -0
  50. lm_deluge-0.0.106/src/lm_deluge/pipelines/gepa/docs/samples.py +705 -0
  51. lm_deluge-0.0.106/src/lm_deluge/pipelines/gepa/examples/01_synthetic_keywords.py +140 -0
  52. lm_deluge-0.0.106/src/lm_deluge/pipelines/gepa/examples/02_gsm8k_math.py +261 -0
  53. lm_deluge-0.0.106/src/lm_deluge/pipelines/gepa/examples/03_hotpotqa_multihop.py +300 -0
  54. lm_deluge-0.0.106/src/lm_deluge/pipelines/gepa/examples/04_batch_classification.py +271 -0
  55. lm_deluge-0.0.106/src/lm_deluge/pipelines/gepa/examples/simple_qa.py +129 -0
  56. lm_deluge-0.0.106/src/lm_deluge/pipelines/gepa/optimizer.py +435 -0
  57. lm_deluge-0.0.106/src/lm_deluge/pipelines/gepa/proposer.py +235 -0
  58. lm_deluge-0.0.106/src/lm_deluge/pipelines/gepa/util.py +165 -0
  59. lm_deluge-0.0.106/src/lm_deluge/pipelines/heartbeat.py +29 -0
  60. {lm_deluge-0.0.35/src/lm_deluge/llm_tools → lm_deluge-0.0.106/src/lm_deluge/pipelines}/score.py +2 -2
  61. {lm_deluge-0.0.35/src/lm_deluge/llm_tools → lm_deluge-0.0.106/src/lm_deluge/pipelines}/translate.py +5 -3
  62. lm_deluge-0.0.106/src/lm_deluge/prompt/__init__.py +47 -0
  63. lm_deluge-0.0.106/src/lm_deluge/prompt/conversation.py +1230 -0
  64. lm_deluge-0.0.106/src/lm_deluge/prompt/file.py +531 -0
  65. {lm_deluge-0.0.35/src/lm_deluge → lm_deluge-0.0.106/src/lm_deluge/prompt}/image.py +40 -1
  66. lm_deluge-0.0.106/src/lm_deluge/prompt/message.py +596 -0
  67. lm_deluge-0.0.106/src/lm_deluge/prompt/serialization.py +21 -0
  68. lm_deluge-0.0.106/src/lm_deluge/prompt/signatures.py +77 -0
  69. lm_deluge-0.0.106/src/lm_deluge/prompt/text.py +50 -0
  70. lm_deluge-0.0.106/src/lm_deluge/prompt/thinking.py +68 -0
  71. lm_deluge-0.0.106/src/lm_deluge/prompt/tool_calls.py +301 -0
  72. lm_deluge-0.0.106/src/lm_deluge/server/__init__.py +24 -0
  73. lm_deluge-0.0.106/src/lm_deluge/server/__main__.py +144 -0
  74. lm_deluge-0.0.106/src/lm_deluge/server/adapters.py +369 -0
  75. lm_deluge-0.0.106/src/lm_deluge/server/app.py +388 -0
  76. lm_deluge-0.0.106/src/lm_deluge/server/auth.py +71 -0
  77. lm_deluge-0.0.106/src/lm_deluge/server/model_policy.py +215 -0
  78. lm_deluge-0.0.106/src/lm_deluge/server/models_anthropic.py +172 -0
  79. lm_deluge-0.0.106/src/lm_deluge/server/models_openai.py +175 -0
  80. lm_deluge-0.0.106/src/lm_deluge/skill/SKILL.md +196 -0
  81. lm_deluge-0.0.106/src/lm_deluge/skill/__init__.py +1 -0
  82. lm_deluge-0.0.106/src/lm_deluge/tool/__init__.py +1296 -0
  83. lm_deluge-0.0.106/src/lm_deluge/tool/builtin/anthropic/__init__.py +300 -0
  84. lm_deluge-0.0.106/src/lm_deluge/tool/builtin/anthropic/computer_use.py +0 -0
  85. lm_deluge-0.0.106/src/lm_deluge/tool/builtin/gemini.py +59 -0
  86. lm_deluge-0.0.106/src/lm_deluge/tool/builtin/openai.py +74 -0
  87. lm_deluge-0.0.106/src/lm_deluge/tool/cua/__init__.py +173 -0
  88. lm_deluge-0.0.106/src/lm_deluge/tool/cua/actions.py +148 -0
  89. lm_deluge-0.0.106/src/lm_deluge/tool/cua/base.py +27 -0
  90. lm_deluge-0.0.106/src/lm_deluge/tool/cua/batch.py +214 -0
  91. lm_deluge-0.0.106/src/lm_deluge/tool/cua/converters.py +466 -0
  92. lm_deluge-0.0.106/src/lm_deluge/tool/cua/kernel.py +702 -0
  93. lm_deluge-0.0.106/src/lm_deluge/tool/cua/trycua.py +989 -0
  94. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/__init__.py +119 -0
  95. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/batch_tool.py +156 -0
  96. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/curl.py +343 -0
  97. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/docs.py +1119 -0
  98. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/email.py +294 -0
  99. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/filesystem.py +1721 -0
  100. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/full_text_search/__init__.py +286 -0
  101. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/full_text_search/tantivy_index.py +396 -0
  102. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/memory.py +460 -0
  103. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/otc/__init__.py +165 -0
  104. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/otc/executor.py +281 -0
  105. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/otc/parse.py +188 -0
  106. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/philips_hue.py +428 -0
  107. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/random.py +188 -0
  108. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/rlm/__init__.py +296 -0
  109. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/rlm/executor.py +349 -0
  110. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/rlm/parse.py +144 -0
  111. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/sandbox/__init__.py +58 -0
  112. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/sandbox/daytona_sandbox.py +483 -0
  113. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/sandbox/docker_sandbox.py +609 -0
  114. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/sandbox/fargate_sandbox.py +546 -0
  115. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/sandbox/modal_sandbox.py +469 -0
  116. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/sandbox/seatbelt_sandbox.py +829 -0
  117. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/sheets.py +385 -0
  118. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/skills.py +0 -0
  119. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/subagents.py +233 -0
  120. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/todos.py +342 -0
  121. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/tool_search.py +169 -0
  122. lm_deluge-0.0.106/src/lm_deluge/tool/prefab/web_search.py +1020 -0
  123. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/tracker.py +91 -15
  124. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/usage.py +30 -21
  125. lm_deluge-0.0.106/src/lm_deluge/util/anthropic_files.py +228 -0
  126. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/util/harmony.py +6 -4
  127. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/util/json.py +1 -2
  128. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/util/logprobs.py +4 -4
  129. lm_deluge-0.0.106/src/lm_deluge/util/schema.py +412 -0
  130. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/util/validation.py +14 -9
  131. lm_deluge-0.0.106/src/lm_deluge/warnings.py +54 -0
  132. {lm_deluge-0.0.35 → lm_deluge-0.0.106/src/lm_deluge.egg-info}/PKG-INFO +40 -22
  133. lm_deluge-0.0.106/src/lm_deluge.egg-info/SOURCES.txt +156 -0
  134. lm_deluge-0.0.106/src/lm_deluge.egg-info/entry_points.txt +3 -0
  135. lm_deluge-0.0.106/src/lm_deluge.egg-info/requires.txt +38 -0
  136. lm_deluge-0.0.35/src/lm_deluge/__init__.py +0 -17
  137. lm_deluge-0.0.35/src/lm_deluge/api_requests/anthropic.py +0 -217
  138. lm_deluge-0.0.35/src/lm_deluge/api_requests/base.py +0 -151
  139. lm_deluge-0.0.35/src/lm_deluge/api_requests/gemini.py +0 -204
  140. lm_deluge-0.0.35/src/lm_deluge/api_requests/openai.py +0 -527
  141. lm_deluge-0.0.35/src/lm_deluge/built_in_tools/anthropic/__init__.py +0 -128
  142. lm_deluge-0.0.35/src/lm_deluge/built_in_tools/openai.py +0 -28
  143. lm_deluge-0.0.35/src/lm_deluge/client.py +0 -828
  144. lm_deluge-0.0.35/src/lm_deluge/config.py +0 -33
  145. lm_deluge-0.0.35/src/lm_deluge/file.py +0 -158
  146. lm_deluge-0.0.35/src/lm_deluge/gemini_limits.py +0 -65
  147. lm_deluge-0.0.35/src/lm_deluge/models/__init__.py +0 -1390
  148. lm_deluge-0.0.35/src/lm_deluge/prompt.py +0 -984
  149. lm_deluge-0.0.35/src/lm_deluge/tool.py +0 -461
  150. lm_deluge-0.0.35/src/lm_deluge.egg-info/SOURCES.txt +0 -61
  151. lm_deluge-0.0.35/src/lm_deluge.egg-info/requires.txt +0 -17
  152. lm_deluge-0.0.35/tests/test_builtin_tools.py +0 -58
  153. lm_deluge-0.0.35/tests/test_native_mcp_server.py +0 -66
  154. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/LICENSE +0 -0
  155. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/setup.cfg +0 -0
  156. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/api_requests/__init__.py +0 -0
  157. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/api_requests/deprecated/bedrock.py +0 -0
  158. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/api_requests/deprecated/cohere.py +0 -0
  159. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/api_requests/deprecated/deepseek.py +0 -0
  160. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/api_requests/deprecated/mistral.py +0 -0
  161. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/api_requests/deprecated/vertex.py +0 -0
  162. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/errors.py +0 -0
  163. {lm_deluge-0.0.35/src/lm_deluge/llm_tools → lm_deluge-0.0.106/src/lm_deluge/pipelines}/__init__.py +1 -1
  164. {lm_deluge-0.0.35/src/lm_deluge/llm_tools → lm_deluge-0.0.106/src/lm_deluge/pipelines}/classify.py +0 -0
  165. {lm_deluge-0.0.35/src/lm_deluge/llm_tools → lm_deluge-0.0.106/src/lm_deluge/pipelines}/locate.py +0 -0
  166. {lm_deluge-0.0.35/src/lm_deluge/llm_tools → lm_deluge-0.0.106/src/lm_deluge/pipelines}/ocr.py +0 -0
  167. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/rerank.py +0 -0
  168. /lm_deluge-0.0.35/src/lm_deluge/agent.py → /lm_deluge-0.0.106/src/lm_deluge/skills/anthropic.py +0 -0
  169. /lm_deluge-0.0.35/src/lm_deluge/built_in_tools/anthropic/bash.py → /lm_deluge-0.0.106/src/lm_deluge/skills/compat.py +0 -0
  170. /lm_deluge-0.0.35/src/lm_deluge/built_in_tools/anthropic/computer_use.py → /lm_deluge-0.0.106/src/lm_deluge/tool/builtin/anthropic/bash.py +0 -0
  171. {lm_deluge-0.0.35/src/lm_deluge/built_in_tools → lm_deluge-0.0.106/src/lm_deluge/tool/builtin}/anthropic/editor.py +0 -0
  172. {lm_deluge-0.0.35/src/lm_deluge/built_in_tools → lm_deluge-0.0.106/src/lm_deluge/tool/builtin}/base.py +0 -0
  173. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/util/spatial.py +0 -0
  174. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge/util/xml.py +0 -0
  175. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge.egg-info/dependency_links.txt +0 -0
  176. {lm_deluge-0.0.35 → lm_deluge-0.0.106}/src/lm_deluge.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lm_deluge
3
- Version: 0.0.35
3
+ Version: 0.0.106
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
@@ -9,7 +9,6 @@ License-File: LICENSE
9
9
  Requires-Dist: python-dotenv
10
10
  Requires-Dist: json5
11
11
  Requires-Dist: PyYAML
12
- Requires-Dist: pandas
13
12
  Requires-Dist: aiohttp
14
13
  Requires-Dist: tiktoken
15
14
  Requires-Dist: xxhash
@@ -21,8 +20,24 @@ Requires-Dist: bs4
21
20
  Requires-Dist: lxml
22
21
  Requires-Dist: pdf2image
23
22
  Requires-Dist: pillow
24
- Requires-Dist: fastmcp>=2.4
25
23
  Requires-Dist: rich
24
+ Provides-Extra: aws
25
+ Requires-Dist: boto3>=1.28.0; extra == "aws"
26
+ Provides-Extra: docker
27
+ Requires-Dist: docker>=7.0.0; extra == "docker"
28
+ Provides-Extra: full-text-search
29
+ Requires-Dist: tantivy>=0.21.0; extra == "full-text-search"
30
+ Requires-Dist: lenlp>=0.1.0; extra == "full-text-search"
31
+ Provides-Extra: sandbox
32
+ Requires-Dist: modal>=0.64.0; extra == "sandbox"
33
+ Requires-Dist: daytona-sdk>=0.1.4; extra == "sandbox"
34
+ Requires-Dist: docker>=7.0.0; extra == "sandbox"
35
+ Provides-Extra: server
36
+ Requires-Dist: fastapi>=0.100.0; extra == "server"
37
+ Requires-Dist: uvicorn>=0.20.0; extra == "server"
38
+ Provides-Extra: dev
39
+ Requires-Dist: ty; extra == "dev"
40
+ Requires-Dist: pre-commit; extra == "dev"
26
41
  Dynamic: license-file
27
42
 
28
43
  # lm-deluge
@@ -35,9 +50,9 @@ Dynamic: license-file
35
50
  - **Spray across models/providers** – Configure a client with multiple models from any provider(s), and sampling weights. The client samples a model for each request.
36
51
  - **Tool Use** – Unified API for defining tools for all providers, and creating tools automatically from python functions.
37
52
  - **MCP Support** – Instantiate a `Tool` from a local or remote MCP server so that any LLM can use it, whether or not that provider natively supports MCP.
38
- - **Computer Use** – We support Claude Computer Use via the computer_use argument to process_prompts_sync/async. It works with Anthropic's API; Bedrock's API is broken right now and rejects the tool definitions, but in principle this will work there too when Bedrock gets their sh*t together.
39
- - **Caching** – Save completions in a local or distributed cache to avoid repeated LLM calls to process the same input.
40
- - **Convenient message constructor** – No more looking up how to build an Anthropic messages list with images. Our `Conversation` and `Message` classes work great with our client or with the `openai` and `anthropic` packages.
53
+ - **Computer Use** – We support computer use for all major providers, and have pre-fabricated tools to integrate with Kernel, TryCUA, and more.
54
+ - **Local & Remote Caching** – Use Anthropic caching more easily with common patterns (system-only, tools-only, last N messages, etc.) Use client-side caching to save completions to avoid repeated LLM calls to process the same input.
55
+ - **Convenient message constructor** – No more looking up how to build an Anthropic messages list with images. Our `Conversation` and `Message` classes work great with our `LLMClient` or with the `openai` and `anthropic` packages.
41
56
  - **Sync and async APIs** – Use the client from sync or async code.
42
57
 
43
58
  **STREAMING IS NOT IN SCOPE.** There are plenty of packages that let you stream chat completions across providers. The sole purpose of this package is to do very fast batch inference using APIs. Sorry!
@@ -50,7 +65,7 @@ Dynamic: license-file
50
65
  pip install lm-deluge
51
66
  ```
52
67
 
53
- The package relies on environment variables for API keys. Typical variables include `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `COHERE_API_KEY`, `META_API_KEY`, and `GOOGLE_API_KEY`. `LLMClient` will automatically load the `.env` file when imported; we recommend using that to set the environment variables. For Bedrock, you'll need to set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.
68
+ The package relies on environment variables for API keys. Typical variables include `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `COHERE_API_KEY`, `META_API_KEY`, and `GEMINI_API_KEY`. `LLMClient` will automatically load the `.env` file when imported; we recommend using that to set the environment variables. For Bedrock, you'll need to set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.
54
69
 
55
70
  ## Quickstart
56
71
 
@@ -59,9 +74,9 @@ The package relies on environment variables for API keys. Typical variables incl
59
74
  ```python
60
75
  from lm_deluge import LLMClient
61
76
 
62
- client = LLMClient("gpt-4o-mini")
77
+ client = LLMClient("gpt-4.1-mini")
63
78
  resps = client.process_prompts_sync(["Hello, world!"])
64
- print(resp[0].completion)
79
+ print(resps[0].completion)
65
80
  ```
66
81
 
67
82
  ## Spraying Across Models
@@ -72,13 +87,13 @@ To distribute your requests across models, just provide a list of more than one
72
87
  from lm_deluge import LLMClient
73
88
 
74
89
  client = LLMClient(
75
- ["gpt-4o-mini", "claude-3-haiku"],
90
+ ["gpt-4.1-mini", "claude-4.5-haiku"],
76
91
  max_requests_per_minute=10_000
77
92
  )
78
93
  resps = client.process_prompts_sync(
79
94
  ["Hello, ChatGPT!", "Hello, Claude!"]
80
95
  )
81
- print(resp[0].completion)
96
+ print(resps[0].completion)
82
97
  ```
83
98
 
84
99
  ## Configuration
@@ -111,14 +126,17 @@ await client.process_prompts_async(
111
126
 
112
127
  ### Queueing individual prompts
113
128
 
114
- You can queue prompts one at a time and track progress explicitly:
129
+ You can queue prompts one at a time and track progress explicitly. Iterate over
130
+ results as they finish with `as_completed` (or gather them all at once with
131
+ `wait_for_all`):
115
132
 
116
133
  ```python
117
134
  client = LLMClient("gpt-4.1-mini", progress="tqdm")
118
135
  client.open()
119
- task_id = client.start_nowait("hello there")
136
+ client.start_nowait("hello there")
120
137
  # ... queue more tasks ...
121
- results = await client.wait_for_all()
138
+ async for task_id, result in client.as_completed():
139
+ print(task_id, result.completion)
122
140
  client.close()
123
141
  ```
124
142
 
@@ -129,7 +147,7 @@ Constructing conversations to pass to models is notoriously annoying. Each provi
129
147
  ```python
130
148
  from lm_deluge import Message, Conversation
131
149
 
132
- prompt = Conversation.system("You are a helpful assistant.").add(
150
+ prompt = Conversation().system("You are a helpful assistant.").add(
133
151
  Message.user("What's in this image?").add_image("tests/image.jpg")
134
152
  )
135
153
 
@@ -150,7 +168,7 @@ from lm_deluge import LLMClient, Conversation
150
168
 
151
169
  # Simple file upload
152
170
  client = LLMClient("gpt-4.1-mini")
153
- conversation = Conversation.user(
171
+ conversation = Conversation().user(
154
172
  "Please summarize this document",
155
173
  file="path/to/document.pdf"
156
174
  )
@@ -159,7 +177,7 @@ resps = client.process_prompts_sync([conversation])
159
177
  # You can also create File objects for more control
160
178
  from lm_deluge import File
161
179
  file = File("path/to/report.pdf", filename="Q4_Report.pdf")
162
- conversation = Conversation.user("Analyze this financial report")
180
+ conversation = Conversation().user("Analyze this financial report")
163
181
  conversation.messages[0].parts.append(file)
164
182
  ```
165
183
 
@@ -176,7 +194,7 @@ def get_weather(city: str) -> str:
176
194
  return f"The weather in {city} is sunny and 72°F"
177
195
 
178
196
  tool = Tool.from_function(get_weather)
179
- client = LLMClient("claude-3-haiku")
197
+ client = LLMClient("claude-4.5-haiku")
180
198
  resps = client.process_prompts_sync(
181
199
  ["What's the weather in Paris?"],
182
200
  tools=[tool]
@@ -229,7 +247,7 @@ for tool_call in resps[0].tool_calls:
229
247
  import asyncio
230
248
 
231
249
  async def main():
232
- conv = Conversation.user("List the files in the current directory")
250
+ conv = Conversation().user("List the files in the current directory")
233
251
  conv, resp = await client.run_agent_loop(conv, tools=tools)
234
252
  print(resp.content.completion)
235
253
 
@@ -245,12 +263,12 @@ from lm_deluge import LLMClient, Conversation, Message
245
263
 
246
264
  # Create a conversation with system message
247
265
  conv = (
248
- Conversation.system("You are an expert Python developer with deep knowledge of async programming.")
266
+ Conversation().system("You are an expert Python developer with deep knowledge of async programming.")
249
267
  .add(Message.user("How do I use asyncio.gather?"))
250
268
  )
251
269
 
252
270
  # Use prompt caching to cache system message and tools
253
- client = LLMClient("claude-3-5-sonnet")
271
+ client = LLMClient("claude-4.5-sonnet")
254
272
  resps = client.process_prompts_sync(
255
273
  [conv],
256
274
  cache="system_and_tools" # Cache system message and any tools
@@ -291,7 +309,7 @@ We support structured outputs via `json_mode` parameter provided to `SamplingPar
291
309
 
292
310
  ## Built‑in tools
293
311
 
294
- The `lm_deluge.llm_tools` package exposes a few helper functions:
312
+ The `lm_deluge.pipelines` module exposes a few helper functions that combine LLMClient with prompt and output parsing to accomplish tasks:
295
313
 
296
314
  - `extract` – structure text or images into a Pydantic model based on a schema.
297
315
  - `translate` – translate a list of strings to English.
@@ -8,9 +8,9 @@
8
8
  - **Spray across models/providers** – Configure a client with multiple models from any provider(s), and sampling weights. The client samples a model for each request.
9
9
  - **Tool Use** – Unified API for defining tools for all providers, and creating tools automatically from python functions.
10
10
  - **MCP Support** – Instantiate a `Tool` from a local or remote MCP server so that any LLM can use it, whether or not that provider natively supports MCP.
11
- - **Computer Use** – We support Claude Computer Use via the computer_use argument to process_prompts_sync/async. It works with Anthropic's API; Bedrock's API is broken right now and rejects the tool definitions, but in principle this will work there too when Bedrock gets their sh*t together.
12
- - **Caching** – Save completions in a local or distributed cache to avoid repeated LLM calls to process the same input.
13
- - **Convenient message constructor** – No more looking up how to build an Anthropic messages list with images. Our `Conversation` and `Message` classes work great with our client or with the `openai` and `anthropic` packages.
11
+ - **Computer Use** – We support computer use for all major providers, and have pre-fabricated tools to integrate with Kernel, TryCUA, and more.
12
+ - **Local & Remote Caching** – Use Anthropic caching more easily with common patterns (system-only, tools-only, last N messages, etc.) Use client-side caching to save completions to avoid repeated LLM calls to process the same input.
13
+ - **Convenient message constructor** – No more looking up how to build an Anthropic messages list with images. Our `Conversation` and `Message` classes work great with our `LLMClient` or with the `openai` and `anthropic` packages.
14
14
  - **Sync and async APIs** – Use the client from sync or async code.
15
15
 
16
16
  **STREAMING IS NOT IN SCOPE.** There are plenty of packages that let you stream chat completions across providers. The sole purpose of this package is to do very fast batch inference using APIs. Sorry!
@@ -23,7 +23,7 @@
23
23
  pip install lm-deluge
24
24
  ```
25
25
 
26
- The package relies on environment variables for API keys. Typical variables include `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `COHERE_API_KEY`, `META_API_KEY`, and `GOOGLE_API_KEY`. `LLMClient` will automatically load the `.env` file when imported; we recommend using that to set the environment variables. For Bedrock, you'll need to set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.
26
+ The package relies on environment variables for API keys. Typical variables include `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `COHERE_API_KEY`, `META_API_KEY`, and `GEMINI_API_KEY`. `LLMClient` will automatically load the `.env` file when imported; we recommend using that to set the environment variables. For Bedrock, you'll need to set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.
27
27
 
28
28
  ## Quickstart
29
29
 
@@ -32,9 +32,9 @@ The package relies on environment variables for API keys. Typical variables incl
32
32
  ```python
33
33
  from lm_deluge import LLMClient
34
34
 
35
- client = LLMClient("gpt-4o-mini")
35
+ client = LLMClient("gpt-4.1-mini")
36
36
  resps = client.process_prompts_sync(["Hello, world!"])
37
- print(resp[0].completion)
37
+ print(resps[0].completion)
38
38
  ```
39
39
 
40
40
  ## Spraying Across Models
@@ -45,13 +45,13 @@ To distribute your requests across models, just provide a list of more than one
45
45
  from lm_deluge import LLMClient
46
46
 
47
47
  client = LLMClient(
48
- ["gpt-4o-mini", "claude-3-haiku"],
48
+ ["gpt-4.1-mini", "claude-4.5-haiku"],
49
49
  max_requests_per_minute=10_000
50
50
  )
51
51
  resps = client.process_prompts_sync(
52
52
  ["Hello, ChatGPT!", "Hello, Claude!"]
53
53
  )
54
- print(resp[0].completion)
54
+ print(resps[0].completion)
55
55
  ```
56
56
 
57
57
  ## Configuration
@@ -84,14 +84,17 @@ await client.process_prompts_async(
84
84
 
85
85
  ### Queueing individual prompts
86
86
 
87
- You can queue prompts one at a time and track progress explicitly:
87
+ You can queue prompts one at a time and track progress explicitly. Iterate over
88
+ results as they finish with `as_completed` (or gather them all at once with
89
+ `wait_for_all`):
88
90
 
89
91
  ```python
90
92
  client = LLMClient("gpt-4.1-mini", progress="tqdm")
91
93
  client.open()
92
- task_id = client.start_nowait("hello there")
94
+ client.start_nowait("hello there")
93
95
  # ... queue more tasks ...
94
- results = await client.wait_for_all()
96
+ async for task_id, result in client.as_completed():
97
+ print(task_id, result.completion)
95
98
  client.close()
96
99
  ```
97
100
 
@@ -102,7 +105,7 @@ Constructing conversations to pass to models is notoriously annoying. Each provi
102
105
  ```python
103
106
  from lm_deluge import Message, Conversation
104
107
 
105
- prompt = Conversation.system("You are a helpful assistant.").add(
108
+ prompt = Conversation().system("You are a helpful assistant.").add(
106
109
  Message.user("What's in this image?").add_image("tests/image.jpg")
107
110
  )
108
111
 
@@ -123,7 +126,7 @@ from lm_deluge import LLMClient, Conversation
123
126
 
124
127
  # Simple file upload
125
128
  client = LLMClient("gpt-4.1-mini")
126
- conversation = Conversation.user(
129
+ conversation = Conversation().user(
127
130
  "Please summarize this document",
128
131
  file="path/to/document.pdf"
129
132
  )
@@ -132,7 +135,7 @@ resps = client.process_prompts_sync([conversation])
132
135
  # You can also create File objects for more control
133
136
  from lm_deluge import File
134
137
  file = File("path/to/report.pdf", filename="Q4_Report.pdf")
135
- conversation = Conversation.user("Analyze this financial report")
138
+ conversation = Conversation().user("Analyze this financial report")
136
139
  conversation.messages[0].parts.append(file)
137
140
  ```
138
141
 
@@ -149,7 +152,7 @@ def get_weather(city: str) -> str:
149
152
  return f"The weather in {city} is sunny and 72°F"
150
153
 
151
154
  tool = Tool.from_function(get_weather)
152
- client = LLMClient("claude-3-haiku")
155
+ client = LLMClient("claude-4.5-haiku")
153
156
  resps = client.process_prompts_sync(
154
157
  ["What's the weather in Paris?"],
155
158
  tools=[tool]
@@ -202,7 +205,7 @@ for tool_call in resps[0].tool_calls:
202
205
  import asyncio
203
206
 
204
207
  async def main():
205
- conv = Conversation.user("List the files in the current directory")
208
+ conv = Conversation().user("List the files in the current directory")
206
209
  conv, resp = await client.run_agent_loop(conv, tools=tools)
207
210
  print(resp.content.completion)
208
211
 
@@ -218,12 +221,12 @@ from lm_deluge import LLMClient, Conversation, Message
218
221
 
219
222
  # Create a conversation with system message
220
223
  conv = (
221
- Conversation.system("You are an expert Python developer with deep knowledge of async programming.")
224
+ Conversation().system("You are an expert Python developer with deep knowledge of async programming.")
222
225
  .add(Message.user("How do I use asyncio.gather?"))
223
226
  )
224
227
 
225
228
  # Use prompt caching to cache system message and tools
226
- client = LLMClient("claude-3-5-sonnet")
229
+ client = LLMClient("claude-4.5-sonnet")
227
230
  resps = client.process_prompts_sync(
228
231
  [conv],
229
232
  cache="system_and_tools" # Cache system message and any tools
@@ -264,7 +267,7 @@ We support structured outputs via `json_mode` parameter provided to `SamplingPar
264
267
 
265
268
  ## Built‑in tools
266
269
 
267
- The `lm_deluge.llm_tools` package exposes a few helper functions:
270
+ The `lm_deluge.pipelines` module exposes a few helper functions that combine LLMClient with prompt and output parsing to accomplish tasks:
268
271
 
269
272
  - `extract` – structure text or images into a Pydantic model based on a schema.
270
273
  - `translate` – translate a list of strings to English.
@@ -3,7 +3,7 @@ requires = ["setuptools", "wheel"]
3
3
 
4
4
  [project]
5
5
  name = "lm_deluge"
6
- version = "0.0.35"
6
+ version = "0.0.106"
7
7
  authors = [{ name = "Benjamin Anderson", email = "ben@trytaylor.ai" }]
8
8
  description = "Python utility for using LLM API models."
9
9
  readme = "README.md"
@@ -15,7 +15,6 @@ dependencies = [
15
15
  "python-dotenv",
16
16
  "json5",
17
17
  "PyYAML",
18
- "pandas",
19
18
  "aiohttp",
20
19
  "tiktoken",
21
20
  "xxhash",
@@ -27,6 +26,20 @@ dependencies = [
27
26
  "lxml",
28
27
  "pdf2image",
29
28
  "pillow",
30
- "fastmcp>=2.4",
31
29
  "rich"
32
30
  ]
31
+
32
+ [project.optional-dependencies]
33
+ aws = ["boto3>=1.28.0"]
34
+ docker = ["docker>=7.0.0"]
35
+ full_text_search = ["tantivy>=0.21.0", "lenlp>=0.1.0"]
36
+ sandbox = ["modal>=0.64.0", "daytona-sdk>=0.1.4", "docker>=7.0.0"]
37
+ server = ["fastapi>=0.100.0", "uvicorn>=0.20.0"]
38
+ dev = ["ty", "pre-commit"]
39
+
40
+ [project.scripts]
41
+ deluge = "lm_deluge.cli:main"
42
+ deluge-server = "lm_deluge.server.__main__:main"
43
+
44
+ [tool.setuptools.package-data]
45
+ lm_deluge = ["skill/*.md"]
@@ -0,0 +1,19 @@
1
+ from .client import AgentLoopCallback, APIResponse, LLMClient, SamplingParams
2
+ from .prompt import Conversation, Message, File
3
+ from .tool import Tool, MCPServer, Skill, execute_tool_calls
4
+
5
+ # dotenv.load_dotenv() - don't do this, fucks with other packages
6
+
7
+ __all__ = [
8
+ "LLMClient",
9
+ "SamplingParams",
10
+ "APIResponse",
11
+ "AgentLoopCallback",
12
+ "Conversation",
13
+ "Message",
14
+ "Tool",
15
+ "MCPServer",
16
+ "Skill",
17
+ "File",
18
+ "execute_tool_calls",
19
+ ]