Skip to content

language_models: Improve token counting for providers #32853

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

Merged
merged 1 commit into from
Jun 17, 2025

Conversation

imumesh18
Copy link
Contributor

@imumesh18 imumesh18 commented Jun 17, 2025

We push the usage data whenever we receive it from the provider to make sure the counting is correct after the turn has ended.

  • Ollama
  • Copilot
  • Mistral
  • OpenRouter
  • LMStudio

Put all the changes into a single PR open to move these to separate PR if that makes the review and testing easier.

Release Notes:

  • N/A

- [x] Ollama - [x] Copilot - [x] Mistral - [x] OpenRouter - [x] LMStudio

Signed-off-by: Umesh Yadav <git@umesh.dev>

Co-authored-by: Umesh Yadav <umesh4257@gmail.com>
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jun 17, 2025
@SomeoneToIgnore SomeoneToIgnore added the ai Improvement related to Assistant, Copilot, or other AI features label Jun 17, 2025
Copy link
Member

@benbrandt benbrandt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@benbrandt benbrandt enabled auto-merge (squash) June 17, 2025 10:46
@benbrandt benbrandt merged commit ed4b29f into zed-industries:main Jun 17, 2025
26 of 27 checks passed
@benbrandt benbrandt self-assigned this Jun 17, 2025
@imumesh18 imumesh18 deleted the push-ulsmptmnwlmr branch June 17, 2025 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ai Improvement related to Assistant, Copilot, or other AI features cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants