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

Class Method Details

.available_on_platform?Boolean

Returns:

  • (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_tokensObject



62
63
64
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 62

def default_max_tokens
  512
end

.max_temperatureObject



66
67
68
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 66

def max_temperature
  2.0
end

.min_temperatureObject



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_familiesObject



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

Returns:

  • (Boolean)


33
34
35
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 33

def supports_audio?
  false
end

.supports_embeddings?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 29

def supports_embeddings?
  false # Future enhancement - Red Candle does support embedding models
end

.supports_functions?(_model_id = nil) ⇒ Boolean

Returns:

  • (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

Returns:

  • (Boolean)


37
38
39
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 37

def supports_pdf?
  false
end

.supports_regex_constraints?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 25

def supports_regex_constraints?
  true
end

.supports_repetition_penalty?Boolean

Returns:

  • (Boolean)


86
87
88
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 86

def supports_repetition_penalty?
  true
end

.supports_seed?Boolean

Returns:

  • (Boolean)


90
91
92
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 90

def supports_seed?
  true
end

.supports_stop_sequences?Boolean

Returns:

  • (Boolean)


94
95
96
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 94

def supports_stop_sequences?
  true
end

.supports_streaming?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 17

def supports_streaming?
  true
end

.supports_structured_output?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 21

def supports_structured_output?
  true
end

.supports_temperature?Boolean

Returns:

  • (Boolean)


74
75
76
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 74

def supports_temperature?
  true
end

.supports_top_k?Boolean

Returns:

  • (Boolean)


82
83
84
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 82

def supports_top_k?
  true
end

.supports_top_p?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 78

def supports_top_p?
  true
end

.supports_vision?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/ruby_llm/red_candle/capabilities.rb', line 9

def supports_vision?
  false
end