Module: RubyLLM::Agents::Providers::Inception::Registry

Defined in:
lib/ruby_llm/agents/providers/inception/registry.rb

Overview

Registers Mercury models in the RubyLLM model registry so they can be resolved by model ID without calling the Inception /models API.

Constant Summary collapse

MODELS =
[
  {id: "mercury-2", name: "Mercury 2"},
  {id: "mercury", name: "Mercury"},
  {id: "mercury-coder-small", name: "Mercury Coder Small"},
  {id: "mercury-edit", name: "Mercury Edit"}
].freeze

Class Method Summary collapse

Class Method Details

.register_models!Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/ruby_llm/agents/providers/inception/registry.rb', line 19

def register_models!
  models_instance = ::RubyLLM::Models.instance
  capabilities = Inception::Capabilities

  MODELS.each do |model_def|
    model_id = model_def[:id]

    model_info = ::RubyLLM::Model::Info.new(
      id: model_id,
      name: model_def[:name],
      provider: "inception",
      family: "mercury",
      context_window: capabilities.context_window_for(model_id),
      max_output_tokens: capabilities.max_tokens_for(model_id),
      modalities: capabilities.modalities_for(model_id),
      capabilities: capabilities.capabilities_for(model_id),
      pricing: capabilities.pricing_for(model_id)
    )

    models_instance.all << model_info
  end
end