@grafctory/llms
    Preparing search index...

    Function charge

    • Logs the token usage of a model request.

      Meant for model connectors, which log every request they issue. Each entry is filed under the model and states the labels and tokens of the request, so a cost spike can be traced to its source from the log alone.

      Parameters

      • model: string

        The id of the model the request was submitted to

      • labels: Labels

        The labels identifying the cost source of the request

      • usage: Usage

        The tokens the request consumed

      Returns void