Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ RubyLLM.configure do |config|
config.anthropic_api_key = ENV.fetch('ANTHROPIC_API_KEY', nil)
config.gemini_api_key = ENV.fetch('GEMINI_API_KEY', nil)
config.deepseek_api_key = ENV.fetch('DEEPSEEK_API_KEY', nil)
config.openrouter_api_key = ENV.fetch('OPENROUTER_API_KEY', nil)

# Bedrock
config.bedrock_api_key = ENV.fetch('AWS_ACCESS_KEY_ID', nil)
Expand Down
4 changes: 3 additions & 1 deletion lib/ruby_llm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
'openai' => 'OpenAI',
'api' => 'API',
'deepseek' => 'DeepSeek',
'bedrock' => 'Bedrock'
'bedrock' => 'Bedrock',
'openrouter' => 'OpenRouter'
)
loader.ignore("#{__dir__}/tasks")
loader.ignore("#{__dir__}/ruby_llm/railtie")
Expand Down Expand Up @@ -73,6 +74,7 @@ def logger
RubyLLM::Provider.register :gemini, RubyLLM::Providers::Gemini
RubyLLM::Provider.register :deepseek, RubyLLM::Providers::DeepSeek
RubyLLM::Provider.register :bedrock, RubyLLM::Providers::Bedrock
RubyLLM::Provider.register :openrouter, RubyLLM::Providers::OpenRouter

if defined?(Rails::Railtie)
require 'ruby_llm/railtie'
Expand Down
53 changes: 43 additions & 10 deletions lib/ruby_llm/aliases.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,71 @@
{
"claude-3-5-sonnet": {
"anthropic": "claude-3-5-sonnet-20241022",
"bedrock": "anthropic.claude-3-5-sonnet-20241022-v2:0"
"bedrock": "anthropic.claude-3-5-sonnet-20241022-v2:0",
"openrouter": "anthropic/claude-3.5-sonnet"
},
"claude-3-5-haiku": {
"anthropic": "claude-3-5-haiku-20241022",
"bedrock": "anthropic.claude-3-5-haiku-20241022-v1:0"
"bedrock": "anthropic.claude-3-5-haiku-20241022-v1:0",
"openrouter": "anthropic/claude-3.5-haiku-20241022"
},
"claude-3-7-sonnet": {
"anthropic": "claude-3-7-sonnet-20250219",
"bedrock": "us.anthropic.claude-3-7-sonnet-20250219-v1:0"
"bedrock": "us.anthropic.claude-3-7-sonnet-20250219-v1:0",
"openrouter": "us.anthropic.claude-3-7-sonnet-20250219-v1:0"
},
"claude-3-opus": {
"anthropic": "claude-3-opus-20240229",
"bedrock": "anthropic.claude-3-opus-20240229-v1:0"
"bedrock": "anthropic.claude-3-opus-20240229-v1:0",
},
"claude-3-sonnet": {
"anthropic": "claude-3-sonnet-20240229",
"bedrock": "anthropic.claude-3-sonnet-20240229-v1:0"
"bedrock": "anthropic.claude-3-sonnet-20240229-v1:0",
},
"claude-3-haiku": {
"anthropic": "claude-3-haiku-20240307",
"bedrock": "anthropic.claude-3-haiku-20240307-v1:0"
"bedrock": "anthropic.claude-3-haiku-20240307-v1:0",
},
"claude-3": {
"anthropic": "claude-3-sonnet-20240229",
"bedrock": "anthropic.claude-3-sonnet-20240229-v1:0"
"bedrock": "anthropic.claude-3-sonnet-20240229-v1:0",
"openrouter": "anthropic/claude-3-sonnet"
},
"claude-2": {
"anthropic": "claude-2.0",
"bedrock": "anthropic.claude-2.0"
"bedrock": "anthropic.claude-2.0",
"openrouter": "anthropic/claude-2"
},
"claude-2-1": {
"anthropic": "claude-2.1",
"bedrock": "anthropic.claude-2.1"
"bedrock": "anthropic.claude-2.1",
"openrouter": "anthropic/claude-2.1"
},
"gpt-4o": {
"openrouter": "openai/gpt-4o"
},
"gpt-4o-mini": {
"openrouter": "openai/gpt-4o-mini"
},
"gpt-4-turbo": {
"openrouter": "openai/gpt-4-turbo"
},
"gemini-1.5-flash": {
"openrouter": "google/gemini-flash-1.5"
},
"gemini-1.5-flash-8b": {
"openrouter": "google/gemini-flash-1.5-8b"
},
"gemini-1.5-pro": {
"openrouter": "google/gemini-pro-1.5"
},
"gemini-2.0-flash": {
"openrouter": "google/gemini-2.0-flash-001"
},
"o1": {
"openrouter": "openai/o1"
},
"o3-mini": {
"openrouter": "openai/o3-mini"
}
Comment on lines +44 to 70
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add the openai version here first just to keep the style consistent

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you mean, can you explain a bit more?

}
}
1 change: 1 addition & 0 deletions lib/ruby_llm/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Configuration
:bedrock_secret_key,
:bedrock_region,
:bedrock_session_token,
:openrouter_api_key,
# Default models
:default_model,
:default_embedding_model,
Expand Down
Loading