Skip to content

fix: sync Gemini tool-use prompt tokens from Python any-llm - #29

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/any-llm-library-sync-3409
Closed

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/any-llm-library-sync-3409

Conversation

@cursor

@cursor cursor Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Sync with mozilla-ai/any-llm main through c2420fa (2 new commits since 2388f59). One PR for the applicable library change.

Ported

  • #1367: include Gemini tool-use prompt tokens in promptTokens. Gemini reports server-side tool tokens in toolUsePromptTokenCount, which is excluded from promptTokenCount but included in totalTokenCount. Streaming and non-streaming completions now add that field so promptTokens + completionTokens matches totalTokens. Cached tokens stay a prompt-token subset; thought tokens stay completion-token details. Vertex AI inherits the same conversion.

Skipped (not applicable)

  • #1373: refresh retired Nebius/Portkey/Moonshot integration model pins. Python tests/conftest.py fixtures only; this repo has no matching live model map.

Draft sync PR #28 is still open but was created 2026-09-04, so this is a new PR rather than a push onto that branch.

Tracked source SHA is now c2420fac99c438518249dc56880aaee565a20efd. oxfmt and oxlint were run after the changes.

Open in Web View Automation 

Include Gemini toolUsePromptTokenCount in promptTokens so streaming and
non-streaming usage categories sum to totalTokens, matching mozilla-ai/any-llm #1367.

Co-authored-by: Anurag Roy <anuragroy@duck.com>
@vercel

vercel Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
any-llm-ts Ready Ready Preview Sep 8, 2026 3:35am UTC

@cursor

cursor Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #32, which rebases this change onto current main (after #28) and combines it with #30 and #31.

@anurag-roy anurag-roy closed this Sep 13, 2026
@anurag-roy
anurag-roy deleted the cursor/any-llm-library-sync-3409 branch September 20, 2026 11:33

This branch was successfully deployed

1 active deployment
Preview — f2d49678 Deployed Sep 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants