Skip to content

Commit 21bfcd4

Browse files
committed
Add Cohere model support to model and alias rake tasks
1 parent 42b18c3 commit 21bfcd4

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/tasks/aliases.rake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,18 @@ namespace :aliases do # rubocop:disable Metrics/BlockLength
117117
}
118118
end
119119

120+
# Cohere models
121+
models['cohere'].each do |model|
122+
openrouter_model = "cohere/#{model}"
123+
next unless models['openrouter'].include?(openrouter_model)
124+
125+
alias_key = model.gsub(/-\d{2}-\d{4}$/, '')
126+
aliases[alias_key] = {
127+
'cohere' => model,
128+
'openrouter' => openrouter_model
129+
}
130+
end
131+
120132
# Write the result
121133
sorted_aliases = aliases.sort.to_h
122134
File.write('lib/ruby_llm/aliases.json', JSON.pretty_generate(sorted_aliases))

lib/tasks/models_update.rake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def configure_from_env
2323
config.gemini_api_key = ENV.fetch('GEMINI_API_KEY', nil)
2424
config.deepseek_api_key = ENV.fetch('DEEPSEEK_API_KEY', nil)
2525
config.openrouter_api_key = ENV.fetch('OPENROUTER_API_KEY', nil)
26+
config.cohere_api_key = ENV.fetch('COHERE_API_KEY', nil)
2627
configure_bedrock(config)
2728
config.request_timeout = 30
2829
end

0 commit comments

Comments
 (0)