Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAI token usage stored incorrectly #614

Closed
simonw opened this issue Nov 6, 2024 · 1 comment
Closed

OpenAI token usage stored incorrectly #614

simonw opened this issue Nov 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@simonw
Copy link
Owner

simonw commented Nov 6, 2024

Spotted this in llm logs -c --json:

      "usage": {
        "completion_tokens": 186,
        "prompt_tokens": 48711,
        "total_tokens": 48897,
        "completion_tokens_details": "CompletionTokensDetails(audio_tokens=0, reasoning_tokens=0, accepted_prediction_tokens=0, rejected_prediction_tokens=0)",
        "prompt_tokens_details": "PromptTokensDetails(audio_tokens=0, cached_tokens=48512)"
      }

Related:

@simonw simonw added the bug Something isn't working label Nov 6, 2024
@simonw simonw closed this as completed in 3352eb9 Nov 6, 2024
@simonw
Copy link
Owner Author

simonw commented Nov 6, 2024

Now looks like this:

      "usage": {
        "completion_tokens": 359,
        "prompt_tokens": 48910,
        "total_tokens": 49269,
        "prompt_tokens_details": {
          "cached_tokens": 48768,
          "audio_tokens": 0
        },
        "completion_tokens_details": {
          "reasoning_tokens": 0,
          "audio_tokens": 0,
          "accepted_prediction_tokens": 0,
          "rejected_prediction_tokens": 0
        }
      },

simonw added a commit that referenced this issue Nov 14, 2024
simonw added a commit that referenced this issue Nov 17, 2024
simonw added a commit that referenced this issue Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant