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/moonshot.json
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"name": "Moonshot AI",
|
|
9
9
|
"doc": "https://platform.moonshot.ai/docs/api/chat",
|
|
10
10
|
"models": {
|
|
11
|
-
"kimi-k2.7-code": {
|
|
12
|
-
"id": "kimi-k2.7-code",
|
|
13
|
-
"name": "Kimi K2.7 Code",
|
|
11
|
+
"kimi-k2.7-code-highspeed": {
|
|
12
|
+
"id": "kimi-k2.7-code-highspeed",
|
|
13
|
+
"name": "Kimi K2.7 Code HighSpeed",
|
|
14
14
|
"description": "Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking",
|
|
15
15
|
"family": "kimi-k2",
|
|
16
16
|
"attachment": true,
|
|
@@ -41,132 +41,17 @@
|
|
|
41
41
|
"output": 262144
|
|
42
42
|
},
|
|
43
43
|
"cost": {
|
|
44
|
-
"input":
|
|
45
|
-
"output": 4,
|
|
46
|
-
"cache_read": 0.19
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
"kimi-k3": {
|
|
50
|
-
"id": "kimi-k3",
|
|
51
|
-
"name": "Kimi K3",
|
|
52
|
-
"description": "Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work",
|
|
53
|
-
"family": "kimi-k3",
|
|
54
|
-
"attachment": true,
|
|
55
|
-
"reasoning": true,
|
|
56
|
-
"reasoning_options": [
|
|
57
|
-
{
|
|
58
|
-
"type": "toggle"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"type": "effort",
|
|
62
|
-
"values": [
|
|
63
|
-
"low",
|
|
64
|
-
"high",
|
|
65
|
-
"max"
|
|
66
|
-
]
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
"tool_call": true,
|
|
70
|
-
"interleaved": {
|
|
71
|
-
"field": "reasoning_content"
|
|
72
|
-
},
|
|
73
|
-
"structured_output": true,
|
|
74
|
-
"temperature": false,
|
|
75
|
-
"release_date": "2026-07-16",
|
|
76
|
-
"last_updated": "2026-07-16",
|
|
77
|
-
"modalities": {
|
|
78
|
-
"input": [
|
|
79
|
-
"text",
|
|
80
|
-
"image",
|
|
81
|
-
"video"
|
|
82
|
-
],
|
|
83
|
-
"output": [
|
|
84
|
-
"text"
|
|
85
|
-
]
|
|
86
|
-
},
|
|
87
|
-
"open_weights": true,
|
|
88
|
-
"limit": {
|
|
89
|
-
"context": 1048576,
|
|
90
|
-
"output": 131072
|
|
91
|
-
},
|
|
92
|
-
"cost": {
|
|
93
|
-
"input": 3,
|
|
94
|
-
"output": 15,
|
|
95
|
-
"cache_read": 0.3
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
"kimi-k2-0711-preview": {
|
|
99
|
-
"id": "kimi-k2-0711-preview",
|
|
100
|
-
"name": "Kimi K2 0711",
|
|
101
|
-
"description": "Kimi model for long-context chat, coding, and agentic reasoning",
|
|
102
|
-
"family": "kimi-k2",
|
|
103
|
-
"attachment": false,
|
|
104
|
-
"reasoning": false,
|
|
105
|
-
"tool_call": true,
|
|
106
|
-
"temperature": true,
|
|
107
|
-
"knowledge": "2024-10",
|
|
108
|
-
"release_date": "2025-07-14",
|
|
109
|
-
"last_updated": "2025-07-14",
|
|
110
|
-
"modalities": {
|
|
111
|
-
"input": [
|
|
112
|
-
"text"
|
|
113
|
-
],
|
|
114
|
-
"output": [
|
|
115
|
-
"text"
|
|
116
|
-
]
|
|
117
|
-
},
|
|
118
|
-
"open_weights": true,
|
|
119
|
-
"limit": {
|
|
120
|
-
"context": 131072,
|
|
121
|
-
"output": 16384
|
|
122
|
-
},
|
|
123
|
-
"cost": {
|
|
124
|
-
"input": 0.6,
|
|
125
|
-
"output": 2.5,
|
|
126
|
-
"cache_read": 0.15
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
"kimi-k2-thinking-turbo": {
|
|
130
|
-
"id": "kimi-k2-thinking-turbo",
|
|
131
|
-
"name": "Kimi K2 Thinking Turbo",
|
|
132
|
-
"description": "Kimi reasoning model for long-horizon research, planning, and tool use",
|
|
133
|
-
"family": "kimi-thinking",
|
|
134
|
-
"attachment": false,
|
|
135
|
-
"reasoning": true,
|
|
136
|
-
"reasoning_options": [],
|
|
137
|
-
"tool_call": true,
|
|
138
|
-
"interleaved": {
|
|
139
|
-
"field": "reasoning_content"
|
|
140
|
-
},
|
|
141
|
-
"temperature": true,
|
|
142
|
-
"knowledge": "2024-08",
|
|
143
|
-
"release_date": "2025-11-06",
|
|
144
|
-
"last_updated": "2025-11-06",
|
|
145
|
-
"modalities": {
|
|
146
|
-
"input": [
|
|
147
|
-
"text"
|
|
148
|
-
],
|
|
149
|
-
"output": [
|
|
150
|
-
"text"
|
|
151
|
-
]
|
|
152
|
-
},
|
|
153
|
-
"open_weights": true,
|
|
154
|
-
"limit": {
|
|
155
|
-
"context": 262144,
|
|
156
|
-
"output": 262144
|
|
157
|
-
},
|
|
158
|
-
"cost": {
|
|
159
|
-
"input": 1.15,
|
|
44
|
+
"input": 1.9,
|
|
160
45
|
"output": 8,
|
|
161
|
-
"cache_read": 0.
|
|
46
|
+
"cache_read": 0.38
|
|
162
47
|
}
|
|
163
48
|
},
|
|
164
|
-
"kimi-k2.
|
|
165
|
-
"id": "kimi-k2.
|
|
166
|
-
"name": "Kimi K2.
|
|
167
|
-
"description": "
|
|
49
|
+
"kimi-k2.6": {
|
|
50
|
+
"id": "kimi-k2.6",
|
|
51
|
+
"name": "Kimi K2.6",
|
|
52
|
+
"description": "Multimodal Kimi workhorse for agent loops, coding tasks, and visual context",
|
|
168
53
|
"family": "kimi-k2",
|
|
169
|
-
"attachment":
|
|
54
|
+
"attachment": true,
|
|
170
55
|
"reasoning": true,
|
|
171
56
|
"reasoning_options": [
|
|
172
57
|
{
|
|
@@ -178,10 +63,10 @@
|
|
|
178
63
|
"field": "reasoning_content"
|
|
179
64
|
},
|
|
180
65
|
"structured_output": true,
|
|
181
|
-
"temperature":
|
|
66
|
+
"temperature": true,
|
|
182
67
|
"knowledge": "2025-01",
|
|
183
|
-
"release_date": "2026-
|
|
184
|
-
"last_updated": "2026-
|
|
68
|
+
"release_date": "2026-04-21",
|
|
69
|
+
"last_updated": "2026-04-21",
|
|
185
70
|
"modalities": {
|
|
186
71
|
"input": [
|
|
187
72
|
"text",
|
|
@@ -198,76 +83,14 @@
|
|
|
198
83
|
"output": 262144
|
|
199
84
|
},
|
|
200
85
|
"cost": {
|
|
201
|
-
"input": 0.
|
|
202
|
-
"output":
|
|
203
|
-
"cache_read": 0.
|
|
204
|
-
}
|
|
205
|
-
},
|
|
206
|
-
"kimi-k2-0905-preview": {
|
|
207
|
-
"id": "kimi-k2-0905-preview",
|
|
208
|
-
"name": "Kimi K2 0905",
|
|
209
|
-
"description": "Kimi model for long-context chat, coding, and agentic reasoning",
|
|
210
|
-
"family": "kimi-k2",
|
|
211
|
-
"attachment": false,
|
|
212
|
-
"reasoning": false,
|
|
213
|
-
"tool_call": true,
|
|
214
|
-
"temperature": true,
|
|
215
|
-
"knowledge": "2024-10",
|
|
216
|
-
"release_date": "2025-09-05",
|
|
217
|
-
"last_updated": "2025-09-05",
|
|
218
|
-
"modalities": {
|
|
219
|
-
"input": [
|
|
220
|
-
"text"
|
|
221
|
-
],
|
|
222
|
-
"output": [
|
|
223
|
-
"text"
|
|
224
|
-
]
|
|
225
|
-
},
|
|
226
|
-
"open_weights": true,
|
|
227
|
-
"limit": {
|
|
228
|
-
"context": 262144,
|
|
229
|
-
"output": 262144
|
|
230
|
-
},
|
|
231
|
-
"cost": {
|
|
232
|
-
"input": 0.6,
|
|
233
|
-
"output": 2.5,
|
|
234
|
-
"cache_read": 0.15
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
"kimi-k2-turbo-preview": {
|
|
238
|
-
"id": "kimi-k2-turbo-preview",
|
|
239
|
-
"name": "Kimi K2 Turbo",
|
|
240
|
-
"description": "Fast Kimi model for responsive chat, coding help, and agent loops",
|
|
241
|
-
"family": "kimi-k2",
|
|
242
|
-
"attachment": false,
|
|
243
|
-
"reasoning": false,
|
|
244
|
-
"tool_call": true,
|
|
245
|
-
"temperature": true,
|
|
246
|
-
"knowledge": "2024-10",
|
|
247
|
-
"release_date": "2025-09-05",
|
|
248
|
-
"last_updated": "2025-09-05",
|
|
249
|
-
"modalities": {
|
|
250
|
-
"input": [
|
|
251
|
-
"text"
|
|
252
|
-
],
|
|
253
|
-
"output": [
|
|
254
|
-
"text"
|
|
255
|
-
]
|
|
256
|
-
},
|
|
257
|
-
"open_weights": true,
|
|
258
|
-
"limit": {
|
|
259
|
-
"context": 262144,
|
|
260
|
-
"output": 262144
|
|
261
|
-
},
|
|
262
|
-
"cost": {
|
|
263
|
-
"input": 2.4,
|
|
264
|
-
"output": 10,
|
|
265
|
-
"cache_read": 0.6
|
|
86
|
+
"input": 0.95,
|
|
87
|
+
"output": 4,
|
|
88
|
+
"cache_read": 0.16
|
|
266
89
|
}
|
|
267
90
|
},
|
|
268
|
-
"kimi-k2.7-code
|
|
269
|
-
"id": "kimi-k2.7-code
|
|
270
|
-
"name": "Kimi K2.7 Code
|
|
91
|
+
"kimi-k2.7-code": {
|
|
92
|
+
"id": "kimi-k2.7-code",
|
|
93
|
+
"name": "Kimi K2.7 Code",
|
|
271
94
|
"description": "Coding-focused Kimi model, stronger on long-horizon repo work with less overthinking",
|
|
272
95
|
"family": "kimi-k2",
|
|
273
96
|
"attachment": true,
|
|
@@ -298,56 +121,29 @@
|
|
|
298
121
|
"output": 262144
|
|
299
122
|
},
|
|
300
123
|
"cost": {
|
|
301
|
-
"input":
|
|
302
|
-
"output":
|
|
303
|
-
"cache_read": 0.
|
|
304
|
-
}
|
|
305
|
-
},
|
|
306
|
-
"kimi-k2-thinking": {
|
|
307
|
-
"id": "kimi-k2-thinking",
|
|
308
|
-
"name": "Kimi K2 Thinking",
|
|
309
|
-
"description": "Thinking Kimi model for slower research passes, planning, and hard technical questions",
|
|
310
|
-
"family": "kimi-thinking",
|
|
311
|
-
"attachment": false,
|
|
312
|
-
"reasoning": true,
|
|
313
|
-
"reasoning_options": [],
|
|
314
|
-
"tool_call": true,
|
|
315
|
-
"interleaved": {
|
|
316
|
-
"field": "reasoning_content"
|
|
317
|
-
},
|
|
318
|
-
"temperature": true,
|
|
319
|
-
"knowledge": "2024-08",
|
|
320
|
-
"release_date": "2025-11-06",
|
|
321
|
-
"last_updated": "2025-11-06",
|
|
322
|
-
"modalities": {
|
|
323
|
-
"input": [
|
|
324
|
-
"text"
|
|
325
|
-
],
|
|
326
|
-
"output": [
|
|
327
|
-
"text"
|
|
328
|
-
]
|
|
329
|
-
},
|
|
330
|
-
"open_weights": true,
|
|
331
|
-
"limit": {
|
|
332
|
-
"context": 262144,
|
|
333
|
-
"output": 262144
|
|
334
|
-
},
|
|
335
|
-
"cost": {
|
|
336
|
-
"input": 0.6,
|
|
337
|
-
"output": 2.5,
|
|
338
|
-
"cache_read": 0.15
|
|
124
|
+
"input": 0.95,
|
|
125
|
+
"output": 4,
|
|
126
|
+
"cache_read": 0.19
|
|
339
127
|
}
|
|
340
128
|
},
|
|
341
|
-
"kimi-
|
|
342
|
-
"id": "kimi-
|
|
343
|
-
"name": "Kimi
|
|
344
|
-
"description": "Multimodal Kimi
|
|
345
|
-
"family": "kimi-
|
|
129
|
+
"kimi-k3": {
|
|
130
|
+
"id": "kimi-k3",
|
|
131
|
+
"name": "Kimi K3",
|
|
132
|
+
"description": "Multimodal Kimi model with 1M context and toggleable max-effort thinking for long-horizon agent work",
|
|
133
|
+
"family": "kimi-k3",
|
|
346
134
|
"attachment": true,
|
|
347
135
|
"reasoning": true,
|
|
348
136
|
"reasoning_options": [
|
|
349
137
|
{
|
|
350
138
|
"type": "toggle"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"type": "effort",
|
|
142
|
+
"values": [
|
|
143
|
+
"low",
|
|
144
|
+
"high",
|
|
145
|
+
"max"
|
|
146
|
+
]
|
|
351
147
|
}
|
|
352
148
|
],
|
|
353
149
|
"tool_call": true,
|
|
@@ -355,10 +151,9 @@
|
|
|
355
151
|
"field": "reasoning_content"
|
|
356
152
|
},
|
|
357
153
|
"structured_output": true,
|
|
358
|
-
"temperature":
|
|
359
|
-
"
|
|
360
|
-
"
|
|
361
|
-
"last_updated": "2026-04-21",
|
|
154
|
+
"temperature": false,
|
|
155
|
+
"release_date": "2026-07-16",
|
|
156
|
+
"last_updated": "2026-07-16",
|
|
362
157
|
"modalities": {
|
|
363
158
|
"input": [
|
|
364
159
|
"text",
|
|
@@ -371,13 +166,13 @@
|
|
|
371
166
|
},
|
|
372
167
|
"open_weights": true,
|
|
373
168
|
"limit": {
|
|
374
|
-
"context":
|
|
375
|
-
"output":
|
|
169
|
+
"context": 1048576,
|
|
170
|
+
"output": 131072
|
|
376
171
|
},
|
|
377
172
|
"cost": {
|
|
378
|
-
"input":
|
|
379
|
-
"output":
|
|
380
|
-
"cache_read": 0.
|
|
173
|
+
"input": 3,
|
|
174
|
+
"output": 15,
|
|
175
|
+
"cache_read": 0.3
|
|
381
176
|
}
|
|
382
177
|
}
|
|
383
178
|
}
|