azure-docs icon indicating copy to clipboard operation
azure-docs copied to clipboard

Add additional token calculation information to the Limit Azure OpenAI API token usage API Management policy

Open robinmanuelthiel opened this issue 1 year ago • 3 comments

Add additional token calculation information to the Limit Azure OpenAI API token usage API Management policy

How does the new APIM policy “Limit Azure OpenAI API token usage” estimate-prompt-tokens feature work? How does it estimate the tokens? Only of the prompt or also of the response? What changes, when I activate/deactivate it? The documentation was way too minimal on this.

This change adds some additional information about the impact of setting estimate-prompt-tokens to false.

This is important, because it might cause the probably unexpected behavior of sending requests to the LLM backend, which should have been filtered out by the policy.

Please check for correctness by the Product Team.

robinmanuelthiel avatar Jul 03 '24 12:07 robinmanuelthiel

@robinmanuelthiel : Thanks for your contribution! The author(s) have been notified to review your proposed change.

prmerger-automator[bot] avatar Jul 03 '24 12:07 prmerger-automator[bot]

Learn Build status updates of commit 4c9b755:

:white_check_mark: Validation status: passed

File Status Preview URL Details
articles/api-management/azure-openai-token-limit-policy.md :white_check_mark:Succeeded

For more details, please refer to the build report.

For any questions, please:

@dlepow

Can you review the proposed changes?

Important: When the changes are ready for publication, adding a #sign-off comment is the best way to signal that the PR is ready for the review team to merge.

#label:"aq-pr-triaged" @MicrosoftDocs/public-repo-pr-review-team

Court72 avatar Jul 03 '24 14:07 Court72

@robinmanuelthiel - Thanks for the PR. Let me check with the engineering team about this first before we merge the update.

dlepow avatar Jul 26 '24 21:07 dlepow

@dlepow, For convenience, I committed your suggestions. Please add a #sign-off comment if this PR is ready to merge. Thanks!

Court72 avatar Jul 31 '24 14:07 Court72

Learn Build status updates of commit b218d18:

:white_check_mark: Validation status: passed

File Status Preview URL Details
articles/api-management/azure-openai-token-limit-policy.md :white_check_mark:Succeeded

For more details, please refer to the build report.

For any questions, please:

LGTM

robinmanuelthiel avatar Aug 01 '24 07:08 robinmanuelthiel

Thanks all! #sign-off

dlepow avatar Aug 07 '24 23:08 dlepow