docs(response_api): document background mode and its cost polling job - #1443
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
/responsespage never mentionedbackground: true, and the background polling job that prices those responses (CheckResponsesCost, scheduled alongsideCheckBatchCostinproxy_server.py) only appeared in theconfig_settings.mdenv var table and release notes. The batch cost poller is documented inmanaged_batches.mdunder Observability, and the budget reset job under Reset Budgets inusers.md, so this was the one background cost job with no user-facing docThis adds a Background Mode section to
docs/response_api.md: how to create and poll a background response through the proxy, and how the cost gets recorded, since the create call returns before any tokens exist. It documents the polling schedule (proxy_batch_polling_interval/PROXY_BATCH_POLLING_INTERVAL, default 3600s plus up to 30s jitter), the per-cycle cap (MAX_OBJECTS_PER_POLL_CYCLE, default 50), the staleness cutoff (MANAGED_OBJECT_STALENESS_CUTOFF_DAYS, default 7), thePROXY_BATCH_POLLING_ENABLED=falsekill switch shared with the batch poller, and that only the poller's retrieval is billed while user reads ofGET /v1/responses/{id}stay free. Details verified againstenterprise/litellm_enterprise/proxy/common_utils/check_responses_cost.pyandlitellm/proxy/response_api_endpoints/endpoints.py