Comment by andai

1 month ago

The one I noticed the most was import openai and import numpy.

They're both about a full second on my old laptop.

I ended up writing my own simple LLM library just so I wouldn't have to import OpenAI anymore for my interactive scripts.

(It's just some wrapper functions around the equivalent of a curl request, which is honestly basically everything I used the OpenAI library for anyway.)

I have noticed how long it takes to import numpy. It made rerunning a script noticably sluggish. Not sure what openai's excuse is, but I assume numpy's slowness is loading some native dlls?

  • OpenAI I haven't used in years but originally it would import many heavy libraries like I believe scikit-learn, and iirc they only used it for the cosine similarity formula for their embeddings function (lol).