Class: SolidLoop::LlmUsageParser::Llama

Inherits:
Object
  • Object
show all
Defined in:
app/services/solid_loop/llm_usage_parser/llama.rb

Class Method Summary collapse

Class Method Details

.call(timings) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'app/services/solid_loop/llm_usage_parser/llama.rb', line 4

def self.call(timings)
  {
    tokens_prompt: timings["prompt_n"].to_i,
    tokens_completion: timings["predicted_n"].to_i,
    tokens_total: timings["prompt_n"].to_i + timings["predicted_n"].to_i,
    tokens_prompt_cached: timings["cache_n"].to_i,
    tps: timings["predicted_per_second"].to_f.round(2)
  }
end