github badlogic/pi-mono v0.13.0

latest releases: v0.57.1, v0.57.0, v0.56.3...
3 months ago

Breaking Changes

  • Added totalTokens field to Usage type: All code that constructs Usage objects must now include the totalTokens field. This field represents the total tokens processed by the LLM (input + output + cache). For OpenAI and Google, this uses native API values (total_tokens, totalTokenCount). For Anthropic, it's computed as input + output + cacheRead + cacheWrite.

Details

  • Added comprehensive test covering 13 providers (Anthropic, OpenAI Completions/Responses, Google, xAI, Groq, Cerebras, z.ai, and 5 OpenRouter backends)
  • Fixed openai-completions to compute totalTokens consistently when reasoning tokens are present
  • Updated calculateContextTokens() in compaction.ts to use totalTokens field

Closes #130

Don't miss a new pi-mono release

NewReleases is sending notifications on new releases.