AISE-TUDelft / coco

AI Code Completions for Jetbrains and VSCode
0 stars 0 forks source link

Reintroduce rate limiting #11

Closed Ar4l closed 1 week ago

Ar4l commented 2 weeks ago

Found two FastAPI rate limiters, each with an implementation issue:

  1. slowapi: does not support websocket streaming.
  2. fastapi-limiter: requires running redis docker container to maintain rate/user in-memory (this is probably overkill for our mvp).

We need to either search for alternatives or address the issue in one of these libraries. Writing our own for an MVP is also not out of the question, we simply maintain a set in-memory.

RebelOfDeath commented 1 week ago

A custom implementation of this was pushed in 31fe08d119cdf1f67b2116b1771ea1fbbb0e9a58 based on the session tracking outlined in #8

RebelOfDeath commented 1 week ago

As far as I can tell, the basis for this has been set (although testing of this might prove otherwise); it is for this reason that I will close this issue. In #10 with the more rigorous testing that will be conducted potentially stimulating changes to the implementation outlined here.