Module: RubyLLM::RedCandle::Capabilities
- Included in:
- Provider
- Defined in:
- lib/ruby_llm/red_candle/capabilities.rb
Overview
Determines capabilities for RedCandle models
Class Method Summary collapse
- .available_on_platform? ⇒ Boolean
- .default_max_tokens ⇒ Object
- .max_temperature ⇒ Object
- .min_temperature ⇒ Object
- .model_context_window(model_id) ⇒ Object
- .model_families ⇒ Object
- .normalize_temperature(temperature, _model_id) ⇒ Object
- .supports_audio? ⇒ Boolean
- .supports_embeddings? ⇒ Boolean
- .supports_functions?(_model_id = nil) ⇒ Boolean
- .supports_pdf? ⇒ Boolean
- .supports_regex_constraints? ⇒ Boolean
- .supports_repetition_penalty? ⇒ Boolean
- .supports_seed? ⇒ Boolean
- .supports_stop_sequences? ⇒ Boolean
- .supports_streaming? ⇒ Boolean
- .supports_structured_output? ⇒ Boolean
- .supports_temperature? ⇒ Boolean
- .supports_top_k? ⇒ Boolean
- .supports_top_p? ⇒ Boolean
- .supports_vision? ⇒ Boolean
Class Method Details
.available_on_platform? ⇒ Boolean
102 103 104 105 106 107 108 109 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 102 def available_on_platform? # Check if Candle can be loaded require "candle" true rescue LoadError false end |
.default_max_tokens ⇒ Object
62 63 64 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 62 def default_max_tokens 512 end |
.max_temperature ⇒ Object
66 67 68 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 66 def max_temperature 2.0 end |
.min_temperature ⇒ Object
70 71 72 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 70 def min_temperature 0.0 end |
.model_context_window(model_id) ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 49 def model_context_window(model_id) case model_id when /gemma-3-4b/i 8192 when /qwen2\.5-1\.5b/i, /mistral-7b/i 32_768 when /tinyllama/i 2048 else 4096 # Conservative default end end |
.model_families ⇒ Object
98 99 100 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 98 def model_families %w[gemma llama qwen2 mistral phi] end |
.normalize_temperature(temperature, _model_id) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 41 def normalize_temperature(temperature, _model_id) # Red Candle uses standard 0-2 range return 0.7 if temperature.nil? temperature = temperature.to_f temperature.clamp(0.0, 2.0) end |
.supports_audio? ⇒ Boolean
33 34 35 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 33 def supports_audio? false end |
.supports_embeddings? ⇒ Boolean
29 30 31 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 29 def false # Future enhancement - Red Candle does support embedding models end |
.supports_functions?(_model_id = nil) ⇒ Boolean
13 14 15 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 13 def supports_functions?(_model_id = nil) false end |
.supports_pdf? ⇒ Boolean
37 38 39 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 37 def supports_pdf? false end |
.supports_regex_constraints? ⇒ Boolean
25 26 27 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 25 def supports_regex_constraints? true end |
.supports_repetition_penalty? ⇒ Boolean
86 87 88 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 86 def supports_repetition_penalty? true end |
.supports_seed? ⇒ Boolean
90 91 92 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 90 def supports_seed? true end |
.supports_stop_sequences? ⇒ Boolean
94 95 96 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 94 def supports_stop_sequences? true end |
.supports_streaming? ⇒ Boolean
17 18 19 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 17 def supports_streaming? true end |
.supports_structured_output? ⇒ Boolean
21 22 23 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 21 def supports_structured_output? true end |
.supports_temperature? ⇒ Boolean
74 75 76 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 74 def supports_temperature? true end |
.supports_top_k? ⇒ Boolean
82 83 84 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 82 def supports_top_k? true end |
.supports_top_p? ⇒ Boolean
78 79 80 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 78 def supports_top_p? true end |
.supports_vision? ⇒ Boolean
9 10 11 |
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 9 def supports_vision? false end |