ruby_llm_swarm 1.9.1 → 1.9.3
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/lib/ruby_llm/active_record/acts_as.rb +130 -128
- data/lib/ruby_llm/active_record/acts_as_legacy.rb +301 -299
- data/lib/ruby_llm/active_record/chat_methods.rb +278 -276
- data/lib/ruby_llm/active_record/message_methods.rb +60 -58
- data/lib/ruby_llm/active_record/model_methods.rb +68 -66
- data/lib/ruby_llm/aliases.json +3 -287
- data/lib/ruby_llm/connection.rb +2 -1
- data/lib/ruby_llm/models.json +1906 -30771
- data/lib/ruby_llm/provider.rb +2 -0
- data/lib/ruby_llm/railtie.rb +4 -0
- data/lib/ruby_llm/version.rb +1 -1
- data/lib/ruby_llm.rb +30 -1
- metadata +1 -1
|
@@ -1,80 +1,82 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
module
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
if defined?(ActiveRecord::Base)
|
|
4
|
+
module RubyLLM
|
|
5
|
+
module ActiveRecord
|
|
6
|
+
# Methods mixed into message models.
|
|
7
|
+
module MessageMethods
|
|
8
|
+
extend ActiveSupport::Concern
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
class_methods do
|
|
11
|
+
attr_reader :chat_class, :tool_call_class, :chat_foreign_key, :tool_call_foreign_key
|
|
12
|
+
end
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
def to_llm
|
|
15
|
+
cached = has_attribute?(:cached_tokens) ? self[:cached_tokens] : nil
|
|
16
|
+
cache_creation = has_attribute?(:cache_creation_tokens) ? self[:cache_creation_tokens] : nil
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
RubyLLM::Message.new(
|
|
19
|
+
role: role.to_sym,
|
|
20
|
+
content: extract_content,
|
|
21
|
+
tool_calls: extract_tool_calls,
|
|
22
|
+
tool_call_id: extract_tool_call_id,
|
|
23
|
+
input_tokens: input_tokens,
|
|
24
|
+
output_tokens: output_tokens,
|
|
25
|
+
cached_tokens: cached,
|
|
26
|
+
cache_creation_tokens: cache_creation,
|
|
27
|
+
model_id: model_association&.model_id
|
|
28
|
+
)
|
|
29
|
+
end
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
private
|
|
31
32
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
def extract_tool_calls
|
|
34
|
+
tool_calls_association.to_h do |tool_call|
|
|
35
|
+
[
|
|
36
|
+
tool_call.tool_call_id,
|
|
37
|
+
RubyLLM::ToolCall.new(
|
|
38
|
+
id: tool_call.tool_call_id,
|
|
39
|
+
name: tool_call.name,
|
|
40
|
+
arguments: tool_call.arguments
|
|
41
|
+
)
|
|
42
|
+
]
|
|
43
|
+
end
|
|
42
44
|
end
|
|
43
|
-
end
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
def extract_tool_call_id
|
|
47
|
+
parent_tool_call&.tool_call_id
|
|
48
|
+
end
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
def extract_content
|
|
51
|
+
return RubyLLM::Content::Raw.new(content_raw) if has_attribute?(:content_raw) && content_raw.present?
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
content_value = self[:content]
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
return content_value unless respond_to?(:attachments) && attachments.attached?
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
RubyLLM::Content.new(content_value).tap do |content_obj|
|
|
58
|
+
@_tempfiles = []
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
attachments.each do |attachment|
|
|
61
|
+
tempfile = download_attachment(attachment)
|
|
62
|
+
content_obj.add_attachment(tempfile, filename: attachment.filename.to_s)
|
|
63
|
+
end
|
|
62
64
|
end
|
|
63
65
|
end
|
|
64
|
-
end
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
def download_attachment(attachment)
|
|
68
|
+
ext = File.extname(attachment.filename.to_s)
|
|
69
|
+
basename = File.basename(attachment.filename.to_s, ext)
|
|
70
|
+
tempfile = Tempfile.new([basename, ext])
|
|
71
|
+
tempfile.binmode
|
|
71
72
|
|
|
72
|
-
|
|
73
|
+
attachment.download { |chunk| tempfile.write(chunk) }
|
|
73
74
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
tempfile.flush
|
|
76
|
+
tempfile.rewind
|
|
77
|
+
@_tempfiles << tempfile
|
|
78
|
+
tempfile
|
|
79
|
+
end
|
|
78
80
|
end
|
|
79
81
|
end
|
|
80
82
|
end
|
|
@@ -1,84 +1,86 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
module
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
if defined?(ActiveRecord::Base)
|
|
4
|
+
module RubyLLM
|
|
5
|
+
module ActiveRecord
|
|
6
|
+
# Methods mixed into model registry models.
|
|
7
|
+
module ModelMethods
|
|
8
|
+
extend ActiveSupport::Concern
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
class_methods do # rubocop:disable Metrics/BlockLength
|
|
11
|
+
def refresh!
|
|
12
|
+
RubyLLM.models.refresh!
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
transaction do
|
|
15
|
+
RubyLLM.models.all.each do |model_info|
|
|
16
|
+
model = find_or_initialize_by(
|
|
17
|
+
model_id: model_info.id,
|
|
18
|
+
provider: model_info.provider
|
|
19
|
+
)
|
|
20
|
+
model.update!(from_llm_attributes(model_info))
|
|
21
|
+
end
|
|
20
22
|
end
|
|
21
23
|
end
|
|
22
|
-
end
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
def save_to_database
|
|
26
|
+
transaction do
|
|
27
|
+
RubyLLM.models.all.each do |model_info|
|
|
28
|
+
model = find_or_initialize_by(
|
|
29
|
+
model_id: model_info.id,
|
|
30
|
+
provider: model_info.provider
|
|
31
|
+
)
|
|
32
|
+
model.update!(from_llm_attributes(model_info))
|
|
33
|
+
end
|
|
32
34
|
end
|
|
33
35
|
end
|
|
34
|
-
end
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
def from_llm(model_info)
|
|
38
|
+
new(from_llm_attributes(model_info))
|
|
39
|
+
end
|
|
39
40
|
|
|
40
|
-
|
|
41
|
+
private
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
def from_llm_attributes(model_info)
|
|
44
|
+
{
|
|
45
|
+
model_id: model_info.id,
|
|
46
|
+
name: model_info.name,
|
|
47
|
+
provider: model_info.provider,
|
|
48
|
+
family: model_info.family,
|
|
49
|
+
model_created_at: model_info.created_at,
|
|
50
|
+
context_window: model_info.context_window,
|
|
51
|
+
max_output_tokens: model_info.max_output_tokens,
|
|
52
|
+
knowledge_cutoff: model_info.knowledge_cutoff,
|
|
53
|
+
modalities: model_info.modalities.to_h,
|
|
54
|
+
capabilities: model_info.capabilities,
|
|
55
|
+
pricing: model_info.pricing.to_h,
|
|
56
|
+
metadata: model_info.metadata
|
|
57
|
+
}
|
|
58
|
+
end
|
|
57
59
|
end
|
|
58
|
-
end
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
def to_llm
|
|
62
|
+
RubyLLM::Model::Info.new(
|
|
63
|
+
id: model_id,
|
|
64
|
+
name: name,
|
|
65
|
+
provider: provider,
|
|
66
|
+
family: family,
|
|
67
|
+
created_at: model_created_at,
|
|
68
|
+
context_window: context_window,
|
|
69
|
+
max_output_tokens: max_output_tokens,
|
|
70
|
+
knowledge_cutoff: knowledge_cutoff,
|
|
71
|
+
modalities: modalities&.deep_symbolize_keys || {},
|
|
72
|
+
capabilities: capabilities,
|
|
73
|
+
pricing: pricing&.deep_symbolize_keys || {},
|
|
74
|
+
metadata: metadata&.deep_symbolize_keys || {}
|
|
75
|
+
)
|
|
76
|
+
end
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
delegate :supports?, :supports_vision?, :supports_functions?, :type,
|
|
79
|
+
:input_price_per_million, :output_price_per_million,
|
|
80
|
+
:function_calling?, :structured_output?, :batch?,
|
|
81
|
+
:reasoning?, :citations?, :streaming?, :provider_class,
|
|
82
|
+
to: :to_llm
|
|
83
|
+
end
|
|
82
84
|
end
|
|
83
85
|
end
|
|
84
86
|
end
|
data/lib/ruby_llm/aliases.json
CHANGED
|
@@ -1,295 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"chatgpt-4o": {
|
|
3
|
-
"openai": "chatgpt-4o-latest",
|
|
4
|
-
"openrouter": "openai/chatgpt-4o-latest"
|
|
5
|
-
},
|
|
6
|
-
"claude-3-5-haiku": {
|
|
7
|
-
"anthropic": "claude-3-5-haiku-20241022",
|
|
8
|
-
"openrouter": "anthropic/claude-3.5-haiku",
|
|
9
|
-
"bedrock": "anthropic.claude-3-5-haiku-20241022-v1:0"
|
|
10
|
-
},
|
|
11
|
-
"claude-3-5-haiku-latest": {
|
|
12
|
-
"anthropic": "claude-3-5-haiku-latest"
|
|
13
|
-
},
|
|
14
|
-
"claude-3-7-sonnet": {
|
|
15
|
-
"anthropic": "claude-3-7-sonnet-20250219",
|
|
16
|
-
"openrouter": "anthropic/claude-3.7-sonnet",
|
|
17
|
-
"bedrock": "us.anthropic.claude-3-7-sonnet-20250219-v1:0"
|
|
18
|
-
},
|
|
19
|
-
"claude-3-7-sonnet-latest": {
|
|
20
|
-
"anthropic": "claude-3-7-sonnet-latest"
|
|
21
|
-
},
|
|
22
|
-
"claude-3-haiku": {
|
|
23
|
-
"anthropic": "claude-3-haiku-20240307",
|
|
24
|
-
"openrouter": "anthropic/claude-3-haiku",
|
|
25
|
-
"bedrock": "anthropic.claude-3-haiku-20240307-v1:0:200k"
|
|
26
|
-
},
|
|
27
|
-
"claude-3-opus": {
|
|
28
|
-
"anthropic": "claude-3-opus-20240229",
|
|
29
|
-
"openrouter": "anthropic/claude-3-opus",
|
|
30
|
-
"bedrock": "anthropic.claude-3-opus-20240229-v1:0:200k"
|
|
31
|
-
},
|
|
32
|
-
"claude-3-sonnet": {
|
|
33
|
-
"bedrock": "anthropic.claude-3-sonnet-20240229-v1:0"
|
|
34
|
-
},
|
|
35
2
|
"claude-haiku-4-5": {
|
|
36
|
-
"anthropic": "claude-haiku-4-5-20251001"
|
|
37
|
-
"openrouter": "anthropic/claude-haiku-4.5",
|
|
38
|
-
"bedrock": "us.anthropic.claude-haiku-4-5-20251001-v1:0"
|
|
39
|
-
},
|
|
40
|
-
"claude-opus-4": {
|
|
41
|
-
"anthropic": "claude-opus-4-20250514",
|
|
42
|
-
"openrouter": "anthropic/claude-opus-4",
|
|
43
|
-
"bedrock": "us.anthropic.claude-opus-4-1-20250805-v1:0"
|
|
44
|
-
},
|
|
45
|
-
"claude-opus-4-0": {
|
|
46
|
-
"anthropic": "claude-opus-4-0"
|
|
3
|
+
"anthropic": "claude-haiku-4-5-20251001"
|
|
47
4
|
},
|
|
48
5
|
"claude-opus-4-1": {
|
|
49
|
-
"anthropic": "claude-opus-4-1-20250805"
|
|
50
|
-
"openrouter": "anthropic/claude-opus-4.1",
|
|
51
|
-
"bedrock": "us.anthropic.claude-opus-4-1-20250805-v1:0"
|
|
52
|
-
},
|
|
53
|
-
"claude-sonnet-4": {
|
|
54
|
-
"anthropic": "claude-sonnet-4-20250514",
|
|
55
|
-
"openrouter": "anthropic/claude-sonnet-4",
|
|
56
|
-
"bedrock": "us.anthropic.claude-sonnet-4-20250514-v1:0"
|
|
57
|
-
},
|
|
58
|
-
"claude-sonnet-4-0": {
|
|
59
|
-
"anthropic": "claude-sonnet-4-0"
|
|
6
|
+
"anthropic": "claude-opus-4-1-20250805"
|
|
60
7
|
},
|
|
61
8
|
"claude-sonnet-4-5": {
|
|
62
|
-
"anthropic": "claude-sonnet-4-5-20250929"
|
|
63
|
-
"openrouter": "anthropic/claude-sonnet-4.5",
|
|
64
|
-
"bedrock": "us.anthropic.claude-sonnet-4-5-20250929-v1:0"
|
|
65
|
-
},
|
|
66
|
-
"deepseek-chat": {
|
|
67
|
-
"deepseek": "deepseek-chat",
|
|
68
|
-
"openrouter": "deepseek/deepseek-chat"
|
|
69
|
-
},
|
|
70
|
-
"gemini-2.0-flash": {
|
|
71
|
-
"gemini": "gemini-2.0-flash",
|
|
72
|
-
"vertexai": "gemini-2.0-flash"
|
|
73
|
-
},
|
|
74
|
-
"gemini-2.0-flash-001": {
|
|
75
|
-
"gemini": "gemini-2.0-flash-001",
|
|
76
|
-
"openrouter": "google/gemini-2.0-flash-001",
|
|
77
|
-
"vertexai": "gemini-2.0-flash-001"
|
|
78
|
-
},
|
|
79
|
-
"gemini-2.0-flash-exp": {
|
|
80
|
-
"gemini": "gemini-2.0-flash-exp",
|
|
81
|
-
"vertexai": "gemini-2.0-flash-exp"
|
|
82
|
-
},
|
|
83
|
-
"gemini-2.0-flash-lite-001": {
|
|
84
|
-
"gemini": "gemini-2.0-flash-lite-001",
|
|
85
|
-
"openrouter": "google/gemini-2.0-flash-lite-001",
|
|
86
|
-
"vertexai": "gemini-2.0-flash-lite-001"
|
|
87
|
-
},
|
|
88
|
-
"gemini-2.5-flash": {
|
|
89
|
-
"gemini": "gemini-2.5-flash",
|
|
90
|
-
"openrouter": "google/gemini-2.5-flash",
|
|
91
|
-
"vertexai": "gemini-2.5-flash"
|
|
92
|
-
},
|
|
93
|
-
"gemini-2.5-flash-image": {
|
|
94
|
-
"gemini": "gemini-2.5-flash-image",
|
|
95
|
-
"openrouter": "google/gemini-2.5-flash-image"
|
|
96
|
-
},
|
|
97
|
-
"gemini-2.5-flash-image-preview": {
|
|
98
|
-
"gemini": "gemini-2.5-flash-image-preview",
|
|
99
|
-
"openrouter": "google/gemini-2.5-flash-image-preview"
|
|
100
|
-
},
|
|
101
|
-
"gemini-2.5-flash-lite": {
|
|
102
|
-
"gemini": "gemini-2.5-flash-lite",
|
|
103
|
-
"openrouter": "google/gemini-2.5-flash-lite",
|
|
104
|
-
"vertexai": "gemini-2.5-flash-lite"
|
|
105
|
-
},
|
|
106
|
-
"gemini-2.5-flash-lite-preview-06-17": {
|
|
107
|
-
"gemini": "gemini-2.5-flash-lite-preview-06-17",
|
|
108
|
-
"openrouter": "google/gemini-2.5-flash-lite-preview-06-17"
|
|
109
|
-
},
|
|
110
|
-
"gemini-2.5-flash-lite-preview-09-2025": {
|
|
111
|
-
"gemini": "gemini-2.5-flash-lite-preview-09-2025",
|
|
112
|
-
"openrouter": "google/gemini-2.5-flash-lite-preview-09-2025"
|
|
113
|
-
},
|
|
114
|
-
"gemini-2.5-flash-preview-09-2025": {
|
|
115
|
-
"gemini": "gemini-2.5-flash-preview-09-2025",
|
|
116
|
-
"openrouter": "google/gemini-2.5-flash-preview-09-2025"
|
|
117
|
-
},
|
|
118
|
-
"gemini-2.5-pro": {
|
|
119
|
-
"gemini": "gemini-2.5-pro",
|
|
120
|
-
"openrouter": "google/gemini-2.5-pro",
|
|
121
|
-
"vertexai": "gemini-2.5-pro"
|
|
122
|
-
},
|
|
123
|
-
"gemini-2.5-pro-preview-05-06": {
|
|
124
|
-
"gemini": "gemini-2.5-pro-preview-05-06",
|
|
125
|
-
"openrouter": "google/gemini-2.5-pro-preview-05-06"
|
|
126
|
-
},
|
|
127
|
-
"gemini-embedding-001": {
|
|
128
|
-
"gemini": "gemini-embedding-001",
|
|
129
|
-
"vertexai": "gemini-embedding-001"
|
|
130
|
-
},
|
|
131
|
-
"gemini-exp-1206": {
|
|
132
|
-
"gemini": "gemini-exp-1206",
|
|
133
|
-
"vertexai": "gemini-exp-1206"
|
|
134
|
-
},
|
|
135
|
-
"gemma-3-12b-it": {
|
|
136
|
-
"gemini": "gemma-3-12b-it",
|
|
137
|
-
"openrouter": "google/gemma-3-12b-it"
|
|
138
|
-
},
|
|
139
|
-
"gemma-3-27b-it": {
|
|
140
|
-
"gemini": "gemma-3-27b-it",
|
|
141
|
-
"openrouter": "google/gemma-3-27b-it"
|
|
142
|
-
},
|
|
143
|
-
"gemma-3-4b-it": {
|
|
144
|
-
"gemini": "gemma-3-4b-it",
|
|
145
|
-
"openrouter": "google/gemma-3-4b-it"
|
|
146
|
-
},
|
|
147
|
-
"gemma-3n-e4b-it": {
|
|
148
|
-
"gemini": "gemma-3n-e4b-it",
|
|
149
|
-
"openrouter": "google/gemma-3n-e4b-it"
|
|
150
|
-
},
|
|
151
|
-
"gpt-3.5-turbo": {
|
|
152
|
-
"openai": "gpt-3.5-turbo",
|
|
153
|
-
"openrouter": "openai/gpt-3.5-turbo"
|
|
154
|
-
},
|
|
155
|
-
"gpt-3.5-turbo-16k": {
|
|
156
|
-
"openai": "gpt-3.5-turbo-16k",
|
|
157
|
-
"openrouter": "openai/gpt-3.5-turbo-16k"
|
|
158
|
-
},
|
|
159
|
-
"gpt-3.5-turbo-instruct": {
|
|
160
|
-
"openai": "gpt-3.5-turbo-instruct",
|
|
161
|
-
"openrouter": "openai/gpt-3.5-turbo-instruct"
|
|
162
|
-
},
|
|
163
|
-
"gpt-4": {
|
|
164
|
-
"openai": "gpt-4",
|
|
165
|
-
"openrouter": "openai/gpt-4"
|
|
166
|
-
},
|
|
167
|
-
"gpt-4-1106-preview": {
|
|
168
|
-
"openai": "gpt-4-1106-preview",
|
|
169
|
-
"openrouter": "openai/gpt-4-1106-preview"
|
|
170
|
-
},
|
|
171
|
-
"gpt-4-turbo": {
|
|
172
|
-
"openai": "gpt-4-turbo",
|
|
173
|
-
"openrouter": "openai/gpt-4-turbo"
|
|
174
|
-
},
|
|
175
|
-
"gpt-4-turbo-preview": {
|
|
176
|
-
"openai": "gpt-4-turbo-preview",
|
|
177
|
-
"openrouter": "openai/gpt-4-turbo-preview"
|
|
178
|
-
},
|
|
179
|
-
"gpt-4.1": {
|
|
180
|
-
"openai": "gpt-4.1",
|
|
181
|
-
"openrouter": "openai/gpt-4.1"
|
|
182
|
-
},
|
|
183
|
-
"gpt-4.1-mini": {
|
|
184
|
-
"openai": "gpt-4.1-mini",
|
|
185
|
-
"openrouter": "openai/gpt-4.1-mini"
|
|
186
|
-
},
|
|
187
|
-
"gpt-4.1-nano": {
|
|
188
|
-
"openai": "gpt-4.1-nano",
|
|
189
|
-
"openrouter": "openai/gpt-4.1-nano"
|
|
190
|
-
},
|
|
191
|
-
"gpt-4o": {
|
|
192
|
-
"openai": "gpt-4o",
|
|
193
|
-
"openrouter": "openai/gpt-4o"
|
|
194
|
-
},
|
|
195
|
-
"gpt-4o-2024-05-13": {
|
|
196
|
-
"openai": "gpt-4o-2024-05-13",
|
|
197
|
-
"openrouter": "openai/gpt-4o-2024-05-13"
|
|
198
|
-
},
|
|
199
|
-
"gpt-4o-2024-08-06": {
|
|
200
|
-
"openai": "gpt-4o-2024-08-06",
|
|
201
|
-
"openrouter": "openai/gpt-4o-2024-08-06"
|
|
202
|
-
},
|
|
203
|
-
"gpt-4o-2024-11-20": {
|
|
204
|
-
"openai": "gpt-4o-2024-11-20",
|
|
205
|
-
"openrouter": "openai/gpt-4o-2024-11-20"
|
|
206
|
-
},
|
|
207
|
-
"gpt-4o-audio-preview": {
|
|
208
|
-
"openai": "gpt-4o-audio-preview",
|
|
209
|
-
"openrouter": "openai/gpt-4o-audio-preview"
|
|
210
|
-
},
|
|
211
|
-
"gpt-4o-mini": {
|
|
212
|
-
"openai": "gpt-4o-mini",
|
|
213
|
-
"openrouter": "openai/gpt-4o-mini"
|
|
214
|
-
},
|
|
215
|
-
"gpt-4o-mini-2024-07-18": {
|
|
216
|
-
"openai": "gpt-4o-mini-2024-07-18",
|
|
217
|
-
"openrouter": "openai/gpt-4o-mini-2024-07-18"
|
|
218
|
-
},
|
|
219
|
-
"gpt-4o-mini-search-preview": {
|
|
220
|
-
"openai": "gpt-4o-mini-search-preview",
|
|
221
|
-
"openrouter": "openai/gpt-4o-mini-search-preview"
|
|
222
|
-
},
|
|
223
|
-
"gpt-4o-search-preview": {
|
|
224
|
-
"openai": "gpt-4o-search-preview",
|
|
225
|
-
"openrouter": "openai/gpt-4o-search-preview"
|
|
226
|
-
},
|
|
227
|
-
"gpt-5": {
|
|
228
|
-
"openai": "gpt-5",
|
|
229
|
-
"openrouter": "openai/gpt-5"
|
|
230
|
-
},
|
|
231
|
-
"gpt-5-codex": {
|
|
232
|
-
"openai": "gpt-5-codex",
|
|
233
|
-
"openrouter": "openai/gpt-5-codex"
|
|
234
|
-
},
|
|
235
|
-
"gpt-5-mini": {
|
|
236
|
-
"openai": "gpt-5-mini",
|
|
237
|
-
"openrouter": "openai/gpt-5-mini"
|
|
238
|
-
},
|
|
239
|
-
"gpt-5-nano": {
|
|
240
|
-
"openai": "gpt-5-nano",
|
|
241
|
-
"openrouter": "openai/gpt-5-nano"
|
|
242
|
-
},
|
|
243
|
-
"gpt-5-pro": {
|
|
244
|
-
"openai": "gpt-5-pro",
|
|
245
|
-
"openrouter": "openai/gpt-5-pro"
|
|
246
|
-
},
|
|
247
|
-
"gpt-oss-120b": {
|
|
248
|
-
"openai": "gpt-oss-120b",
|
|
249
|
-
"openrouter": "openai/gpt-oss-120b"
|
|
250
|
-
},
|
|
251
|
-
"gpt-oss-20b": {
|
|
252
|
-
"openai": "gpt-oss-20b",
|
|
253
|
-
"openrouter": "openai/gpt-oss-20b"
|
|
254
|
-
},
|
|
255
|
-
"imagen-4.0-generate-001": {
|
|
256
|
-
"gemini": "imagen-4.0-generate-001",
|
|
257
|
-
"vertexai": "imagen-4.0-generate-001"
|
|
258
|
-
},
|
|
259
|
-
"o1": {
|
|
260
|
-
"openai": "o1",
|
|
261
|
-
"openrouter": "openai/o1"
|
|
262
|
-
},
|
|
263
|
-
"o1-pro": {
|
|
264
|
-
"openai": "o1-pro",
|
|
265
|
-
"openrouter": "openai/o1-pro"
|
|
266
|
-
},
|
|
267
|
-
"o3": {
|
|
268
|
-
"openai": "o3",
|
|
269
|
-
"openrouter": "openai/o3"
|
|
270
|
-
},
|
|
271
|
-
"o3-deep-research": {
|
|
272
|
-
"openai": "o3-deep-research",
|
|
273
|
-
"openrouter": "openai/o3-deep-research"
|
|
274
|
-
},
|
|
275
|
-
"o3-mini": {
|
|
276
|
-
"openai": "o3-mini",
|
|
277
|
-
"openrouter": "openai/o3-mini"
|
|
278
|
-
},
|
|
279
|
-
"o3-pro": {
|
|
280
|
-
"openai": "o3-pro",
|
|
281
|
-
"openrouter": "openai/o3-pro"
|
|
282
|
-
},
|
|
283
|
-
"o4-mini": {
|
|
284
|
-
"openai": "o4-mini",
|
|
285
|
-
"openrouter": "openai/o4-mini"
|
|
286
|
-
},
|
|
287
|
-
"o4-mini-deep-research": {
|
|
288
|
-
"openai": "o4-mini-deep-research",
|
|
289
|
-
"openrouter": "openai/o4-mini-deep-research"
|
|
290
|
-
},
|
|
291
|
-
"text-embedding-004": {
|
|
292
|
-
"gemini": "text-embedding-004",
|
|
293
|
-
"vertexai": "text-embedding-004"
|
|
9
|
+
"anthropic": "claude-sonnet-4-5-20250929"
|
|
294
10
|
}
|
|
295
11
|
}
|
data/lib/ruby_llm/connection.rb
CHANGED
|
@@ -16,6 +16,8 @@ module RubyLLM
|
|
|
16
16
|
log_level: :debug
|
|
17
17
|
f.response :raise_error
|
|
18
18
|
yield f if block_given?
|
|
19
|
+
# Use net_http for simple API calls to avoid async-http SSL/IPv6 issues
|
|
20
|
+
f.adapter :net_http
|
|
19
21
|
end
|
|
20
22
|
end
|
|
21
23
|
|
|
@@ -85,7 +87,6 @@ module RubyLLM
|
|
|
85
87
|
faraday.request :multipart
|
|
86
88
|
faraday.request :json
|
|
87
89
|
faraday.response :json
|
|
88
|
-
faraday.adapter :net_http
|
|
89
90
|
faraday.use :llm_errors, provider: @provider
|
|
90
91
|
end
|
|
91
92
|
|