Skip to content

Think about making our Demo AI app more robust #421

Open
@sodic

Description

@sodic

When creating GPT responses in demo-ai, we optimistically generate the response before decrementing user credits. This is:

  • Great for the user - when the open AI call fails, users don't lose credits.
  • Potentially dangerous for us - a malicious user can spam our API and spend more credits than they have.

Malicious users can only cause limited damage, so we went with the optimistic approach and left a comment in the code that explains the tradeoff.

It's possible to implement the logic in a way that doesn't force you to choose, but it's significantly more complicated (extra table, cleanup queue, etc.) Details available here: #391 (comment).

Should we do it? Is it an overkill for the Open Saas template?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions