RubyLLM uses a static bundled models.json file 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. This causes ModelNotFoundError
for self-hosted users who configure newer models.
Call RubyLLM.models.refresh! during Llm::Config.initialize! to fetch
the latest model list from configured providers and models.dev. Persist
the result with save_to_json to tmp/ruby_llm_models.json so subsequent
processes load from disk instead of making HTTP calls. The file has a
1-hour TTL to balance freshness with performance.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>