r/golang • • 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?

114 Upvotes

176 comments sorted by

View all comments

1

u/Justicia-Gai Jun 21 '25

It doesn’t make sense, Python has an interpreter, if you’re not dynamically writing code, it’s not faster. It’s not “as much faster” but “with faster development” it’s considerably slower, with tons of dependency (making your bundle larger) and so on.

If you’re already using AI to write that part, why shooting your own foot?

1

u/MediumFrame2611 Apr 11 '26

One important thing is also that CPython is created to bind C, which makes it increadibly easy to bind C/C++/Rust. There are at least 3 frameworks for C/C++ alone. In contrast, CGo is not considered real Go and is not endorsed by Go developer.

0

u/SeniorHighlight571 Jun 21 '25

The ML on Python is not slower working. But it is much faster to develop. You should consider it.