Module: Rubino::LLM::ModelCatalog

Defined in:
lib/rubino/llm/model_catalog.rb

Overview

Enumerates the model ids the ruby_llm registry knows for a provider —the source behind ‘/model` (bare listing + dropdown completion). Custom backends (minimax/gateway/anthropic-compatible proxies) are not registry providers, so they enumerate to [] and `/model` degrades to the current-model + usage-hint view; no hardcoded global list is invented.

Constant Summary collapse

REGISTRY_ALIASES =

ProviderResolver speaks “google”; the ruby_llm registry files the same models under “gemini”. Only mismatch between the two vocabularies.

{ "google" => "gemini" }.freeze

Class Method Summary collapse

Class Method Details

.ids_for(provider) ⇒ Object

Model ids for provider, [] when the registry can’t enumerate it.



18
19
20
21
22
23
24
25
26
# File 'lib/rubino/llm/model_catalog.rb', line 18

def ids_for(provider)
  return [] if provider.to_s.empty?

  require "ruby_llm"
  registry_name = REGISTRY_ALIASES.fetch(provider.to_s, provider.to_s)
  RubyLLM.models.by_provider(registry_name).map(&:id)
rescue StandardError
  []
end