vectorflow icon indicating copy to clipboard operation
vectorflow copied to clipboard

Swap Flask API for FastAPI

Open dgarnitz opened this issue 2 years ago • 10 comments

Right now we are running Flask with Gunicorn using PM2. There are a few problems with this:

  • Flask is not fast
  • PM2 is designed for node JS, not pythonb

We should swap Flask for FastAPI and (if possible in one PR) swap PM2 for something more appropriate.

Note: We currently depend on Flask-sql alchemy for our DB ORM. We will need to swap this when migrating away from Flask. This may also require changes to the DB services that are also dependencies for the worker and vdb upload worker

dgarnitz avatar Oct 25 '23 15:10 dgarnitz

Also FastAPI have an awesome automatic documentation generation : https://fastapi.tiangolo.com/tutorial/metadata/

OlivierCavadenti avatar Nov 08 '23 15:11 OlivierCavadenti

Thanks for linking that @OlivierCavadenti! Any chance you want to implement this upgrade for us? We would really value your contribution!

dgarnitz avatar Nov 08 '23 19:11 dgarnitz

Thanks for linking that @OlivierCavadenti! Any chance you want to implement this upgrade for us? We would really value your contribution!

I can check want I can do !

OlivierCavadenti avatar Dec 01 '23 08:12 OlivierCavadenti

Hi @dgarnitz , I will love take this take on

datgerhardt avatar Feb 17 '24 20:02 datgerhardt

Go for it!

dgarnitz avatar Feb 18 '24 22:02 dgarnitz

Let me know if I can help!

dgarnitz avatar Feb 18 '24 22:02 dgarnitz

Hi @dgarnitz, I was trying to maintain the abstraction of the request to get API Keys and files. I am having issues with handling the files. This is sample representation of the file "<_io.BufferedReader name='api/tests/fixtures/test_text.txt'>"

Also with this approach we will lose better auto docs generation support

datgerhardt avatar Mar 12 '24 21:03 datgerhardt

@datgerhardt Can you provide me with more context around the bug you ran into? Perhaps some screenshots or a code snippet

dgarnitz avatar Mar 18 '24 13:03 dgarnitz

Any update?

david-vectorflow avatar Mar 29 '24 01:03 david-vectorflow

Thanks for your patience, I had the Internet outage in Ghana due to a problem with undersea cable for past few weeks

datgerhardt avatar Apr 01 '24 23:04 datgerhardt