Check out the tutorial.
-
Fork/Clone
-
Create and activate a virtual environment:
$ python3 -m venv venv && source venv/bin/activate
-
Install the requirements:
(venv)$ pip install -r requirements.txt
-
Start a Redis server for backing storage:
(venv)$ docker run -p 6379:6379 -d redis:5
-
Run the server with memory profiler:
(venv)$ mprof run uvicorn core.asgi:application --port 8000 --lifespan off --host 0.0.0.0 --workers 1
Or run with memray for the report
(venv)$ memray run --force -o output.bin -m uvicorn core.asgi:application --port 8000 --lifespan off --host 0.0.0.0 --workers 1
Show results:
(venv)$ memray flamegraph output.bin --force
- Navigate to http://localhost:8000/chat/. Reload the page many times or send messages..