RubyLLM uses a static bundled models.json as its model registry. New
models released by providers (e.g., gpt-5.1, gpt-5.2) are not available
until the gem is updated, causing ModelNotFoundError for self-hosted
users who configure newer models.
Refresh the model registry synchronously during Llm::Config.initialize!
to fetch the latest model list from configured providers and models.dev,
then persist with save_to_json. This runs once per process on the first
LLM request, adding ~1-2s to that request. Falls back gracefully to the
bundled registry on failure.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>