← Questions
Running cost of streamed token usage
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Token usage for model requests arrives as a stream of usage records rather than all at once. Compute what the usage costs, keeping the totals correct as each new record arrives, so the current cost can be read at any point without reprocessing the whole stream. Talk through how you would structure the per-record pricing and the running totals, and what the time and memory cost is per record.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
