llm.rb 12.4.0 → 12.5.1
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 +4 -4
- data/CHANGELOG.md +255 -0
- data/README.md +39 -9
- data/data/anthropic.json +249 -249
- data/data/bedrock.json +1964 -1964
- data/data/deepinfra.json +589 -589
- data/data/deepseek.json +31 -31
- data/data/google.json +332 -329
- data/data/mistral.json +381 -381
- data/data/openai.json +1133 -1133
- data/data/xai.json +138 -138
- data/data/zai.json +165 -165
- data/lib/llm/agent.rb +3 -1
- data/lib/llm/buffer.rb +15 -0
- data/lib/llm/context.rb +4 -5
- data/lib/llm/function.rb +2 -35
- data/lib/llm/message.rb +10 -2
- data/lib/llm/provider.rb +11 -1
- data/lib/llm/providers/anthropic/stream_parser.rb +3 -12
- data/lib/llm/providers/anthropic.rb +11 -0
- data/lib/llm/providers/bedrock/stream_parser.rb +4 -13
- data/lib/llm/providers/google/stream_parser.rb +3 -12
- data/lib/llm/providers/google.rb +7 -0
- data/lib/llm/providers/mistral.rb +11 -0
- data/lib/llm/providers/ollama/stream_parser.rb +4 -4
- data/lib/llm/providers/ollama.rb +11 -0
- data/lib/llm/providers/openai/responses/stream_parser.rb +4 -14
- data/lib/llm/providers/openai/responses.rb +10 -0
- data/lib/llm/providers/openai/stream_parser.rb +5 -15
- data/lib/llm/providers/openai.rb +11 -0
- data/lib/llm/repl/command.rb +121 -5
- data/lib/llm/repl/commands/exit.rb +4 -0
- data/lib/llm/repl/commands/help.rb +24 -0
- data/lib/llm/repl/input.rb +4 -1
- data/lib/llm/repl/stream.rb +3 -8
- data/lib/llm/repl.rb +58 -12
- data/lib/llm/stream.rb +2 -7
- data/lib/llm/version.rb +1 -1
- data/resources/deepdive.md +1 -1
- metadata +2 -1
data/data/xai.json
CHANGED
|
@@ -7,25 +7,71 @@
|
|
|
7
7
|
"name": "xAI",
|
|
8
8
|
"doc": "https://docs.x.ai/docs/models",
|
|
9
9
|
"models": {
|
|
10
|
-
"grok-
|
|
11
|
-
"id": "grok-
|
|
12
|
-
"name": "Grok
|
|
13
|
-
"description": "
|
|
10
|
+
"grok-imagine-video": {
|
|
11
|
+
"id": "grok-imagine-video",
|
|
12
|
+
"name": "Grok Imagine Video",
|
|
13
|
+
"description": "Image model for prompt-driven generation, editing, and visual design workflows",
|
|
14
14
|
"family": "grok",
|
|
15
15
|
"attachment": true,
|
|
16
|
-
"reasoning":
|
|
17
|
-
"reasoning_options": [
|
|
18
|
-
{
|
|
19
|
-
"type": "effort",
|
|
20
|
-
"values": [
|
|
21
|
-
"low",
|
|
22
|
-
"medium",
|
|
23
|
-
"high",
|
|
24
|
-
"xhigh"
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
],
|
|
16
|
+
"reasoning": false,
|
|
28
17
|
"tool_call": false,
|
|
18
|
+
"temperature": false,
|
|
19
|
+
"release_date": "2026-01-28",
|
|
20
|
+
"last_updated": "2026-01-28",
|
|
21
|
+
"modalities": {
|
|
22
|
+
"input": [
|
|
23
|
+
"text",
|
|
24
|
+
"image",
|
|
25
|
+
"video",
|
|
26
|
+
"pdf"
|
|
27
|
+
],
|
|
28
|
+
"output": [
|
|
29
|
+
"video"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"open_weights": false,
|
|
33
|
+
"limit": {
|
|
34
|
+
"context": 1024,
|
|
35
|
+
"output": 0
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"grok-imagine-image-quality": {
|
|
39
|
+
"id": "grok-imagine-image-quality",
|
|
40
|
+
"name": "Grok Imagine Image Quality",
|
|
41
|
+
"description": "Image model for prompt-driven generation, editing, and visual design workflows",
|
|
42
|
+
"family": "grok",
|
|
43
|
+
"attachment": true,
|
|
44
|
+
"reasoning": false,
|
|
45
|
+
"tool_call": false,
|
|
46
|
+
"temperature": false,
|
|
47
|
+
"release_date": "2026-04-03",
|
|
48
|
+
"last_updated": "2026-04-03",
|
|
49
|
+
"modalities": {
|
|
50
|
+
"input": [
|
|
51
|
+
"text",
|
|
52
|
+
"image",
|
|
53
|
+
"pdf"
|
|
54
|
+
],
|
|
55
|
+
"output": [
|
|
56
|
+
"image",
|
|
57
|
+
"pdf"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"open_weights": false,
|
|
61
|
+
"limit": {
|
|
62
|
+
"context": 8000,
|
|
63
|
+
"output": 0
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"grok-4.20-0309-reasoning": {
|
|
67
|
+
"id": "grok-4.20-0309-reasoning",
|
|
68
|
+
"name": "Grok 4.20 (Reasoning)",
|
|
69
|
+
"description": "Reasoning Grok for document-heavy analysis and long-horizon tool use",
|
|
70
|
+
"family": "grok",
|
|
71
|
+
"attachment": true,
|
|
72
|
+
"reasoning": true,
|
|
73
|
+
"reasoning_options": [],
|
|
74
|
+
"tool_call": true,
|
|
29
75
|
"structured_output": true,
|
|
30
76
|
"temperature": true,
|
|
31
77
|
"release_date": "2026-03-09",
|
|
@@ -67,18 +113,19 @@
|
|
|
67
113
|
}
|
|
68
114
|
}
|
|
69
115
|
},
|
|
70
|
-
"grok-
|
|
71
|
-
"id": "grok-
|
|
72
|
-
"name": "Grok
|
|
73
|
-
"description": "Grok model for agentic
|
|
74
|
-
"family": "grok",
|
|
116
|
+
"grok-build-0.1": {
|
|
117
|
+
"id": "grok-build-0.1",
|
|
118
|
+
"name": "Grok Build 0.1",
|
|
119
|
+
"description": "Fast Grok coding model tuned for agentic engineering and iterative edits",
|
|
120
|
+
"family": "grok-build",
|
|
75
121
|
"attachment": true,
|
|
76
|
-
"reasoning":
|
|
122
|
+
"reasoning": true,
|
|
123
|
+
"reasoning_options": [],
|
|
77
124
|
"tool_call": true,
|
|
78
125
|
"structured_output": true,
|
|
79
126
|
"temperature": true,
|
|
80
|
-
"release_date": "2026-
|
|
81
|
-
"last_updated": "2026-
|
|
127
|
+
"release_date": "2026-04-16",
|
|
128
|
+
"last_updated": "2026-04-16",
|
|
82
129
|
"modalities": {
|
|
83
130
|
"input": [
|
|
84
131
|
"text",
|
|
@@ -91,17 +138,17 @@
|
|
|
91
138
|
},
|
|
92
139
|
"open_weights": false,
|
|
93
140
|
"limit": {
|
|
94
|
-
"context":
|
|
95
|
-
"output":
|
|
141
|
+
"context": 256000,
|
|
142
|
+
"output": 256000
|
|
96
143
|
},
|
|
97
144
|
"cost": {
|
|
98
|
-
"input": 1
|
|
99
|
-
"output": 2
|
|
145
|
+
"input": 1,
|
|
146
|
+
"output": 2,
|
|
100
147
|
"cache_read": 0.2,
|
|
101
148
|
"tiers": [
|
|
102
149
|
{
|
|
103
|
-
"input": 2
|
|
104
|
-
"output":
|
|
150
|
+
"input": 2,
|
|
151
|
+
"output": 4,
|
|
105
152
|
"cache_read": 0.4,
|
|
106
153
|
"tier": {
|
|
107
154
|
"type": "context",
|
|
@@ -110,8 +157,8 @@
|
|
|
110
157
|
}
|
|
111
158
|
],
|
|
112
159
|
"context_over_200k": {
|
|
113
|
-
"input": 2
|
|
114
|
-
"output":
|
|
160
|
+
"input": 2,
|
|
161
|
+
"output": 4,
|
|
115
162
|
"cache_read": 0.4
|
|
116
163
|
}
|
|
117
164
|
}
|
|
@@ -176,17 +223,18 @@
|
|
|
176
223
|
}
|
|
177
224
|
}
|
|
178
225
|
},
|
|
179
|
-
"grok-
|
|
180
|
-
"id": "grok-
|
|
181
|
-
"name": "Grok
|
|
182
|
-
"description": "
|
|
226
|
+
"grok-4.20-0309-non-reasoning": {
|
|
227
|
+
"id": "grok-4.20-0309-non-reasoning",
|
|
228
|
+
"name": "Grok 4.20 (Non-Reasoning)",
|
|
229
|
+
"description": "Grok model for agentic tool use, reasoning, coding, and live assistance",
|
|
183
230
|
"family": "grok",
|
|
184
231
|
"attachment": true,
|
|
185
232
|
"reasoning": false,
|
|
186
|
-
"tool_call":
|
|
187
|
-
"
|
|
188
|
-
"
|
|
189
|
-
"
|
|
233
|
+
"tool_call": true,
|
|
234
|
+
"structured_output": true,
|
|
235
|
+
"temperature": true,
|
|
236
|
+
"release_date": "2026-03-09",
|
|
237
|
+
"last_updated": "2026-03-09",
|
|
190
238
|
"modalities": {
|
|
191
239
|
"input": [
|
|
192
240
|
"text",
|
|
@@ -194,42 +242,34 @@
|
|
|
194
242
|
"pdf"
|
|
195
243
|
],
|
|
196
244
|
"output": [
|
|
197
|
-
"
|
|
198
|
-
"pdf"
|
|
245
|
+
"text"
|
|
199
246
|
]
|
|
200
247
|
},
|
|
201
248
|
"open_weights": false,
|
|
202
249
|
"limit": {
|
|
203
|
-
"context":
|
|
204
|
-
"output":
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
"grok-imagine-video": {
|
|
208
|
-
"id": "grok-imagine-video",
|
|
209
|
-
"name": "Grok Imagine Video",
|
|
210
|
-
"description": "Image model for prompt-driven generation, editing, and visual design workflows",
|
|
211
|
-
"family": "grok",
|
|
212
|
-
"attachment": true,
|
|
213
|
-
"reasoning": false,
|
|
214
|
-
"tool_call": false,
|
|
215
|
-
"temperature": false,
|
|
216
|
-
"release_date": "2026-01-28",
|
|
217
|
-
"last_updated": "2026-01-28",
|
|
218
|
-
"modalities": {
|
|
219
|
-
"input": [
|
|
220
|
-
"text",
|
|
221
|
-
"image",
|
|
222
|
-
"video",
|
|
223
|
-
"pdf"
|
|
224
|
-
],
|
|
225
|
-
"output": [
|
|
226
|
-
"video"
|
|
227
|
-
]
|
|
250
|
+
"context": 1000000,
|
|
251
|
+
"output": 30000
|
|
228
252
|
},
|
|
229
|
-
"
|
|
230
|
-
|
|
231
|
-
"
|
|
232
|
-
"
|
|
253
|
+
"cost": {
|
|
254
|
+
"input": 1.25,
|
|
255
|
+
"output": 2.5,
|
|
256
|
+
"cache_read": 0.2,
|
|
257
|
+
"tiers": [
|
|
258
|
+
{
|
|
259
|
+
"input": 2.5,
|
|
260
|
+
"output": 5,
|
|
261
|
+
"cache_read": 0.4,
|
|
262
|
+
"tier": {
|
|
263
|
+
"type": "context",
|
|
264
|
+
"size": 200000
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
],
|
|
268
|
+
"context_over_200k": {
|
|
269
|
+
"input": 2.5,
|
|
270
|
+
"output": 5,
|
|
271
|
+
"cache_read": 0.4
|
|
272
|
+
}
|
|
233
273
|
}
|
|
234
274
|
},
|
|
235
275
|
"grok-4.5": {
|
|
@@ -291,56 +331,6 @@
|
|
|
291
331
|
}
|
|
292
332
|
}
|
|
293
333
|
},
|
|
294
|
-
"grok-4.20-0309-reasoning": {
|
|
295
|
-
"id": "grok-4.20-0309-reasoning",
|
|
296
|
-
"name": "Grok 4.20 (Reasoning)",
|
|
297
|
-
"description": "Reasoning Grok for document-heavy analysis and long-horizon tool use",
|
|
298
|
-
"family": "grok",
|
|
299
|
-
"attachment": true,
|
|
300
|
-
"reasoning": true,
|
|
301
|
-
"reasoning_options": [],
|
|
302
|
-
"tool_call": true,
|
|
303
|
-
"structured_output": true,
|
|
304
|
-
"temperature": true,
|
|
305
|
-
"release_date": "2026-03-09",
|
|
306
|
-
"last_updated": "2026-03-09",
|
|
307
|
-
"modalities": {
|
|
308
|
-
"input": [
|
|
309
|
-
"text",
|
|
310
|
-
"image",
|
|
311
|
-
"pdf"
|
|
312
|
-
],
|
|
313
|
-
"output": [
|
|
314
|
-
"text"
|
|
315
|
-
]
|
|
316
|
-
},
|
|
317
|
-
"open_weights": false,
|
|
318
|
-
"limit": {
|
|
319
|
-
"context": 1000000,
|
|
320
|
-
"output": 30000
|
|
321
|
-
},
|
|
322
|
-
"cost": {
|
|
323
|
-
"input": 1.25,
|
|
324
|
-
"output": 2.5,
|
|
325
|
-
"cache_read": 0.2,
|
|
326
|
-
"tiers": [
|
|
327
|
-
{
|
|
328
|
-
"input": 2.5,
|
|
329
|
-
"output": 5,
|
|
330
|
-
"cache_read": 0.4,
|
|
331
|
-
"tier": {
|
|
332
|
-
"type": "context",
|
|
333
|
-
"size": 200000
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
],
|
|
337
|
-
"context_over_200k": {
|
|
338
|
-
"input": 2.5,
|
|
339
|
-
"output": 5,
|
|
340
|
-
"cache_read": 0.4
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
334
|
"grok-imagine-image": {
|
|
345
335
|
"id": "grok-imagine-image",
|
|
346
336
|
"name": "Grok Imagine Image",
|
|
@@ -369,19 +359,29 @@
|
|
|
369
359
|
"output": 0
|
|
370
360
|
}
|
|
371
361
|
},
|
|
372
|
-
"grok-
|
|
373
|
-
"id": "grok-
|
|
374
|
-
"name": "Grok
|
|
375
|
-
"description": "
|
|
376
|
-
"family": "grok
|
|
362
|
+
"grok-4.20-multi-agent-0309": {
|
|
363
|
+
"id": "grok-4.20-multi-agent-0309",
|
|
364
|
+
"name": "Grok 4.20 Multi-Agent",
|
|
365
|
+
"description": "Grok model for agentic tool use, reasoning, coding, and live assistance",
|
|
366
|
+
"family": "grok",
|
|
377
367
|
"attachment": true,
|
|
378
368
|
"reasoning": true,
|
|
379
|
-
"reasoning_options": [
|
|
380
|
-
|
|
369
|
+
"reasoning_options": [
|
|
370
|
+
{
|
|
371
|
+
"type": "effort",
|
|
372
|
+
"values": [
|
|
373
|
+
"low",
|
|
374
|
+
"medium",
|
|
375
|
+
"high",
|
|
376
|
+
"xhigh"
|
|
377
|
+
]
|
|
378
|
+
}
|
|
379
|
+
],
|
|
380
|
+
"tool_call": false,
|
|
381
381
|
"structured_output": true,
|
|
382
382
|
"temperature": true,
|
|
383
|
-
"release_date": "2026-
|
|
384
|
-
"last_updated": "2026-
|
|
383
|
+
"release_date": "2026-03-09",
|
|
384
|
+
"last_updated": "2026-03-09",
|
|
385
385
|
"modalities": {
|
|
386
386
|
"input": [
|
|
387
387
|
"text",
|
|
@@ -394,17 +394,17 @@
|
|
|
394
394
|
},
|
|
395
395
|
"open_weights": false,
|
|
396
396
|
"limit": {
|
|
397
|
-
"context":
|
|
398
|
-
"output":
|
|
397
|
+
"context": 1000000,
|
|
398
|
+
"output": 30000
|
|
399
399
|
},
|
|
400
400
|
"cost": {
|
|
401
|
-
"input": 1,
|
|
402
|
-
"output": 2,
|
|
401
|
+
"input": 1.25,
|
|
402
|
+
"output": 2.5,
|
|
403
403
|
"cache_read": 0.2,
|
|
404
404
|
"tiers": [
|
|
405
405
|
{
|
|
406
|
-
"input": 2,
|
|
407
|
-
"output":
|
|
406
|
+
"input": 2.5,
|
|
407
|
+
"output": 5,
|
|
408
408
|
"cache_read": 0.4,
|
|
409
409
|
"tier": {
|
|
410
410
|
"type": "context",
|
|
@@ -413,8 +413,8 @@
|
|
|
413
413
|
}
|
|
414
414
|
],
|
|
415
415
|
"context_over_200k": {
|
|
416
|
-
"input": 2,
|
|
417
|
-
"output":
|
|
416
|
+
"input": 2.5,
|
|
417
|
+
"output": 5,
|
|
418
418
|
"cache_read": 0.4
|
|
419
419
|
}
|
|
420
420
|
}
|