module RubyLLM::Providers::DeepSeek::Capabilities

def cache_hit_price_for(model_id)

Returns:
  • (Float) - the price per million tokens in USD

Parameters:
  • model_id (String) -- the model identifier
def cache_hit_price_for(model_id)
  PRICES.dig(model_family(model_id), :input_hit) || default_cache_hit_price
end

def context_window_for(model_id)

Returns:
  • (Integer) - the context window size in tokens

Parameters:
  • model_id (String) -- the model identifier
def context_window_for(model_id)
  case model_id
  when /deepseek-(?:chat|reasoner)/ then 64_000
  else 32_768 # Sensible default
  end
end

def default_cache_hit_price

Returns:
  • (Float) - the default cache hit price
def default_cache_hit_price
  0.07 # Default to chat cache hit price
end

def default_input_price

Returns:
  • (Float) - the default input price
def default_input_price
  0.27 # Default to chat cache miss price
end

def default_output_price

Returns:
  • (Float) - the default output price
def default_output_price
  1.10 # Default to chat output price
end

def format_display_name(model_id)

Returns:
  • (String) - the formatted display name

Parameters:
  • model_id (String) -- the model identifier
def format_display_name(model_id)
  case model_id
  when 'deepseek-chat' then 'DeepSeek V3'
  when 'deepseek-reasoner' then 'DeepSeek R1'
  else
    model_id.split('-')
            .map(&:capitalize)
            .join(' ')
  end
end

def input_price_for(model_id)

Returns:
  • (Float) - the price per million tokens in USD

Parameters:
  • model_id (String) -- the model identifier
def input_price_for(model_id)
  PRICES.dig(model_family(model_id), :input_miss) || default_input_price
end

def max_tokens_for(model_id)

Returns:
  • (Integer) - the maximum number of tokens

Parameters:
  • model_id (String) -- the model identifier
def max_tokens_for(model_id)
  case model_id
  when /deepseek-(?:chat|reasoner)/ then 8_192
  else 4_096 # Default if max_tokens not specified
  end
end

def model_family(model_id)

Returns:
  • (Symbol) - the model family

Parameters:
  • model_id (String) -- the model identifier
def model_family(model_id)
  case model_id
  when /deepseek-reasoner/ then :reasoner
  else :chat # Default to chat family
  end
end

def model_type(_model_id)

Returns:
  • (String) - the model type (e.g., 'chat')

Parameters:
  • model_id (String) -- the model identifier
def model_type(_model_id)
  'chat' # All DeepSeek models are chat models
end

def output_price_for(model_id)

Returns:
  • (Float) - the price per million tokens in USD

Parameters:
  • model_id (String) -- the model identifier
def output_price_for(model_id)
  PRICES.dig(model_family(model_id), :output) || default_output_price
end

def supports_functions?(model_id)

Returns:
  • (Boolean) - true if the model supports function calling

Parameters:
  • model_id (String) -- the model identifier
def supports_functions?(model_id)
  model_id.match?(/deepseek-chat/) # Only deepseek-chat supports function calling
end

def supports_json_mode?(_model_id)

Returns:
  • (Boolean) - true if the model supports JSON mode

Parameters:
  • model_id (String) -- the model identifier
def supports_json_mode?(_model_id)
  false # DeepSeek function calling is unstable
end

def supports_vision?(_model_id)

Returns:
  • (Boolean) - true if the model supports vision

Parameters:
  • model_id (String) -- the model identifier
def supports_vision?(_model_id)
  false # DeepSeek models don't currently support vision
end