Skip to content

Fair-use enforcement does not escalate free-tier users who exhaust monthly credits #6083

Closed

Description

@beastoin

Problem

The fair-use classifier never escalates free-tier users who exhaust their 1200 min/month credits. Every enforcement stage transition (none→warning→throttle→restrict) requires misuse_score >= 0.7 from the LLM classifier, but the classifier scores 0.10-0.35 for these users because their conversations are genuinely personal.

4 free whale users hit all soft caps (2h/day, 8h/3-day, 10h/week) consuming 78-163h/week speech — but the classifier clears them every time. Meanwhile, audio still goes to Deepgram even after credits are exhausted, incurring cost for conversations that will be locked anyway.

Root Cause

The escalate_enforcement() function in backend/utils/fair_use.py gates every stage transition on misuse_score >= FAIR_USE_CLASSIFIER_MISUSE_THRESHOLD (0.7). The classifier evaluates content type (audiobooks, podcasts, etc.) — not volume. For free users, the question isn't "is this an audiobook?" but "have you used your allocation?" The existing system design is good but doesn't support free-tier users.

Proposed Fix

  1. Bypass classifier score for free users with exhausted credits: in escalate_enforcement(), when has_transcription_credits(uid) == False and user is on basic plan, escalate based on violation count alone (no LLM score gate needed).

  2. Skip Deepgram when credits exhausted: in both sync.py (skip deepgram_prerecorded()) and transcribe.py (skip dg_socket.send(chunk)), don't send audio to STT when free user's monthly quota is used up. Currently both paths still send audio to Deepgram for conversations that will be locked — pure cost waste.

  3. Keep classifier for paid users: the content-type classifier remains the right tool for unlimited-plan abuse detection.

Acceptance Criteria

  • Free users who exhaust monthly credits escalate through warning→throttle→restrict based on violation count, without requiring classifier misuse_score >= 0.7
  • Deepgram calls are skipped in sync.py when free user credits exhausted
  • Deepgram audio forwarding is skipped in transcribe.py when free user credits exhausted
  • Classifier still runs and gates enforcement for paid users (no change to paid-user path)
  • Existing fair-use stages, notifications, and phrasing are preserved
  • Unit tests cover new free-tier escalation path

by AI for @beastoin

Activity

  1. 75 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions