Giter VIP home page Giter VIP logo

Comments (4)

thy09 avatar thy09 commented on June 20, 2024 1

@Wix97 From pf perspective, it would be complicated to define such a contract to summarize tokens according to the tokens.

I have a proposal: what if we expose the ability to get the tokens in other nodes?
For example, we provide such an experession: {llm_node_1.system_metrics.usage} to get the usage dictionary of a node, then you can have a summary node to get the dictionary for yourself.

from promptflow.

brynn-code avatar brynn-code commented on June 20, 2024

Hi @Wix97 . Thanks for reaching us, could you please elaborate more about the 'usage of each AOAI connection deployment'? Is that related to any run, for example a batch run with different deployment, to get the usage of each deployment, or just overall token usage of a deployment? For the latter one, seems that should be the capability of AzureOpenAI instead of promptflow.

from promptflow.

Wix97 avatar Wix97 commented on June 20, 2024

Sorry for the confusion, the first case is what I wanted to mention here.
For example, there is a flow consuming 2 AOAI connections, each connection has 2 deployments. It would be helpful if promptflow can generate token usage report such like:

  "token_usage": {
    "connection_1": {
      "connection_1_deployment_1": {
        "prompt_tokens": 123,
        "completion_tokens": 456
      },
      "connection_1_deployment_2": {
        "prompt_tokens": 123,
        "completion_tokens": 456
      }
    },
    "connection_2": {
      "connection_2_deployment_1": {
        "prompt_tokens": 123,
        "completion_tokens": 456
      },
      "connection_2_deployment_2": {
        "prompt_tokens": 123,
        "completion_tokens": 456
      }
    }
  }
}

from promptflow.

Wix97 avatar Wix97 commented on June 20, 2024

LGTM👍

from promptflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.