llm.rb 15.1.0 → 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.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +296 -11
  3. data/README.md +68 -43
  4. data/bin/llm.rb +12 -4
  5. data/data/alibaba.json +912 -823
  6. data/data/anthropic.json +234 -187
  7. data/data/bedrock.json +3611 -2217
  8. data/data/deepinfra.json +1164 -989
  9. data/data/deepseek.json +65 -81
  10. data/data/google.json +668 -666
  11. data/data/mistral.json +501 -460
  12. data/data/moonshot.json +43 -248
  13. data/data/openai.json +1008 -914
  14. data/data/openrouter.json +7798 -7661
  15. data/data/xai.json +194 -194
  16. data/data/zai.json +242 -149
  17. data/docs/deepdive/advanced/compaction.md +5 -5
  18. data/docs/deepdive/advanced/guard.md +2 -2
  19. data/docs/deepdive/features/builtin_tools.md +93 -22
  20. data/docs/deepdive/features/{repl.md → console.md} +28 -28
  21. data/docs/deepdive/features/database.md +3 -3
  22. data/docs/deepdive/fundamentals/agents.md +2 -2
  23. data/docs/deepdive/fundamentals/providers.md +91 -6
  24. data/docs/deepdive/fundamentals/skills.md +14 -6
  25. data/docs/deepdive/fundamentals/tools.md +63 -31
  26. data/docs/deepdive/reference/cost.md +2 -2
  27. data/docs/deepdive/reference/model_registry.md +2 -2
  28. data/docs/deepdive/reference/tracer.md +15 -13
  29. data/docs/deepdive.md +2 -2
  30. data/lib/llm/active_record/acts_as_agent.rb +9 -5
  31. data/lib/llm/agent.rb +34 -15
  32. data/lib/llm/{repl → console}/bar.rb +3 -3
  33. data/lib/llm/{repl → console}/buffer.rb +4 -4
  34. data/lib/llm/{repl → console}/color.rb +2 -2
  35. data/lib/llm/{repl → console}/command.rb +12 -12
  36. data/lib/llm/{repl → console}/commands/exit.rb +4 -4
  37. data/lib/llm/{repl → console}/commands/help.rb +1 -1
  38. data/lib/llm/{repl/commands/compact.rb → console/commands/keep.rb} +11 -9
  39. data/lib/llm/{repl → console}/commands/model.rb +2 -2
  40. data/lib/llm/{repl → console}/input/cache.rb +2 -2
  41. data/lib/llm/{repl → console}/input/char.rb +2 -2
  42. data/lib/llm/{repl → console}/input/row.rb +1 -1
  43. data/lib/llm/{repl → console}/input.rb +13 -6
  44. data/lib/llm/console/markdown/parser.rb +78 -0
  45. data/lib/llm/{repl → console}/markdown/table.rb +3 -3
  46. data/lib/llm/{repl → console}/markdown.rb +13 -30
  47. data/lib/llm/{repl → console}/node.rb +3 -3
  48. data/lib/llm/{repl → console}/status.rb +11 -11
  49. data/lib/llm/{repl → console}/stream.rb +9 -9
  50. data/lib/llm/{repl → console}/walker.rb +1 -1
  51. data/lib/llm/{repl → console}/window.rb +10 -10
  52. data/lib/llm/{repl.rb → console.rb} +38 -19
  53. data/lib/llm/context/deserializer.rb +2 -1
  54. data/lib/llm/context.rb +1 -0
  55. data/lib/llm/function/async/reactor.rb +20 -1
  56. data/lib/llm/function.rb +1 -1
  57. data/lib/llm/json_adapter.rb +40 -28
  58. data/lib/llm/message.rb +7 -0
  59. data/lib/llm/provider.rb +2 -2
  60. data/lib/llm/providers/alibaba.rb +1 -1
  61. data/lib/llm/providers/deepseek.rb +1 -1
  62. data/lib/llm/providers/openai.rb +1 -0
  63. data/lib/llm/schema/leaf.rb +34 -2
  64. data/lib/llm/schema.rb +4 -2
  65. data/lib/llm/sequel/agent.rb +9 -5
  66. data/lib/llm/tool/param.rb +5 -1
  67. data/lib/llm/tool.rb +5 -0
  68. data/lib/llm/tools/bundle.rb +53 -0
  69. data/lib/llm/tools/edit-file.rb +7 -2
  70. data/lib/llm/tools/exec.rb +78 -0
  71. data/lib/llm/tools/git.rb +27 -26
  72. data/lib/llm/tools/mkdir.rb +12 -19
  73. data/lib/llm/tools/read_file.rb +69 -9
  74. data/lib/llm/tools/rg.rb +20 -24
  75. data/lib/llm/tools/ruby.rb +17 -25
  76. data/lib/llm/tools/utils.rb +74 -1
  77. data/lib/llm/tools/write_file.rb +4 -1
  78. data/lib/llm/tracer/logger.rb +2 -2
  79. data/lib/llm/tracer/pretty_logger.rb +4 -4
  80. data/lib/llm/tracer/telemetry.rb +2 -2
  81. data/lib/llm/tracer.rb +33 -0
  82. data/lib/llm/transport/utils.rb +1 -1
  83. data/lib/llm/version.rb +1 -1
  84. data/lib/llm.rb +4 -13
  85. data/llm.gemspec +7 -8
  86. metadata +64 -37
  87. data/lib/llm/tools/shell.rb +0 -55
data/data/deepseek.json CHANGED
@@ -8,12 +8,12 @@
8
8
  "name": "DeepSeek",
9
9
  "doc": "https://api-docs.deepseek.com/quick_start/pricing",
10
10
  "models": {
11
- "deepseek-v4-flash": {
12
- "id": "deepseek-v4-flash",
13
- "name": "DeepSeek V4 Flash",
14
- "description": "Official DeepSeek V4 Flash release with enhanced agentic capabilities and integrated DSpark speculative decoding",
11
+ "deepseek-v4-flash-vision-exp": {
12
+ "id": "deepseek-v4-flash-vision-exp",
13
+ "name": "DeepSeek V4 Flash Vision Exp",
14
+ "description": "DeepSeek V4.1 Flash model for reasoning and agentic coding",
15
15
  "family": "deepseek-flash",
16
- "attachment": false,
16
+ "attachment": true,
17
17
  "reasoning": true,
18
18
  "reasoning_options": [
19
19
  {
@@ -35,11 +35,12 @@
35
35
  "structured_output": true,
36
36
  "temperature": true,
37
37
  "knowledge": "2025-05",
38
- "release_date": "2026-07-31",
39
- "last_updated": "2026-07-31",
38
+ "release_date": "2026-09-10",
39
+ "last_updated": "2026-09-10",
40
40
  "modalities": {
41
41
  "input": [
42
- "text"
42
+ "text",
43
+ "image"
43
44
  ],
44
45
  "output": [
45
46
  "text"
@@ -51,18 +52,18 @@
51
52
  "output": 384000
52
53
  },
53
54
  "cost": {
54
- "input": 0.14,
55
- "output": 0.28,
56
- "reasoning": 0.28,
57
- "cache_read": 0.0028
55
+ "input": 0.15,
56
+ "output": 0.6,
57
+ "reasoning": 0.6,
58
+ "cache_read": 0.003
58
59
  }
59
60
  },
60
- "deepseek-v4-pro": {
61
- "id": "deepseek-v4-pro",
62
- "name": "DeepSeek V4 Pro",
63
- "description": "DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes",
64
- "family": "deepseek-thinking",
65
- "attachment": false,
61
+ "deepseek-v4-flash": {
62
+ "id": "deepseek-v4-flash",
63
+ "name": "DeepSeek V4 Flash",
64
+ "description": "DeepSeek V4.1 Flash model for reasoning and agentic coding",
65
+ "family": "deepseek-flash",
66
+ "attachment": true,
66
67
  "reasoning": true,
67
68
  "reasoning_options": [
68
69
  {
@@ -71,6 +72,7 @@
71
72
  {
72
73
  "type": "effort",
73
74
  "values": [
75
+ "low",
74
76
  "high",
75
77
  "max"
76
78
  ]
@@ -82,43 +84,13 @@
82
84
  },
83
85
  "structured_output": true,
84
86
  "temperature": true,
85
- "release_date": "2026-08-12",
86
- "last_updated": "2026-08-12",
87
- "modalities": {
88
- "input": [
89
- "text"
90
- ],
91
- "output": [
92
- "text"
93
- ]
94
- },
95
- "open_weights": false,
96
- "limit": {
97
- "context": 1000000,
98
- "output": 384000
99
- },
100
- "cost": {
101
- "input": 0.435,
102
- "output": 0.87,
103
- "reasoning": 0.87,
104
- "cache_read": 0.003625
105
- }
106
- },
107
- "deepseek-chat": {
108
- "id": "deepseek-chat",
109
- "name": "DeepSeek Chat",
110
- "description": "DeepSeek chat model for instruction following, coding, and analysis",
111
- "family": "deepseek",
112
- "attachment": true,
113
- "reasoning": false,
114
- "tool_call": true,
115
- "temperature": true,
116
- "knowledge": "2025-09",
117
- "release_date": "2025-12-01",
118
- "last_updated": "2026-02-28",
87
+ "knowledge": "2025-05",
88
+ "release_date": "2026-09-10",
89
+ "last_updated": "2026-09-10",
119
90
  "modalities": {
120
91
  "input": [
121
- "text"
92
+ "text",
93
+ "image"
122
94
  ],
123
95
  "output": [
124
96
  "text"
@@ -130,27 +102,39 @@
130
102
  "output": 384000
131
103
  },
132
104
  "cost": {
133
- "input": 0.14,
134
- "output": 0.28,
135
- "cache_read": 0.0028
105
+ "input": 0.15,
106
+ "output": 0.6,
107
+ "reasoning": 0.6,
108
+ "cache_read": 0.003
136
109
  }
137
110
  },
138
- "deepseek-reasoner": {
139
- "id": "deepseek-reasoner",
140
- "name": "DeepSeek Reasoner",
141
- "description": "DeepSeek reasoning model for multi-step analysis, math, coding, and tools",
111
+ "deepseek-v4-pro": {
112
+ "id": "deepseek-v4-pro",
113
+ "name": "DeepSeek V4 Pro",
114
+ "description": "DeepSeek V4 Pro snapshot with million-token context and support for thinking and non-thinking modes",
142
115
  "family": "deepseek-thinking",
143
- "attachment": true,
116
+ "attachment": false,
144
117
  "reasoning": true,
145
- "reasoning_options": [],
118
+ "reasoning_options": [
119
+ {
120
+ "type": "toggle"
121
+ },
122
+ {
123
+ "type": "effort",
124
+ "values": [
125
+ "high",
126
+ "max"
127
+ ]
128
+ }
129
+ ],
146
130
  "tool_call": true,
147
131
  "interleaved": {
148
132
  "field": "reasoning_content"
149
133
  },
134
+ "structured_output": true,
150
135
  "temperature": true,
151
- "knowledge": "2025-09",
152
- "release_date": "2025-12-01",
153
- "last_updated": "2026-02-28",
136
+ "release_date": "2026-08-12",
137
+ "last_updated": "2026-08-22",
154
138
  "modalities": {
155
139
  "input": [
156
140
  "text"
@@ -165,16 +149,16 @@
165
149
  "output": 384000
166
150
  },
167
151
  "cost": {
168
- "input": 0.14,
169
- "output": 0.28,
170
- "reasoning": 0.28,
171
- "cache_read": 0.0028
152
+ "input": 0.435,
153
+ "output": 0.87,
154
+ "reasoning": 0.87,
155
+ "cache_read": 0.003625
172
156
  }
173
157
  },
174
- "deepseek-v4-flash-vision-exp": {
175
- "id": "deepseek-v4-flash-vision-exp",
176
- "name": "DeepSeek V4 Flash Vision Exp",
177
- "description": "Experimental multimodal DeepSeek V4 Flash model for image understanding, coding, and agentic work",
158
+ "deepseek-flash": {
159
+ "id": "deepseek-flash",
160
+ "name": "DeepSeek V4.1 Flash",
161
+ "description": "DeepSeek V4.1 Flash model for reasoning and agentic coding",
178
162
  "family": "deepseek-flash",
179
163
  "attachment": true,
180
164
  "reasoning": true,
@@ -197,8 +181,9 @@
197
181
  },
198
182
  "structured_output": true,
199
183
  "temperature": true,
200
- "release_date": "2026-08-21",
201
- "last_updated": "2026-08-21",
184
+ "knowledge": "2025-05",
185
+ "release_date": "2026-09-10",
186
+ "last_updated": "2026-09-10",
202
187
  "modalities": {
203
188
  "input": [
204
189
  "text",
@@ -208,17 +193,16 @@
208
193
  "text"
209
194
  ]
210
195
  },
211
- "open_weights": false,
196
+ "open_weights": true,
212
197
  "limit": {
213
198
  "context": 1000000,
214
199
  "output": 384000
215
200
  },
216
- "status": "beta",
217
201
  "cost": {
218
- "input": 0.14,
219
- "output": 0.28,
220
- "reasoning": 0.28,
221
- "cache_read": 0.0028
202
+ "input": 0.15,
203
+ "output": 0.6,
204
+ "reasoning": 0.6,
205
+ "cache_read": 0.003
222
206
  }
223
207
  }
224
208
  }