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

Missing prompt_tokens and total_tokens in Usage Object Returned in DeepSeek Model #858

Open
k99k5 opened this issue Jan 8, 2025 · 0 comments
Labels
bug Something isn't working triage

Comments

@k99k5
Copy link

k99k5 commented Jan 8, 2025

What Happened?

{
    "id": "74196500-8b9b-475a-aab3-381cec604587",
    "object": "chat.completion.chunk",
    "created": 1736352401,
    "choices": [
      {
        "index": 0,
        "finish_reason": "stop",
        "message": {
          "role": "assistant",
          "content": "\nif (isset($_POST['like'])) {\n    echo 'Thank you for your support!';\n}\n?>\n"
        }
      }
    ],
    "model": "deepseek-chat",
    "usage": {
      "completion_tokens": 25
    }
  }

What Should Have Happened?

The official API returns the following response:

{"id":"577145fa-34cb-4cc4-b937-6f8e03eafa79","object":"chat.completion.chunk","created":1736355607,"model":"deepseek-chat","system_fingerprint":"fp_3a5770e1b4","choices":[{"index":0,"delta":{"content":""},"logprobs":null,"finish_reason":"stop"}],"usage":{"prompt_tokens":9,"completion_tokens":11,"total_tokens":20,"prompt_cache_hit_tokens":0,"prompt_cache_miss_tokens":9}}

Relevant Code Snippet

No response

Your Twitter/LinkedIn

No response

@k99k5 k99k5 added the bug Something isn't working label Jan 8, 2025
@github-actions github-actions bot added the triage label Jan 8, 2025
@k99k5 k99k5 changed the title Missing prompt_tokens and total_tokens in Usage Object Returned by Cache in DeepSeek Model Missing prompt_tokens and total_tokens in Usage Object Returned in DeepSeek Model Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant