llm.rb 12.1.0 → 12.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4c7d2a7e0fd6a5b05cfdaaf2702f94f9a15d3e277739559f5cb676768fe6a9c
4
- data.tar.gz: ad3081a38e1096459791ec6cffd1ae0a8550f5d4df2c6c95fd8842b78a0024f4
3
+ metadata.gz: 20d8c7c9c3d9d270f371781b28e7537a5c6921cff138cfc895bdbf0042003d07
4
+ data.tar.gz: 11b1abd397f1b13afadf4fe56e9670037a7c6ee586e945fd6a909505a4114122
5
5
  SHA512:
6
- metadata.gz: 0e5a58f5b22d07b05d981423414de270b1ae760c7920452e736a55709c6c1eeee941407de8a8667365ee83943deeb0554d05bec5425b7132fe907dc62f349ffa
7
- data.tar.gz: fabedc3aad36ba5cbaf7b126c55ddc3cbb428aadb3b2887a40e429daf35c65ff81a4d8c903583dea27c051d89f076d9d3446736e948954a6cef26065aebfa624
6
+ metadata.gz: d99ad697a3b3d5d13a0804ab3cea569ffbf5dc88d853aabe7461c4ae59020519e140aa0de1c2b26336b03998212410449da238ea8df5f6a190012f026093464c
7
+ data.tar.gz: dd6314a5e1e7ba3899d1ab13ba4f076508481bc2e24d3502bfa5cc4ebfb66a2203772ffc9acb4987b741eea413997493b8f85a2a7a841cf768e80d9b412886a8
data/CHANGELOG.md CHANGED
@@ -15,8 +15,89 @@
15
15
 
16
16
  ## What's next
17
17
 
18
+ Changes since `v12.2.0`.
19
+
20
+ ## v12.2.0
21
+
18
22
  Changes since `v12.1.0`.
19
23
 
24
+ This release adds Mistral as a new provider with chat completions, streaming, tool calls,
25
+ structured outputs, file/image attachments, and embeddings support. It introduces
26
+ the `trace:` option to `LLM::Agent#repl` for keeping the tracer active during
27
+ interactive sessions.
28
+
29
+ Several fixes land for the Google provider (generationConfig parameter leakage),
30
+ `LLM::Context#tracer=` (always assigning nil), `LLM::Provider#with_tracer(nil)`
31
+ (nil fallback), and `LLM::Context#repair!` (dropping Struct returns).
32
+
33
+ The default HTTP timeout has been increased from 60s to 180s to better accommodate
34
+ reasoning models and large structured outputs, and the Anthropic default model has
35
+ been updated to `claude-opus-4-8`. Model metadata has been refreshed across
36
+ Anthropic, AWS Bedrock, DeepInfra, Google, and xAI, with Mistral model data added
37
+ to the registry.
38
+
39
+ ### Add
40
+
41
+ * **Add `trace:` option to `LLM::Agent#repl`** <br>
42
+ `LLM::Agent#repl` now accepts a `trace:` keyword argument. By default
43
+ the tracer is disabled for the duration of the repl session to prevent
44
+ curses UI interference from output written to `$stdout` or `$stderr`.
45
+ Set `trace: true` to keep the tracer active during the session, which
46
+ is useful when the tracer writes to a file rather than the terminal.
47
+
48
+ * **Add a new provider: LLM::Mistral** <br>
49
+ [Mistral](https://mistral.ai) is now supported through its
50
+ OpenAI-compatible API. The provider supports chat completions,
51
+ streaming, tool calls, structured output (schema), file/image
52
+ attachments, and embeddings. Use `LLM.mistral(...)` to create a
53
+ provider instance.
54
+
55
+ * **Add `LLM.mistral(...)` convenience method** <br>
56
+ A new top-level accessor (`LLM.mistral`) returns an `LLM::Mistral`
57
+ provider instance, matching the pattern used by other providers.
58
+
59
+ ### Fix
60
+
61
+ * **Fix Google `generationConfig` parameter leakage** <br>
62
+ Fix a bug in the Google provider where non-generation parameters
63
+ (`role`, `model`, `messages`, `stream`) were leaking into the
64
+ `generationConfig` object alongside legitimate generation config
65
+ parameters such as `temperature`. Non-config parameters are now
66
+ filtered out before constructing `generationConfig`.
67
+
68
+ * **Fix `LLM::Context#tracer=` always assigning `nil`** <br>
69
+ The `LLM::Context#tracer=` setter had a bug where it always assigned
70
+ `nil` regardless of the tracer value passed. It now correctly assigns
71
+ the given tracer or falls back to `LLM::Tracer::Null`.
72
+
73
+ * **Fix `LLM::Provider#with_tracer(nil)` fallback** <br>
74
+ `LLM::Provider#with_tracer(nil)` now falls back to
75
+ `LLM::Tracer::Null` instead of setting a `nil` tracer directly.
76
+
77
+ * **Fix `LLM::Context#repair!` dropping `Struct` returns** <br>
78
+ `LLM::Context#repair!` used `[*prompt]` to wrap the prompt before
79
+ grepping for return objects. Since `LLM::Function::Return` is a
80
+ `Struct`, the splat operator expanded it into its member values
81
+ instead of wrapping it, causing the grep to silently drop returns.
82
+ The fix wraps both sources in an array before flattening.
83
+
84
+ ### Change
85
+
86
+ * **Increase default provider timeout from 60s to 180s** <br>
87
+ The default HTTP timeout for all providers has been increased from
88
+ 60 to 180 seconds to better accommodate long-running requests such
89
+ as reasoning models and large structured outputs.
90
+
91
+ * **Change Anthropic default model to `claude-opus-4-8`** <br>
92
+ The default Anthropic chat model has been updated from
93
+ `claude-sonnet-4-20250514` to `claude-opus-4-8`, reflecting the
94
+ latest model release from Anthropic.
95
+
96
+ * **Refresh model metadata** <br>
97
+ Update model listings, pricing, and capabilities for Anthropic,
98
+ AWS Bedrock, DeepInfra, Google, and xAI. Add Mistral model data
99
+ to the registry.
100
+
20
101
  ## v12.1.0
21
102
 
22
103
  Changes since `v12.0.0`.
data/README.md CHANGED
@@ -23,7 +23,7 @@ that are opt-in.
23
23
  ## Features
24
24
 
25
25
  The runtime supports OpenAI, OpenAI-compatible endpoints, Anthropic, Google
26
- Gemini, DeepSeek, DeepInfra, xAI, Z.ai, AWS Bedrock, Ollama, and llama.cpp.
26
+ Gemini, Mistral, DeepSeek, DeepInfra, xAI, Z.ai, AWS Bedrock, Ollama, and llama.cpp.
27
27
  It has first-class support for streaming, tool calls, MCP
28
28
  and A2A, embeddings, vector stores and the RAG pattern.
29
29
 
@@ -265,28 +265,37 @@ agent.talk "perform research"
265
265
  <summary>What providers does llm.rb support?</summary>
266
266
  <br>
267
267
  <p>
268
- China-based
269
268
 
270
- * DeepSeek
271
- * zAI
269
+ **Cloud**
272
270
 
273
- US-based
271
+ The following cloud-based providers are available to choose from. <br>
272
+ In no particular order:
274
273
 
275
- * OpenAI
276
- * Google (Gemini)
277
- * xAI
278
- * AWS bedrock
279
- * DeepInfra
280
- * Anthropic
274
+ 🇺🇸 OpenAI <br>
275
+ 🇺🇸 DeepInfra <br>
276
+ 🇺🇸 xAI <br>
277
+ 🇺🇸 Google (Gemini) <br>
278
+ 🇺🇸 AWS bedrock <br>
279
+ 🇺🇸 Anthropic <br>
280
+ 🇨🇳 DeepSeek <br>
281
+ 🇨🇳 zAI <br>
282
+ 🇪🇺 Mistral <br>
281
283
 
282
- Openweights
284
+ **Weights**
283
285
 
284
- * DeepSeek
285
- * zAI
286
- * DeepInfra
287
- * AWS bedrock
286
+ The following providers provide access to open-weight models. <br>
287
+ In no particular order:
288
288
 
289
- Host your own
289
+ 🇺🇸 DeepInfra <br>
290
+ 🇺🇸 AWS bedrock <br>
291
+ 🇨🇳 DeepSeek <br>
292
+ 🇨🇳 zAI <br>
293
+ 🇪🇺 Mistral <br>
294
+
295
+ **Local**
296
+
297
+ The following providers can be run locally on your own hardware. <br>
298
+ In no particular order:
290
299
 
291
300
  * Ollama
292
301
  * Llamacpp
data/data/anthropic.json CHANGED
@@ -31,7 +31,7 @@
31
31
  "tool_call": true,
32
32
  "structured_output": true,
33
33
  "temperature": true,
34
- "knowledge": "2025-03-31",
34
+ "knowledge": "2025-05",
35
35
  "release_date": "2025-11-24",
36
36
  "last_updated": "2025-11-24",
37
37
  "modalities": {
@@ -321,7 +321,7 @@
321
321
  "tool_call": true,
322
322
  "structured_output": true,
323
323
  "temperature": true,
324
- "knowledge": "2025-03-31",
324
+ "knowledge": "2025-05",
325
325
  "release_date": "2025-11-24",
326
326
  "last_updated": "2025-11-01",
327
327
  "modalities": {
@@ -368,6 +368,7 @@
368
368
  "tool_call": true,
369
369
  "structured_output": true,
370
370
  "temperature": false,
371
+ "knowledge": "2026-01",
371
372
  "release_date": "2026-05-28",
372
373
  "last_updated": "2026-05-28",
373
374
  "modalities": {
data/data/bedrock.json CHANGED
@@ -92,6 +92,47 @@
92
92
  "cache_write": 3.75
93
93
  }
94
94
  },
95
+ "jp.anthropic.claude-haiku-4-5-20251001-v1:0": {
96
+ "id": "jp.anthropic.claude-haiku-4-5-20251001-v1:0",
97
+ "name": "Claude Haiku 4.5 (JP)",
98
+ "description": "Fast Claude model for responsive assistance, classification, and lightweight agents",
99
+ "family": "claude-haiku",
100
+ "attachment": true,
101
+ "reasoning": true,
102
+ "reasoning_options": [
103
+ {
104
+ "type": "budget_tokens",
105
+ "min": 1024
106
+ }
107
+ ],
108
+ "tool_call": true,
109
+ "structured_output": true,
110
+ "temperature": true,
111
+ "knowledge": "2025-02-28",
112
+ "release_date": "2025-10-15",
113
+ "last_updated": "2025-10-15",
114
+ "modalities": {
115
+ "input": [
116
+ "text",
117
+ "image",
118
+ "pdf"
119
+ ],
120
+ "output": [
121
+ "text"
122
+ ]
123
+ },
124
+ "open_weights": false,
125
+ "limit": {
126
+ "context": 200000,
127
+ "output": 64000
128
+ },
129
+ "cost": {
130
+ "input": 1,
131
+ "output": 5,
132
+ "cache_read": 0.1,
133
+ "cache_write": 1.25
134
+ }
135
+ },
95
136
  "us.meta.llama4-scout-17b-instruct-v1:0": {
96
137
  "id": "us.meta.llama4-scout-17b-instruct-v1:0",
97
138
  "name": "Llama 4 Scout 17B Instruct (US)",
@@ -1349,6 +1390,7 @@
1349
1390
  ],
1350
1391
  "tool_call": true,
1351
1392
  "temperature": false,
1393
+ "knowledge": "2026-01",
1352
1394
  "release_date": "2026-05-28",
1353
1395
  "last_updated": "2026-05-28",
1354
1396
  "modalities": {
@@ -2328,6 +2370,7 @@
2328
2370
  ],
2329
2371
  "tool_call": true,
2330
2372
  "temperature": false,
2373
+ "knowledge": "2026-01",
2331
2374
  "release_date": "2026-05-28",
2332
2375
  "last_updated": "2026-05-28",
2333
2376
  "modalities": {
@@ -2835,6 +2878,7 @@
2835
2878
  ],
2836
2879
  "tool_call": true,
2837
2880
  "temperature": false,
2881
+ "knowledge": "2026-01",
2838
2882
  "release_date": "2026-05-28",
2839
2883
  "last_updated": "2026-05-28",
2840
2884
  "modalities": {
@@ -3136,6 +3180,7 @@
3136
3180
  ],
3137
3181
  "tool_call": true,
3138
3182
  "temperature": false,
3183
+ "knowledge": "2026-01",
3139
3184
  "release_date": "2026-05-28",
3140
3185
  "last_updated": "2026-05-28",
3141
3186
  "modalities": {
@@ -3181,6 +3226,7 @@
3181
3226
  ],
3182
3227
  "tool_call": true,
3183
3228
  "temperature": false,
3229
+ "knowledge": "2026-01",
3184
3230
  "release_date": "2026-05-28",
3185
3231
  "last_updated": "2026-05-28",
3186
3232
  "modalities": {
@@ -3518,6 +3564,7 @@
3518
3564
  ],
3519
3565
  "tool_call": true,
3520
3566
  "temperature": false,
3567
+ "knowledge": "2026-01",
3521
3568
  "release_date": "2026-05-28",
3522
3569
  "last_updated": "2026-05-28",
3523
3570
  "modalities": {
data/data/deepinfra.json CHANGED
@@ -557,7 +557,7 @@
557
557
  },
558
558
  "open_weights": true,
559
559
  "limit": {
560
- "context": 16384,
560
+ "context": 262144,
561
561
  "output": 65536
562
562
  },
563
563
  "cost": {
@@ -767,7 +767,7 @@
767
767
  "output": 16384
768
768
  },
769
769
  "cost": {
770
- "input": 0.039,
770
+ "input": 0.037,
771
771
  "output": 0.17
772
772
  }
773
773
  },
data/data/google.json CHANGED
@@ -562,6 +562,38 @@
562
562
  "input_audio": 0.3
563
563
  }
564
564
  },
565
+ "gemini-omni-flash-preview": {
566
+ "id": "gemini-omni-flash-preview",
567
+ "name": "Gemini Omni Flash Preview",
568
+ "description": "Video generation and editing model for fast, conversational text- and image-to-video workflows",
569
+ "family": "gemini",
570
+ "attachment": true,
571
+ "reasoning": true,
572
+ "reasoning_options": [],
573
+ "tool_call": false,
574
+ "temperature": true,
575
+ "release_date": "2026-06-30",
576
+ "last_updated": "2026-06-30",
577
+ "modalities": {
578
+ "input": [
579
+ "text",
580
+ "image",
581
+ "video"
582
+ ],
583
+ "output": [
584
+ "video"
585
+ ]
586
+ },
587
+ "open_weights": false,
588
+ "limit": {
589
+ "context": 131072,
590
+ "output": 65536
591
+ },
592
+ "cost": {
593
+ "input": 1.5,
594
+ "output": 17.5
595
+ }
596
+ },
565
597
  "gemini-3.1-flash-image-preview": {
566
598
  "id": "gemini-3.1-flash-image-preview",
567
599
  "name": "Nano Banana 2",