CostRecorded

org.llm4s.trace.TraceEvent.CostRecorded
case class CostRecorded(costUsd: Double, model: String, operation: String, tokenCount: Int, costType: String, timestamp: Instant) extends TraceEvent

Tracks cost in USD for any model operation.

Value parameters

costType

Category: "embedding", "completion", "total"

costUsd

Estimated cost in US dollars

model

Model name used for pricing lookup

operation

Type of operation: "embedding", "completion", "evaluation"

tokenCount

Total tokens consumed

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait TraceEvent
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def eventType: String
def toJson: Value

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product