Skip to content

Conversation

@jamesrkiger
Copy link
Contributor

@jamesrkiger jamesrkiger commented Sep 25, 2025

🗒️ Checklist

  1. run linter locally
  2. update developer docs (API, README, inline, etc.), if any
  3. for user-facing doc changes create a Zulip thread at #Support Docs Updates, if any
  4. draft PR with a title <type>(<scope>)<!>: <title> DEV-1234
  5. assign yourself, tag PR: at least Front end and/or Back end or workflow
  6. fill in the template below and delete template comments
  7. review thyself: read the diff and repro the preview as written
  8. open PR & confirm that CI passes & request reviewers, if needed
  9. delete this section before merging

📣 Summary

Enables aggregation of automated QA billing limits and the inclusion of these limits in service usage data returned by the API.

💭 Notes

We still don't actually have an automated QA feature yet, so this code doesn't do much on its own. But when the feature is built and creates usage counters (see #6262), these will be compared against "llm_requests_limit" metadata in our Stripe plans and included in the calculation of limit balances.

👀 Preview steps

  1. On a Stripe-enabled instance, create a new user on a community plan.
  2. In django-admin add "llm_requests_limit" to the community plan product metadata
  3. Create a project and, using the django shell, add an NLP usage counter for LLM requests on the new project.
  4. Check the API response at api/v2/organizations/{org_id}/service_usage/ and see that the usage is correctly compared to the new plan limit number in the balances field.

@jamesrkiger jamesrkiger marked this pull request as draft September 25, 2025 16:35
@jamesrkiger jamesrkiger self-assigned this Sep 25, 2025
@jamesrkiger jamesrkiger marked this pull request as ready for review November 6, 2025 11:23
@magicznyleszek
Copy link
Member

@jamesrkiger the title shouldn't have square brackets :)

@jamesrkiger jamesrkiger changed the title feat(billing): handle limit aggregation for llm requests [DEV-1031] feat(billing): handle limit aggregation for llm requests DEV-1031 Nov 6, 2025
Copy link
Contributor

@Guitlle Guitlle left a comment

Choose a reason for hiding this comment

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

LGTM

@jamesrkiger jamesrkiger merged commit f87d0fa into main Nov 10, 2025
11 checks passed
@jamesrkiger jamesrkiger deleted the dev-1031-update-stripe-limits-code-for-llm branch November 10, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants