Skip to content

Commit c7be9c4

Browse files
committed
Drop 'replicate' prefix from model names
1 parent 7c5ad04 commit c7be9c4

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

lib/ruby_llm/providers/replicate/capabilities.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ class Replicate
77
module Capabilities
88
module_function
99

10-
def name_from(model_data)
11-
"replicate/#{model_data['owner']}/#{model_data['name']}"
12-
end
13-
1410
def metadata_from(model_data)
1511
input_schema = model_data.dig('latest_version', 'openapi_schema', 'components', 'schemas', 'Input')
1612

lib/ruby_llm/providers/replicate/images.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Images
99

1010
def images_url
1111
if official_model?
12-
"/v1/models/#{canonical_model_name}/predictions"
12+
"/v1/models/#{model.name}/predictions"
1313
else
1414
'/v1/predictions'
1515
end
@@ -45,10 +45,6 @@ def model_id=(id)
4545
def official_model?
4646
model.metadata['is_official'] == true
4747
end
48-
49-
def canonical_model_name
50-
model.name.split('/')[1..].join('/')
51-
end
5248
end
5349
end
5450
end

lib/ruby_llm/providers/replicate/models.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def parse_list_models_response(response)
1818
Array(response.body['models']).map do |model_data|
1919
Model::Info.new(
2020
id: model_data.dig('latest_version', 'id'),
21-
name: capabilities.name_from(model_data),
21+
name: "#{model_data['owner']}/#{model_data['name']}",
2222
provider: 'replicate',
2323
created_at: model_data['created_at'],
2424
modalities: { input: ['text'], output: ['image'] },

0 commit comments

Comments
 (0)