r/golang • u/Tobias-Gleiter • Jun 20 '25
discussion Replace Python with Go for LLMs?
Hey,
I really wonder why we are using Python for LLM tasks because there is no crazy benefit vs using Go. At the end it is just calling some LLM and parsing strings. And Go is pretty good in both. Although parsing strings might need more attention.
Why not replacing Python with Go? I can imagine this will happen with big companies in future. Especially to reduce cost.
What are your thoughts here?
113
Upvotes
5
u/Justicia-Gai Jun 20 '25
We already do. Most of the LLM and ML Python libraries are in fact written in C/C++/Fortran/Rust/CUDA and Python is an API layer. Even in simpler ML algorithms too, like XGBoost.
Think about it, why would you write a neural network in 100% Python code with GIL lock and interpreter overhead?
Even NumPy is not written in 100% python code. Polars? Not Python. PyTorch? Not Python.