lorax icon indicating copy to clipboard operation
lorax copied to clipboard

Return number of input tokens when `details=True`

Open tgaddair opened this issue 2 years ago • 2 comments

We return the number of generated tokens when details=True, but systems like OpenAI API also return the number of input tokens. This i useful, for example, for metering systems that limit users based on number of input + output tokens.

Current:

'details': {'generated_tokens': 20}

Proposal:

'details': {'prompt_tokens': 120, 'generated_tokens': 20}

tgaddair avatar Nov 29 '23 22:11 tgaddair

@tgaddair Hi there ! I am a new contributor to this repository and would love to contribute by solving this issue. Could you please assign this issue to me ?

wiredinhp avatar May 23 '24 09:05 wiredinhp

Is the issue still open

MasaSN avatar Oct 18 '25 10:10 MasaSN