Module: RubyLLM::Agents::Providers::Inception::Capabilities
- Defined in:
- lib/ruby_llm/agents/providers/inception/capabilities.rb
Overview
Determines capabilities and pricing for Inception Mercury models.
Mercury models are diffusion LLMs with text-only I/O. Pricing is per million tokens.
Models:
-
mercury-2: Reasoning dLLM, function calling, structured output
-
mercury: Base chat dLLM, function calling, structured output
-
mercury-coder-small: Fast coding model
-
mercury-edit: Code editing/FIM model
Constant Summary collapse
- REASONING_MODELS =
%w[mercury-2].freeze
- CODER_MODELS =
%w[mercury-coder-small mercury-edit].freeze
- FUNCTION_CALLING_MODELS =
%w[mercury-2 mercury].freeze
Class Method Summary collapse
- .capabilities_for(model_id) ⇒ Object
- .context_window_for(_model_id) ⇒ Object
- .format_display_name(model_id) ⇒ Object
- .input_price_for(_model_id) ⇒ Object
- .max_tokens_for(_model_id) ⇒ Object
- .modalities_for(_model_id) ⇒ Object
- .model_family(_model_id) ⇒ Object
- .model_type(model_id) ⇒ Object
- .output_price_for(model_id) ⇒ Object
- .pricing_for(model_id) ⇒ Object
- .supports_functions?(model_id) ⇒ Boolean
- .supports_json_mode?(model_id) ⇒ Boolean
- .supports_vision?(_model_id) ⇒ Boolean
Class Method Details
.capabilities_for(model_id) ⇒ Object
83 84 85 86 87 88 89 90 91 |
# File 'lib/ruby_llm/agents/providers/inception/capabilities.rb', line 83 def capabilities_for(model_id) caps = ["streaming"] if FUNCTION_CALLING_MODELS.include?(model_id) caps << "function_calling" caps << "structured_output" end caps << "reasoning" if REASONING_MODELS.include?(model_id) caps end |
.context_window_for(_model_id) ⇒ Object
24 25 26 |
# File 'lib/ruby_llm/agents/providers/inception/capabilities.rb', line 24 def context_window_for(_model_id) 128_000 end |
.format_display_name(model_id) ⇒ Object
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/ruby_llm/agents/providers/inception/capabilities.rb', line 56 def format_display_name(model_id) case model_id when "mercury-2" then "Mercury 2" when "mercury" then "Mercury" when "mercury-coder-small" then "Mercury Coder Small" when "mercury-edit" then "Mercury Edit" else model_id.split("-").map(&:capitalize).join(" ") end end |
.input_price_for(_model_id) ⇒ Object
32 33 34 |
# File 'lib/ruby_llm/agents/providers/inception/capabilities.rb', line 32 def input_price_for(_model_id) 0.25 end |
.max_tokens_for(_model_id) ⇒ Object
28 29 30 |
# File 'lib/ruby_llm/agents/providers/inception/capabilities.rb', line 28 def max_tokens_for(_model_id) 32_000 end |
.modalities_for(_model_id) ⇒ Object
79 80 81 |
# File 'lib/ruby_llm/agents/providers/inception/capabilities.rb', line 79 def modalities_for(_model_id) {input: ["text"], output: ["text"]} end |
.model_family(_model_id) ⇒ Object
75 76 77 |
# File 'lib/ruby_llm/agents/providers/inception/capabilities.rb', line 75 def model_family(_model_id) :mercury end |
.model_type(model_id) ⇒ Object
67 68 69 70 71 72 73 |
# File 'lib/ruby_llm/agents/providers/inception/capabilities.rb', line 67 def model_type(model_id) if CODER_MODELS.include?(model_id) "code" else "chat" end end |
.output_price_for(model_id) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/ruby_llm/agents/providers/inception/capabilities.rb', line 36 def output_price_for(model_id) if CODER_MODELS.include?(model_id) 1.00 else 0.75 end end |
.pricing_for(model_id) ⇒ Object
93 94 95 96 97 98 99 100 101 102 |
# File 'lib/ruby_llm/agents/providers/inception/capabilities.rb', line 93 def pricing_for(model_id) { text_tokens: { standard: { input_per_million: input_price_for(model_id), output_per_million: output_price_for(model_id) } } } end |
.supports_functions?(model_id) ⇒ Boolean
48 49 50 |
# File 'lib/ruby_llm/agents/providers/inception/capabilities.rb', line 48 def supports_functions?(model_id) FUNCTION_CALLING_MODELS.include?(model_id) end |
.supports_json_mode?(model_id) ⇒ Boolean
52 53 54 |
# File 'lib/ruby_llm/agents/providers/inception/capabilities.rb', line 52 def supports_json_mode?(model_id) FUNCTION_CALLING_MODELS.include?(model_id) end |
.supports_vision?(_model_id) ⇒ Boolean
44 45 46 |
# File 'lib/ruby_llm/agents/providers/inception/capabilities.rb', line 44 def supports_vision?(_model_id) false end |