What's the best way to keep the model registry up-to-date? #540
Replies: 3 comments
-
|
Did you see any errors from refreshing or saving? |
Beta Was this translation helpful? Give feedback.
-
|
I ran into this issue as well. I was working in a Rails application and for me the root cause was not understanding the relationship between the JSON file, what's in memory, and the database. Running the rake task pulls what is in the JSON file into the database, but does not necessarily include new models if the JSON file is out of date. In the end I skipped the JSON file and updated the database from memory: RubyLLM::Models.refresh!
model_class = RubyLLM.config.model_registry_class.constantize
model_class.save_to_databasePerhaps that logic could be added as an additional rake task. It is a bit YOLO-ish, since you don't always know what is going to get added and it would be required to be run in each environment. An alternative might be to recommend configuring the JSON file to be stored in the seeds directory and letting it be versioned. Then a seed file could be added that essentially runs the |
Beta Was this translation helpful? Give feedback.
-
|
We've done it the following way:
RubyLLM.configure do |config|
config.model_registry_file = Rails.root.join("config/ruby_llm/models.json").to_s
end
RubyLLM.models.load_from_json!(RubyLLM.config.model_registry_file)
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I know about
RubyLLM.models.refresh!and.save_to_json, but for some reason it doesn't seem to persist. Very often when I push new versions to production, I get an error that newer models aren't recognisedBeta Was this translation helpful? Give feedback.
All reactions