llm.rb 12.0.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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +193 -1
  3. data/LICENSE +5 -4
  4. data/README.md +56 -18
  5. data/data/anthropic.json +85 -372
  6. data/data/bedrock.json +498 -3
  7. data/data/deepinfra.json +567 -47
  8. data/data/deepseek.json +4 -0
  9. data/data/google.json +54 -0
  10. data/data/mistral.json +968 -0
  11. data/data/openai.json +51 -0
  12. data/data/xai.json +67 -0
  13. data/data/zai.json +14 -0
  14. data/lib/llm/agent.rb +41 -1
  15. data/lib/llm/context.rb +9 -1
  16. data/lib/llm/function.rb +6 -0
  17. data/lib/llm/json_adapter.rb +29 -3
  18. data/lib/llm/provider.rb +3 -3
  19. data/lib/llm/providers/anthropic.rb +2 -2
  20. data/lib/llm/providers/google.rb +3 -1
  21. data/lib/llm/providers/llamacpp.rb +5 -5
  22. data/lib/llm/providers/mistral/request_adapter/completion.rb +122 -0
  23. data/lib/llm/providers/mistral/request_adapter.rb +20 -0
  24. data/lib/llm/providers/mistral.rb +96 -0
  25. data/lib/llm/repl/input.rb +64 -0
  26. data/lib/llm/repl/status.rb +30 -0
  27. data/lib/llm/repl/stream.rb +46 -0
  28. data/lib/llm/repl/transcript.rb +61 -0
  29. data/lib/llm/repl/window.rb +107 -0
  30. data/lib/llm/repl.rb +78 -0
  31. data/lib/llm/tools/chdir.rb +23 -0
  32. data/lib/llm/tools/git.rb +41 -0
  33. data/lib/llm/tools/mkdir.rb +32 -0
  34. data/lib/llm/tools/pwd.rb +20 -0
  35. data/lib/llm/tools/read_file.rb +40 -0
  36. data/lib/llm/tools/rg.rb +46 -0
  37. data/lib/llm/tools/shell.rb +48 -0
  38. data/lib/llm/tools/swap_text.rb +25 -0
  39. data/lib/llm/tools/write_file.rb +24 -0
  40. data/lib/llm/tools.rb +5 -0
  41. data/lib/llm/version.rb +1 -1
  42. data/lib/llm.rb +9 -0
  43. data/llm.gemspec +1 -1
  44. data/resources/deepdive.md +32 -0
  45. metadata +22 -2
data/data/deepseek.json CHANGED
@@ -11,6 +11,7 @@
11
11
  "deepseek-v4-flash": {
12
12
  "id": "deepseek-v4-flash",
13
13
  "name": "DeepSeek V4 Flash",
14
+ "description": "Fast DeepSeek V4 lane for economical reasoning, coding, and long-context work",
14
15
  "family": "deepseek-flash",
15
16
  "attachment": false,
16
17
  "reasoning": true,
@@ -57,6 +58,7 @@
57
58
  "deepseek-v4-pro": {
58
59
  "id": "deepseek-v4-pro",
59
60
  "name": "DeepSeek V4 Pro",
61
+ "description": "Open MoE flagship with million-token context for coding and long agent runs",
60
62
  "family": "deepseek-thinking",
61
63
  "attachment": false,
62
64
  "reasoning": true,
@@ -103,6 +105,7 @@
103
105
  "deepseek-reasoner": {
104
106
  "id": "deepseek-reasoner",
105
107
  "name": "DeepSeek Reasoner",
108
+ "description": "DeepSeek reasoning model for multi-step analysis, math, coding, and tools",
106
109
  "family": "deepseek-thinking",
107
110
  "attachment": true,
108
111
  "reasoning": true,
@@ -137,6 +140,7 @@
137
140
  "deepseek-chat": {
138
141
  "id": "deepseek-chat",
139
142
  "name": "DeepSeek Chat",
143
+ "description": "DeepSeek chat model for instruction following, coding, and analysis",
140
144
  "family": "deepseek",
141
145
  "attachment": true,
142
146
  "reasoning": false,
data/data/google.json CHANGED
@@ -12,6 +12,7 @@
12
12
  "gemini-3.1-flash-lite": {
13
13
  "id": "gemini-3.1-flash-lite",
14
14
  "name": "Gemini 3.1 Flash Lite",
15
+ "description": "Low-latency Gemini model for high-volume multimodal and agent workloads",
15
16
  "family": "gemini-flash-lite",
16
17
  "attachment": true,
17
18
  "reasoning": true,
@@ -59,6 +60,7 @@
59
60
  "gemini-2.5-flash-preview-tts": {
60
61
  "id": "gemini-2.5-flash-preview-tts",
61
62
  "name": "Gemini 2.5 Flash Preview TTS",
63
+ "description": "Speech generation model for controllable voice, narration, and audio delivery",
62
64
  "family": "gemini-flash",
63
65
  "attachment": false,
64
66
  "reasoning": false,
@@ -88,6 +90,7 @@
88
90
  "gemini-2.5-pro": {
89
91
  "id": "gemini-2.5-pro",
90
92
  "name": "Gemini 2.5 Pro",
93
+ "description": "Google's proven reasoning model for coding, math, and multimodal analysis",
91
94
  "family": "gemini-pro",
92
95
  "attachment": true,
93
96
  "reasoning": true,
@@ -146,6 +149,7 @@
146
149
  "gemini-2.5-flash": {
147
150
  "id": "gemini-2.5-flash",
148
151
  "name": "Gemini 2.5 Flash",
152
+ "description": "Fast Gemini workhorse for multimodal apps where latency and price matter",
149
153
  "family": "gemini-flash",
150
154
  "attachment": true,
151
155
  "reasoning": true,
@@ -192,6 +196,7 @@
192
196
  "gemini-3.5-flash": {
193
197
  "id": "gemini-3.5-flash",
194
198
  "name": "Gemini 3.5 Flash",
199
+ "description": "Fast Gemini model balancing multimodal reasoning, tool use, and cost",
195
200
  "family": "gemini-flash",
196
201
  "attachment": true,
197
202
  "reasoning": true,
@@ -239,6 +244,7 @@
239
244
  "gemma-4-31b-it": {
240
245
  "id": "gemma-4-31b-it",
241
246
  "name": "Gemma 4 31B IT",
247
+ "description": "Largest Gemma 4 instruction model for open, self-hosted chat and reasoning",
242
248
  "family": "gemma",
243
249
  "attachment": true,
244
250
  "reasoning": true,
@@ -270,6 +276,7 @@
270
276
  "gemini-2.0-flash": {
271
277
  "id": "gemini-2.0-flash",
272
278
  "name": "Gemini 2.0 Flash",
279
+ "description": "Earlier Gemini Flash workhorse for responsive multimodal apps and tool use",
273
280
  "family": "gemini-flash",
274
281
  "attachment": true,
275
282
  "reasoning": false,
@@ -306,6 +313,7 @@
306
313
  "gemini-embedding-001": {
307
314
  "id": "gemini-embedding-001",
308
315
  "name": "Gemini Embedding 001",
316
+ "description": "Embedding model for semantic search, retrieval, clustering, and ranking pipelines",
309
317
  "family": "gemini",
310
318
  "attachment": false,
311
319
  "reasoning": false,
@@ -335,6 +343,7 @@
335
343
  "gemini-3.1-pro-preview-customtools": {
336
344
  "id": "gemini-3.1-pro-preview-customtools",
337
345
  "name": "Gemini 3.1 Pro Preview Custom Tools",
346
+ "description": "Advanced Gemini model for complex reasoning, coding, and multimodal analysis",
338
347
  "family": "gemini-pro",
339
348
  "attachment": true,
340
349
  "reasoning": true,
@@ -396,6 +405,7 @@
396
405
  "gemini-flash-lite-latest": {
397
406
  "id": "gemini-flash-lite-latest",
398
407
  "name": "Gemini Flash-Lite Latest",
408
+ "description": "Low-latency Gemini model for high-volume multimodal and agent workloads",
399
409
  "family": "gemini-flash-lite",
400
410
  "attachment": true,
401
411
  "reasoning": true,
@@ -441,6 +451,7 @@
441
451
  "gemini-3-pro-image-preview": {
442
452
  "id": "gemini-3-pro-image-preview",
443
453
  "name": "Nano Banana Pro",
454
+ "description": "Nano Banana Pro for higher-fidelity image generation and design-heavy edits",
444
455
  "family": "gemini-pro",
445
456
  "attachment": true,
446
457
  "reasoning": true,
@@ -473,6 +484,7 @@
473
484
  "gemini-2.5-flash-image": {
474
485
  "id": "gemini-2.5-flash-image",
475
486
  "name": "Nano Banana",
487
+ "description": "Nano Banana image model for fast generation, edits, and character-consistent assets",
476
488
  "family": "gemini-flash",
477
489
  "attachment": true,
478
490
  "reasoning": true,
@@ -506,6 +518,7 @@
506
518
  "gemini-2.5-flash-lite": {
507
519
  "id": "gemini-2.5-flash-lite",
508
520
  "name": "Gemini 2.5 Flash-Lite",
521
+ "description": "Lean Gemini 2.5 lane for cheap multimodal traffic and quick agents",
509
522
  "family": "gemini-flash-lite",
510
523
  "attachment": true,
511
524
  "reasoning": true,
@@ -549,9 +562,42 @@
549
562
  "input_audio": 0.3
550
563
  }
551
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
+ },
552
597
  "gemini-3.1-flash-image-preview": {
553
598
  "id": "gemini-3.1-flash-image-preview",
554
599
  "name": "Nano Banana 2",
600
+ "description": "Image model for prompt-driven generation, editing, and visual design workflows",
555
601
  "family": "gemini-flash",
556
602
  "attachment": true,
557
603
  "reasoning": true,
@@ -593,6 +639,7 @@
593
639
  "gemini-3.1-pro-preview": {
594
640
  "id": "gemini-3.1-pro-preview",
595
641
  "name": "Gemini 3.1 Pro Preview",
642
+ "description": "Reasoning-first Gemini preview for agentic coding and complex problem solving",
596
643
  "family": "gemini-pro",
597
644
  "attachment": true,
598
645
  "reasoning": true,
@@ -654,6 +701,7 @@
654
701
  "gemma-4-26b-a4b-it": {
655
702
  "id": "gemma-4-26b-a4b-it",
656
703
  "name": "Gemma 4 26B A4B IT",
704
+ "description": "Open Gemma instruction model for efficient chat and self-hosted deployments",
657
705
  "family": "gemma",
658
706
  "attachment": true,
659
707
  "reasoning": true,
@@ -685,6 +733,7 @@
685
733
  "gemini-3-pro-preview": {
686
734
  "id": "gemini-3-pro-preview",
687
735
  "name": "Gemini 3 Pro Preview",
736
+ "description": "Preview Gemini flagship for complex reasoning, coding, and rich multimodal prompts",
688
737
  "family": "gemini-pro",
689
738
  "attachment": true,
690
739
  "reasoning": true,
@@ -746,6 +795,7 @@
746
795
  "gemini-3-flash-preview": {
747
796
  "id": "gemini-3-flash-preview",
748
797
  "name": "Gemini 3 Flash Preview",
798
+ "description": "New Gemini flash lane bringing frontier-style multimodal reasoning to cheaper runs",
749
799
  "family": "gemini-flash",
750
800
  "attachment": true,
751
801
  "reasoning": true,
@@ -793,6 +843,7 @@
793
843
  "gemini-2.5-pro-preview-tts": {
794
844
  "id": "gemini-2.5-pro-preview-tts",
795
845
  "name": "Gemini 2.5 Pro Preview TTS",
846
+ "description": "Speech generation model for controllable voice, narration, and audio delivery",
796
847
  "family": "gemini-flash",
797
848
  "attachment": false,
798
849
  "reasoning": false,
@@ -822,6 +873,7 @@
822
873
  "gemini-flash-latest": {
823
874
  "id": "gemini-flash-latest",
824
875
  "name": "Gemini Flash Latest",
876
+ "description": "Fast Gemini model balancing multimodal reasoning, tool use, and cost",
825
877
  "family": "gemini-flash",
826
878
  "attachment": true,
827
879
  "reasoning": true,
@@ -868,6 +920,7 @@
868
920
  "gemini-3.1-flash-lite-preview": {
869
921
  "id": "gemini-3.1-flash-lite-preview",
870
922
  "name": "Gemini 3.1 Flash Lite Preview",
923
+ "description": "Legacy model retained for compatibility with older integrations",
871
924
  "family": "gemini-flash-lite",
872
925
  "attachment": true,
873
926
  "reasoning": true,
@@ -916,6 +969,7 @@
916
969
  "gemini-2.0-flash-lite": {
917
970
  "id": "gemini-2.0-flash-lite",
918
971
  "name": "Gemini 2.0 Flash-Lite",
972
+ "description": "Legacy model retained for compatibility with older integrations",
919
973
  "family": "gemini-flash-lite",
920
974
  "attachment": true,
921
975
  "reasoning": false,