llm.rb 15.0.3 → 15.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 +4 -4
- data/CHANGELOG.md +433 -3
- data/README.md +188 -71
- data/bin/llm.rb +50 -7
- data/data/alibaba.json +912 -823
- data/data/anthropic.json +234 -187
- data/data/bedrock.json +3702 -2058
- data/data/deepinfra.json +1288 -951
- data/data/deepseek.json +87 -53
- data/data/google.json +670 -670
- data/data/mistral.json +501 -460
- data/data/moonshot.json +43 -248
- data/data/openai.json +1008 -914
- data/data/openrouter.json +14417 -0
- data/data/xai.json +213 -201
- data/data/zai.json +242 -149
- data/docs/deepdive/advanced/compaction.md +5 -5
- data/docs/deepdive/advanced/context.md +8 -6
- data/docs/deepdive/advanced/guard.md +2 -2
- data/docs/deepdive/features/builtin_tools.md +93 -22
- data/docs/deepdive/features/{repl.md → console.md} +28 -28
- data/docs/deepdive/features/database.md +3 -3
- data/docs/deepdive/fundamentals/agents.md +13 -12
- data/docs/deepdive/fundamentals/providers.md +91 -6
- data/docs/deepdive/fundamentals/skills.md +14 -6
- data/docs/deepdive/fundamentals/stream.md +4 -4
- data/docs/deepdive/fundamentals/tools.md +63 -31
- data/docs/deepdive/reference/cost.md +2 -2
- data/docs/deepdive/reference/model_registry.md +2 -2
- data/docs/deepdive/reference/tracer.md +15 -13
- data/docs/deepdive.md +2 -2
- data/lib/llm/active_record/acts_as_agent.rb +9 -5
- data/lib/llm/agent.rb +40 -15
- data/lib/llm/{repl → console}/bar.rb +3 -3
- data/lib/llm/{repl → console}/buffer.rb +24 -9
- data/lib/llm/{repl → console}/color.rb +2 -2
- data/lib/llm/{repl → console}/command.rb +12 -12
- data/lib/llm/{repl → console}/commands/exit.rb +4 -4
- data/lib/llm/{repl → console}/commands/help.rb +1 -1
- data/lib/llm/{repl/commands/compact.rb → console/commands/keep.rb} +11 -9
- data/lib/llm/{repl → console}/commands/model.rb +2 -2
- data/lib/llm/{repl → console}/input/cache.rb +2 -2
- data/lib/llm/{repl → console}/input/char.rb +2 -2
- data/lib/llm/{repl → console}/input/row.rb +1 -1
- data/lib/llm/{repl → console}/input.rb +18 -10
- data/lib/llm/console/markdown/parser.rb +78 -0
- data/lib/llm/{repl → console}/markdown/table.rb +8 -5
- data/lib/llm/{repl → console}/markdown.rb +13 -30
- data/lib/llm/console/node.rb +69 -0
- data/lib/llm/{repl → console}/status.rb +11 -11
- data/lib/llm/{repl → console}/stream.rb +36 -9
- data/lib/llm/{repl → console}/walker.rb +1 -1
- data/lib/llm/{repl → console}/window.rb +17 -17
- data/lib/llm/{repl.rb → console.rb} +39 -19
- data/lib/llm/context/deserializer.rb +2 -1
- data/lib/llm/context.rb +29 -13
- data/lib/llm/cost.rb +13 -0
- data/lib/llm/function/async/reactor.rb +20 -1
- data/lib/llm/function/fork/task.rb +14 -10
- data/lib/llm/function.rb +1 -1
- data/lib/llm/json_adapter.rb +40 -28
- data/lib/llm/message.rb +7 -0
- data/lib/llm/provider.rb +31 -10
- data/lib/llm/providers/alibaba.rb +1 -1
- data/lib/llm/providers/anthropic.rb +1 -1
- data/lib/llm/providers/bedrock/models.rb +2 -2
- data/lib/llm/providers/bedrock.rb +1 -1
- data/lib/llm/providers/deepseek.rb +1 -1
- data/lib/llm/providers/google.rb +1 -1
- data/lib/llm/providers/ollama.rb +1 -1
- data/lib/llm/providers/openai/responses.rb +2 -1
- data/lib/llm/providers/openai.rb +2 -1
- data/lib/llm/providers/openrouter.rb +87 -0
- data/lib/llm/schema/leaf.rb +34 -2
- data/lib/llm/schema.rb +4 -2
- data/lib/llm/sequel/agent.rb +9 -5
- data/lib/llm/skill.rb +7 -1
- data/lib/llm/stream.rb +8 -3
- data/lib/llm/tool/param.rb +5 -1
- data/lib/llm/tool.rb +5 -0
- data/lib/llm/tools/bundle.rb +53 -0
- data/lib/llm/tools/edit-file.rb +7 -2
- data/lib/llm/tools/exec.rb +78 -0
- data/lib/llm/tools/git.rb +27 -26
- data/lib/llm/tools/mkdir.rb +12 -19
- data/lib/llm/tools/read_file.rb +69 -9
- data/lib/llm/tools/rg.rb +20 -24
- data/lib/llm/tools/ruby.rb +17 -25
- data/lib/llm/tools/utils.rb +75 -2
- data/lib/llm/tools/write_file.rb +4 -1
- data/lib/llm/tracer/logger.rb +2 -2
- data/lib/llm/tracer/pretty_logger.rb +4 -4
- data/lib/llm/tracer/telemetry.rb +2 -2
- data/lib/llm/tracer.rb +33 -0
- data/lib/llm/transport/curb.rb +5 -3
- data/lib/llm/transport/http.rb +5 -2
- data/lib/llm/transport/persistent_http.rb +6 -4
- data/lib/llm/transport/utils.rb +8 -6
- data/lib/llm/version.rb +1 -1
- data/lib/llm.rb +18 -12
- data/llm.gemspec +8 -8
- metadata +80 -37
- data/lib/llm/repl/node.rb +0 -44
- data/lib/llm/tools/shell.rb +0 -55
data/data/zai.json
CHANGED
|
@@ -8,6 +8,83 @@
|
|
|
8
8
|
"name": "Z.AI",
|
|
9
9
|
"doc": "https://docs.z.ai/guides/overview/pricing",
|
|
10
10
|
"models": {
|
|
11
|
+
"glm-4.7": {
|
|
12
|
+
"id": "glm-4.7",
|
|
13
|
+
"name": "GLM-4.7",
|
|
14
|
+
"description": "Mature GLM model for dependable coding, reasoning, and structured agent tasks",
|
|
15
|
+
"family": "glm",
|
|
16
|
+
"attachment": false,
|
|
17
|
+
"reasoning": true,
|
|
18
|
+
"reasoning_options": [
|
|
19
|
+
{
|
|
20
|
+
"type": "toggle"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"tool_call": true,
|
|
24
|
+
"interleaved": {
|
|
25
|
+
"field": "reasoning_content"
|
|
26
|
+
},
|
|
27
|
+
"temperature": true,
|
|
28
|
+
"knowledge": "2025-04",
|
|
29
|
+
"release_date": "2025-12-22",
|
|
30
|
+
"last_updated": "2025-12-22",
|
|
31
|
+
"modalities": {
|
|
32
|
+
"input": [
|
|
33
|
+
"text"
|
|
34
|
+
],
|
|
35
|
+
"output": [
|
|
36
|
+
"text"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"open_weights": true,
|
|
40
|
+
"limit": {
|
|
41
|
+
"context": 204800,
|
|
42
|
+
"output": 131072
|
|
43
|
+
},
|
|
44
|
+
"cost": {
|
|
45
|
+
"input": 0.6,
|
|
46
|
+
"output": 2.2,
|
|
47
|
+
"cache_read": 0.11,
|
|
48
|
+
"cache_write": 0
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"glm-4.5-air": {
|
|
52
|
+
"id": "glm-4.5-air",
|
|
53
|
+
"name": "GLM-4.5-Air",
|
|
54
|
+
"description": "Lighter GLM-4.5 variant for fast coding assistance and cheaper agents",
|
|
55
|
+
"family": "glm-air",
|
|
56
|
+
"attachment": false,
|
|
57
|
+
"reasoning": true,
|
|
58
|
+
"reasoning_options": [
|
|
59
|
+
{
|
|
60
|
+
"type": "toggle"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"tool_call": true,
|
|
64
|
+
"temperature": true,
|
|
65
|
+
"knowledge": "2025-04",
|
|
66
|
+
"release_date": "2025-07-28",
|
|
67
|
+
"last_updated": "2025-07-28",
|
|
68
|
+
"modalities": {
|
|
69
|
+
"input": [
|
|
70
|
+
"text"
|
|
71
|
+
],
|
|
72
|
+
"output": [
|
|
73
|
+
"text"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"open_weights": true,
|
|
77
|
+
"limit": {
|
|
78
|
+
"context": 131072,
|
|
79
|
+
"output": 98304
|
|
80
|
+
},
|
|
81
|
+
"cost": {
|
|
82
|
+
"input": 0.2,
|
|
83
|
+
"output": 1.1,
|
|
84
|
+
"cache_read": 0.03,
|
|
85
|
+
"cache_write": 0
|
|
86
|
+
}
|
|
87
|
+
},
|
|
11
88
|
"glm-4.6": {
|
|
12
89
|
"id": "glm-4.6",
|
|
13
90
|
"name": "GLM-4.6",
|
|
@@ -45,6 +122,87 @@
|
|
|
45
122
|
"cache_write": 0
|
|
46
123
|
}
|
|
47
124
|
},
|
|
125
|
+
"glm-4.6v": {
|
|
126
|
+
"id": "glm-4.6v",
|
|
127
|
+
"name": "GLM-4.6V",
|
|
128
|
+
"description": "GLM vision model for visual reasoning, documents, and multimodal agents",
|
|
129
|
+
"family": "glm",
|
|
130
|
+
"attachment": true,
|
|
131
|
+
"reasoning": true,
|
|
132
|
+
"reasoning_options": [
|
|
133
|
+
{
|
|
134
|
+
"type": "toggle"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"tool_call": true,
|
|
138
|
+
"temperature": true,
|
|
139
|
+
"knowledge": "2025-04",
|
|
140
|
+
"release_date": "2025-12-08",
|
|
141
|
+
"last_updated": "2025-12-08",
|
|
142
|
+
"modalities": {
|
|
143
|
+
"input": [
|
|
144
|
+
"text",
|
|
145
|
+
"image",
|
|
146
|
+
"video"
|
|
147
|
+
],
|
|
148
|
+
"output": [
|
|
149
|
+
"text"
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
"open_weights": true,
|
|
153
|
+
"limit": {
|
|
154
|
+
"context": 128000,
|
|
155
|
+
"output": 32768
|
|
156
|
+
},
|
|
157
|
+
"cost": {
|
|
158
|
+
"input": 0.3,
|
|
159
|
+
"output": 0.9
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"glm-5.2": {
|
|
163
|
+
"id": "glm-5.2",
|
|
164
|
+
"name": "GLM-5.2",
|
|
165
|
+
"description": "Open flagship GLM for long-horizon coding agents and million-token context work",
|
|
166
|
+
"family": "glm",
|
|
167
|
+
"attachment": false,
|
|
168
|
+
"reasoning": true,
|
|
169
|
+
"reasoning_options": [
|
|
170
|
+
{
|
|
171
|
+
"type": "effort",
|
|
172
|
+
"values": [
|
|
173
|
+
"high",
|
|
174
|
+
"max"
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"tool_call": true,
|
|
179
|
+
"interleaved": {
|
|
180
|
+
"field": "reasoning_content"
|
|
181
|
+
},
|
|
182
|
+
"structured_output": true,
|
|
183
|
+
"temperature": true,
|
|
184
|
+
"release_date": "2026-06-13",
|
|
185
|
+
"last_updated": "2026-06-13",
|
|
186
|
+
"modalities": {
|
|
187
|
+
"input": [
|
|
188
|
+
"text"
|
|
189
|
+
],
|
|
190
|
+
"output": [
|
|
191
|
+
"text"
|
|
192
|
+
]
|
|
193
|
+
},
|
|
194
|
+
"open_weights": true,
|
|
195
|
+
"limit": {
|
|
196
|
+
"context": 1000000,
|
|
197
|
+
"output": 131072
|
|
198
|
+
},
|
|
199
|
+
"cost": {
|
|
200
|
+
"input": 1.4,
|
|
201
|
+
"output": 4.4,
|
|
202
|
+
"cache_read": 0.26,
|
|
203
|
+
"cache_write": 0
|
|
204
|
+
}
|
|
205
|
+
},
|
|
48
206
|
"glm-4.5-flash": {
|
|
49
207
|
"id": "glm-4.5-flash",
|
|
50
208
|
"name": "GLM-4.5-Flash",
|
|
@@ -82,25 +240,31 @@
|
|
|
82
240
|
"cache_write": 0
|
|
83
241
|
}
|
|
84
242
|
},
|
|
85
|
-
"glm-
|
|
86
|
-
"id": "glm-
|
|
87
|
-
"name": "GLM-
|
|
88
|
-
"description": "
|
|
243
|
+
"glm-5.3-flash": {
|
|
244
|
+
"id": "glm-5.3-flash",
|
|
245
|
+
"name": "GLM-5.3-Flash",
|
|
246
|
+
"description": "Native multimodal GLM model for efficient coding and long-horizon agent tasks",
|
|
89
247
|
"family": "glm",
|
|
90
248
|
"attachment": true,
|
|
91
249
|
"reasoning": true,
|
|
92
250
|
"reasoning_options": [
|
|
93
251
|
{
|
|
94
|
-
"type": "
|
|
252
|
+
"type": "effort",
|
|
253
|
+
"values": [
|
|
254
|
+
"low",
|
|
255
|
+
"high",
|
|
256
|
+
"max"
|
|
257
|
+
]
|
|
95
258
|
}
|
|
96
259
|
],
|
|
97
260
|
"tool_call": true,
|
|
98
261
|
"interleaved": {
|
|
99
262
|
"field": "reasoning_content"
|
|
100
263
|
},
|
|
264
|
+
"structured_output": true,
|
|
101
265
|
"temperature": true,
|
|
102
|
-
"release_date": "2026-
|
|
103
|
-
"last_updated": "2026-
|
|
266
|
+
"release_date": "2026-08-26",
|
|
267
|
+
"last_updated": "2026-08-26",
|
|
104
268
|
"modalities": {
|
|
105
269
|
"input": [
|
|
106
270
|
"text",
|
|
@@ -112,22 +276,22 @@
|
|
|
112
276
|
"text"
|
|
113
277
|
]
|
|
114
278
|
},
|
|
115
|
-
"open_weights":
|
|
279
|
+
"open_weights": true,
|
|
116
280
|
"limit": {
|
|
117
|
-
"context":
|
|
281
|
+
"context": 1000000,
|
|
118
282
|
"output": 131072
|
|
119
283
|
},
|
|
120
284
|
"cost": {
|
|
121
|
-
"input":
|
|
122
|
-
"output":
|
|
123
|
-
"cache_read": 0.
|
|
285
|
+
"input": 0.075,
|
|
286
|
+
"output": 0.25,
|
|
287
|
+
"cache_read": 0.015,
|
|
124
288
|
"cache_write": 0
|
|
125
289
|
}
|
|
126
290
|
},
|
|
127
|
-
"glm-4.
|
|
128
|
-
"id": "glm-4.
|
|
129
|
-
"name": "GLM-4.
|
|
130
|
-
"description": "
|
|
291
|
+
"glm-4.5": {
|
|
292
|
+
"id": "glm-4.5",
|
|
293
|
+
"name": "GLM-4.5",
|
|
294
|
+
"description": "Hybrid-reasoning GLM release that made the 4.5 line broadly useful",
|
|
131
295
|
"family": "glm",
|
|
132
296
|
"attachment": false,
|
|
133
297
|
"reasoning": true,
|
|
@@ -137,13 +301,10 @@
|
|
|
137
301
|
}
|
|
138
302
|
],
|
|
139
303
|
"tool_call": true,
|
|
140
|
-
"interleaved": {
|
|
141
|
-
"field": "reasoning_content"
|
|
142
|
-
},
|
|
143
304
|
"temperature": true,
|
|
144
305
|
"knowledge": "2025-04",
|
|
145
|
-
"release_date": "2025-
|
|
146
|
-
"last_updated": "2025-
|
|
306
|
+
"release_date": "2025-07-28",
|
|
307
|
+
"last_updated": "2025-07-28",
|
|
147
308
|
"modalities": {
|
|
148
309
|
"input": [
|
|
149
310
|
"text"
|
|
@@ -154,8 +315,8 @@
|
|
|
154
315
|
},
|
|
155
316
|
"open_weights": true,
|
|
156
317
|
"limit": {
|
|
157
|
-
"context":
|
|
158
|
-
"output":
|
|
318
|
+
"context": 131072,
|
|
319
|
+
"output": 98304
|
|
159
320
|
},
|
|
160
321
|
"cost": {
|
|
161
322
|
"input": 0.6,
|
|
@@ -277,10 +438,10 @@
|
|
|
277
438
|
"cache_write": 0
|
|
278
439
|
}
|
|
279
440
|
},
|
|
280
|
-
"glm-5
|
|
281
|
-
"id": "glm-5
|
|
282
|
-
"name": "GLM-5
|
|
283
|
-
"description": "
|
|
441
|
+
"glm-5.1": {
|
|
442
|
+
"id": "glm-5.1",
|
|
443
|
+
"name": "GLM-5.1",
|
|
444
|
+
"description": "Strong GLM coding model for agentic engineering, terminals, and repository generation",
|
|
284
445
|
"family": "glm",
|
|
285
446
|
"attachment": false,
|
|
286
447
|
"reasoning": true,
|
|
@@ -295,8 +456,8 @@
|
|
|
295
456
|
},
|
|
296
457
|
"structured_output": true,
|
|
297
458
|
"temperature": true,
|
|
298
|
-
"release_date": "2026-
|
|
299
|
-
"last_updated": "2026-
|
|
459
|
+
"release_date": "2026-04-07",
|
|
460
|
+
"last_updated": "2026-04-07",
|
|
300
461
|
"modalities": {
|
|
301
462
|
"input": [
|
|
302
463
|
"text"
|
|
@@ -305,32 +466,28 @@
|
|
|
305
466
|
"text"
|
|
306
467
|
]
|
|
307
468
|
},
|
|
308
|
-
"open_weights":
|
|
469
|
+
"open_weights": true,
|
|
309
470
|
"limit": {
|
|
310
471
|
"context": 200000,
|
|
311
472
|
"output": 131072
|
|
312
473
|
},
|
|
313
474
|
"cost": {
|
|
314
|
-
"input": 1.
|
|
315
|
-
"output": 4,
|
|
316
|
-
"cache_read": 0.
|
|
475
|
+
"input": 1.4,
|
|
476
|
+
"output": 4.4,
|
|
477
|
+
"cache_read": 0.26,
|
|
317
478
|
"cache_write": 0
|
|
318
479
|
}
|
|
319
480
|
},
|
|
320
|
-
"glm-5
|
|
321
|
-
"id": "glm-5
|
|
322
|
-
"name": "GLM-5
|
|
323
|
-
"description": "
|
|
481
|
+
"glm-5-turbo": {
|
|
482
|
+
"id": "glm-5-turbo",
|
|
483
|
+
"name": "GLM-5-Turbo",
|
|
484
|
+
"description": "Faster GLM-5 lane for coding agents that need lower latency",
|
|
324
485
|
"family": "glm",
|
|
325
486
|
"attachment": false,
|
|
326
487
|
"reasoning": true,
|
|
327
488
|
"reasoning_options": [
|
|
328
489
|
{
|
|
329
|
-
"type": "
|
|
330
|
-
"values": [
|
|
331
|
-
"high",
|
|
332
|
-
"max"
|
|
333
|
-
]
|
|
490
|
+
"type": "toggle"
|
|
334
491
|
}
|
|
335
492
|
],
|
|
336
493
|
"tool_call": true,
|
|
@@ -339,8 +496,8 @@
|
|
|
339
496
|
},
|
|
340
497
|
"structured_output": true,
|
|
341
498
|
"temperature": true,
|
|
342
|
-
"release_date": "2026-
|
|
343
|
-
"last_updated": "2026-
|
|
499
|
+
"release_date": "2026-03-16",
|
|
500
|
+
"last_updated": "2026-03-16",
|
|
344
501
|
"modalities": {
|
|
345
502
|
"input": [
|
|
346
503
|
"text"
|
|
@@ -349,72 +506,43 @@
|
|
|
349
506
|
"text"
|
|
350
507
|
]
|
|
351
508
|
},
|
|
352
|
-
"open_weights":
|
|
509
|
+
"open_weights": false,
|
|
353
510
|
"limit": {
|
|
354
|
-
"context":
|
|
511
|
+
"context": 200000,
|
|
355
512
|
"output": 131072
|
|
356
513
|
},
|
|
357
514
|
"cost": {
|
|
358
|
-
"input": 1.
|
|
359
|
-
"output": 4
|
|
360
|
-
"cache_read": 0.
|
|
515
|
+
"input": 1.2,
|
|
516
|
+
"output": 4,
|
|
517
|
+
"cache_read": 0.24,
|
|
361
518
|
"cache_write": 0
|
|
362
519
|
}
|
|
363
520
|
},
|
|
364
|
-
"glm-
|
|
365
|
-
"id": "glm-
|
|
366
|
-
"name": "GLM-
|
|
367
|
-
"description": "GLM
|
|
521
|
+
"glm-5.3": {
|
|
522
|
+
"id": "glm-5.3",
|
|
523
|
+
"name": "GLM-5.3",
|
|
524
|
+
"description": "Flagship GLM model for long-horizon coding, agents, and complex project delivery",
|
|
368
525
|
"family": "glm",
|
|
369
|
-
"attachment": true,
|
|
370
|
-
"reasoning": true,
|
|
371
|
-
"reasoning_options": [
|
|
372
|
-
{
|
|
373
|
-
"type": "toggle"
|
|
374
|
-
}
|
|
375
|
-
],
|
|
376
|
-
"tool_call": true,
|
|
377
|
-
"temperature": true,
|
|
378
|
-
"knowledge": "2025-04",
|
|
379
|
-
"release_date": "2025-12-08",
|
|
380
|
-
"last_updated": "2025-12-08",
|
|
381
|
-
"modalities": {
|
|
382
|
-
"input": [
|
|
383
|
-
"text",
|
|
384
|
-
"image",
|
|
385
|
-
"video"
|
|
386
|
-
],
|
|
387
|
-
"output": [
|
|
388
|
-
"text"
|
|
389
|
-
]
|
|
390
|
-
},
|
|
391
|
-
"open_weights": true,
|
|
392
|
-
"limit": {
|
|
393
|
-
"context": 128000,
|
|
394
|
-
"output": 32768
|
|
395
|
-
},
|
|
396
|
-
"cost": {
|
|
397
|
-
"input": 0.3,
|
|
398
|
-
"output": 0.9
|
|
399
|
-
}
|
|
400
|
-
},
|
|
401
|
-
"glm-4.5-air": {
|
|
402
|
-
"id": "glm-4.5-air",
|
|
403
|
-
"name": "GLM-4.5-Air",
|
|
404
|
-
"description": "Lighter GLM-4.5 variant for fast coding assistance and cheaper agents",
|
|
405
|
-
"family": "glm-air",
|
|
406
526
|
"attachment": false,
|
|
407
527
|
"reasoning": true,
|
|
408
528
|
"reasoning_options": [
|
|
409
529
|
{
|
|
410
|
-
"type": "
|
|
530
|
+
"type": "effort",
|
|
531
|
+
"values": [
|
|
532
|
+
"low",
|
|
533
|
+
"high",
|
|
534
|
+
"max"
|
|
535
|
+
]
|
|
411
536
|
}
|
|
412
537
|
],
|
|
413
538
|
"tool_call": true,
|
|
539
|
+
"interleaved": {
|
|
540
|
+
"field": "reasoning_content"
|
|
541
|
+
},
|
|
542
|
+
"structured_output": true,
|
|
414
543
|
"temperature": true,
|
|
415
|
-
"
|
|
416
|
-
"
|
|
417
|
-
"last_updated": "2025-07-28",
|
|
544
|
+
"release_date": "2026-08-14",
|
|
545
|
+
"last_updated": "2026-08-14",
|
|
418
546
|
"modalities": {
|
|
419
547
|
"input": [
|
|
420
548
|
"text"
|
|
@@ -425,22 +553,22 @@
|
|
|
425
553
|
},
|
|
426
554
|
"open_weights": true,
|
|
427
555
|
"limit": {
|
|
428
|
-
"context":
|
|
429
|
-
"output":
|
|
556
|
+
"context": 1000000,
|
|
557
|
+
"output": 131072
|
|
430
558
|
},
|
|
431
559
|
"cost": {
|
|
432
|
-
"input":
|
|
433
|
-
"output":
|
|
434
|
-
"cache_read": 0.
|
|
560
|
+
"input": 1.4,
|
|
561
|
+
"output": 4.4,
|
|
562
|
+
"cache_read": 0.26,
|
|
435
563
|
"cache_write": 0
|
|
436
564
|
}
|
|
437
565
|
},
|
|
438
|
-
"glm-
|
|
439
|
-
"id": "glm-
|
|
440
|
-
"name": "GLM-
|
|
441
|
-
"description": "
|
|
566
|
+
"glm-5v-turbo": {
|
|
567
|
+
"id": "glm-5v-turbo",
|
|
568
|
+
"name": "GLM-5V-Turbo",
|
|
569
|
+
"description": "Fast GLM vision model for screenshots, documents, and multimodal agent tasks",
|
|
442
570
|
"family": "glm",
|
|
443
|
-
"attachment":
|
|
571
|
+
"attachment": true,
|
|
444
572
|
"reasoning": true,
|
|
445
573
|
"reasoning_options": [
|
|
446
574
|
{
|
|
@@ -451,27 +579,29 @@
|
|
|
451
579
|
"interleaved": {
|
|
452
580
|
"field": "reasoning_content"
|
|
453
581
|
},
|
|
454
|
-
"structured_output": true,
|
|
455
582
|
"temperature": true,
|
|
456
|
-
"release_date": "2026-04-
|
|
457
|
-
"last_updated": "2026-04-
|
|
583
|
+
"release_date": "2026-04-01",
|
|
584
|
+
"last_updated": "2026-04-01",
|
|
458
585
|
"modalities": {
|
|
459
586
|
"input": [
|
|
460
|
-
"text"
|
|
587
|
+
"text",
|
|
588
|
+
"image",
|
|
589
|
+
"video",
|
|
590
|
+
"pdf"
|
|
461
591
|
],
|
|
462
592
|
"output": [
|
|
463
593
|
"text"
|
|
464
594
|
]
|
|
465
595
|
},
|
|
466
|
-
"open_weights":
|
|
596
|
+
"open_weights": false,
|
|
467
597
|
"limit": {
|
|
468
598
|
"context": 200000,
|
|
469
599
|
"output": 131072
|
|
470
600
|
},
|
|
471
601
|
"cost": {
|
|
472
|
-
"input": 1.
|
|
473
|
-
"output": 4
|
|
474
|
-
"cache_read": 0.
|
|
602
|
+
"input": 1.2,
|
|
603
|
+
"output": 4,
|
|
604
|
+
"cache_read": 0.24,
|
|
475
605
|
"cache_write": 0
|
|
476
606
|
}
|
|
477
607
|
},
|
|
@@ -511,43 +641,6 @@
|
|
|
511
641
|
"cache_read": 0,
|
|
512
642
|
"cache_write": 0
|
|
513
643
|
}
|
|
514
|
-
},
|
|
515
|
-
"glm-4.5": {
|
|
516
|
-
"id": "glm-4.5",
|
|
517
|
-
"name": "GLM-4.5",
|
|
518
|
-
"description": "Hybrid-reasoning GLM release that made the 4.5 line broadly useful",
|
|
519
|
-
"family": "glm",
|
|
520
|
-
"attachment": false,
|
|
521
|
-
"reasoning": true,
|
|
522
|
-
"reasoning_options": [
|
|
523
|
-
{
|
|
524
|
-
"type": "toggle"
|
|
525
|
-
}
|
|
526
|
-
],
|
|
527
|
-
"tool_call": true,
|
|
528
|
-
"temperature": true,
|
|
529
|
-
"knowledge": "2025-04",
|
|
530
|
-
"release_date": "2025-07-28",
|
|
531
|
-
"last_updated": "2025-07-28",
|
|
532
|
-
"modalities": {
|
|
533
|
-
"input": [
|
|
534
|
-
"text"
|
|
535
|
-
],
|
|
536
|
-
"output": [
|
|
537
|
-
"text"
|
|
538
|
-
]
|
|
539
|
-
},
|
|
540
|
-
"open_weights": true,
|
|
541
|
-
"limit": {
|
|
542
|
-
"context": 131072,
|
|
543
|
-
"output": 98304
|
|
544
|
-
},
|
|
545
|
-
"cost": {
|
|
546
|
-
"input": 0.6,
|
|
547
|
-
"output": 2.2,
|
|
548
|
-
"cache_read": 0.11,
|
|
549
|
-
"cache_write": 0
|
|
550
|
-
}
|
|
551
644
|
}
|
|
552
645
|
}
|
|
553
646
|
}
|
|
@@ -45,15 +45,15 @@ compactor = LLM::Compactor::Truncate.new(agent)
|
|
|
45
45
|
compactor.call(keep: 200)
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
##### The `/
|
|
48
|
+
##### The `/keep` command
|
|
49
49
|
|
|
50
|
-
The
|
|
50
|
+
The console provides a `/keep` command that accepts a count or
|
|
51
51
|
percentage:
|
|
52
52
|
|
|
53
53
|
```ruby
|
|
54
|
-
# /
|
|
55
|
-
# /
|
|
56
|
-
# /
|
|
54
|
+
# /keep # keep last 128 messages
|
|
55
|
+
# /keep 50 # keep last 50 messages
|
|
56
|
+
# /keep 75% # keep approximately 75% of messages
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
#### Why would I use it?
|
|
@@ -74,12 +74,14 @@ with `store: false`, so no conversation state is kept server-side.
|
|
|
74
74
|
Pass `mode: :completions` to use the legacy Chat Completions API
|
|
75
75
|
instead. Every other provider defaults to `mode: :completions`.
|
|
76
76
|
|
|
77
|
-
A raw context disables
|
|
78
|
-
Pass `retry_budget:` to retry a
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
A raw context disables retries by default (`retry_budget: 0`).
|
|
78
|
+
Pass `retry_budget:` to retry a request that was rate limited
|
|
79
|
+
(`LLM::RateLimitError`) or timed out (`Timeout::Error`, covering
|
|
80
|
+
`Net::OpenTimeout` and `Net::ReadTimeout`), up to that many times.
|
|
81
|
+
Each retry sleeps a growing interval (2s, 4s, 6s, ...) and notifies
|
|
82
|
+
the stream through
|
|
83
|
+
[`LLM::Stream#on_retry`](https://r.uby.dev/api-docs/llm.rb/LLM/Stream.html#on_retry-instance_method)
|
|
84
|
+
before trying again. An `LLM::Agent` enables a budget of 5 by
|
|
83
85
|
default, so most users never touch this directly.
|
|
84
86
|
|
|
85
87
|
### Manual loop
|
|
@@ -198,9 +198,9 @@ call through:
|
|
|
198
198
|
```ruby
|
|
199
199
|
class PolicyGuard < LLM::Guard
|
|
200
200
|
def call(function:)
|
|
201
|
-
if function.name == "
|
|
201
|
+
if function.name == "exec"
|
|
202
202
|
function.return(error: true, type: "policy_error",
|
|
203
|
-
message: "
|
|
203
|
+
message: "exec is disabled")
|
|
204
204
|
end
|
|
205
205
|
end
|
|
206
206
|
end
|