fireteller

joined 1 year ago
[โ€“] fireteller@alien.top 1 points 11 months ago (1 children)

I do a great deal of work with AI using Go.

TL;dr: I strongly recommend using Go with the llama.cpp bindings (https://github.com/ggerganov/llama.cpp).

Go is particularly well-suited for LLMs, but in a different way than most people discuss here. Firstly, Go is a better language for LLMs to learn and write. This becomes evident when comparing Go with other languages across a variety of coding tasks using ChatGPT. The code generated for Go is often much better: more code can be correctly generated per prompt, and more complicated logic is often handled well in Go, while it's difficult to generate in other languages. This is because Go has less variability; there are fewer alternative ways to do something. Go is very uniformly structured across codebases due to enforced formatting, shares most symbols with C and C++, and has a very complete standard library, making it unambiguous which libraries to include. Training and generating Go code with LLMs is far more performant than any other language I've tried, especially if you use a local model with a Go LoRA, or train your own model on Go.

Go is also well-suited for efficiently handling blocking data tasks such as loading large models from disk to RAM or GPU, or from remote RAM to local RAM, thereby achieving the best available I/O performance (often the bottleneck).

Additionally, Go is the language of choice for web service client and server implementations, working well in contexts where you are using ChatGPT, GitHub, HuggingFace, and other API-based AI and supporting services.

Finally, Go is compilable and cross-compilable to a single executable, making the distribution and remote deployment of applications much less error-prone.

I strongly recommend Go for AI work due to its interaction with all these aspects of the AI ecosystem.

[โ€“] fireteller@alien.top 1 points 11 months ago

I say first use services like Lambda when you need the extra processing power. Then only buy the hardware when it genuinely would be a savings to buy the hardware and train locally.

Also, consumer GPUs / memory bandwidth are quickly exceeded as you want to work on larger and larger models. If you buy early you may quickly find that it is inadequate for your needs.