As everybody is aware, the world is still going nuts trying to establish more, newer and much better AI tools. Mainly by throwing unreasonable quantities of money at the problem. Many of those billions go towards developing inexpensive or totally free services that operate at a significant loss. The tech giants that run them all are wishing to draw in as many users as possible, so that they can catch the market, and become the dominant or only party that can provide them. It is the timeless Silicon Valley playbook. Once dominance is reached, anticipate the enshittification to start.
A likely way to earn back all that cash for developing these LLMs will be by tweaking their outputs to the preference of whoever pays one of the most. An example of what that such tweaking appears like is the rejection of DeepSeek's R1 to discuss what took place at Tiananmen Square in 1989. That one is certainly politically encouraged, however ad-funded services won't exactly be fun either. In the future, I fully expect to be able to have a frank and sincere discussion about the Tiananmen occasions with an American AI agent, but the just one I can manage will have presumed the persona of Father Christmas who, while holding a can of Coca-Cola, will sprinkle the recounting of the terrible occasions with a happy "Ho ho ho ... Didn't you know? The holidays are coming!"
Or perhaps that is too far-fetched. Right now, dispite all that money, the most popular service for code conclusion still has problem dealing with a number of easy words, despite them existing in every dictionary. There must be a bug in the "complimentary speech", or something.
But there is hope. One of the tricks of an approaching gamer to shake up the market, is to damage the incumbents by releasing their design free of charge, under a liberal license. This is what DeepSeek just made with their DeepSeek-R1. Google did it previously with the Gemma designs, as did Meta with Llama. We can download these designs ourselves and run them on our own hardware. Even better, people can take these models and scrub the biases from them. And we can download those scrubbed models and run those on our own hardware. And after that we can finally have some genuinely beneficial LLMs.
That hardware can be a difficulty, however. There are 2 alternatives to choose from if you desire to run an LLM locally. You can get a huge, powerful video card from Nvidia, or you can purchase an Apple. Either is pricey. The main specification that shows how well an LLM will carry out is the quantity of memory available. VRAM in the case of GPU's, regular RAM in the case of Apples. Bigger is better here. More RAM indicates bigger designs, which will drastically enhance the quality of the output. Personally, I 'd say one requires a minimum of over 24GB to be able to run anything useful. That will fit a 32 billion criterion model with a little headroom to spare. Building, or buying, a workstation that is equipped to manage that can easily cost thousands of euros.
So what to do, if you don't have that quantity of money to spare? You buy second-hand! This is a viable choice, but as always, there is no such thing as a free lunch. Memory might be the main concern, but don't underestimate the value of memory bandwidth and other specifications. Older equipment will have lower performance on those elements. But let's not stress excessive about that now. I am interested in constructing something that a minimum of can run the LLMs in a functional method. Sure, the most recent Nvidia card might do it quicker, however the point is to be able to do it at all. Powerful online models can be great, however one ought to at least have the choice to switch to a regional one, if the scenario requires it.
Below is my attempt to develop such a capable AI computer system without spending excessive. I ended up with a workstation with 48GB of VRAM that cost me around 1700 euros. I could have done it for less. For example, it was not strictly essential to buy a brand brand-new dummy GPU (see below), or I could have found someone that would 3D print the cooling fan shroud for me, rather of delivering a ready-made one from a distant country. I'll confess, I got a bit restless at the end when I discovered I needed to buy yet another part to make this work. For me, this was an acceptable tradeoff.
Hardware
This is the complete cost breakdown:
And this is what it appeared like when it initially booted up with all the parts set up:
I'll offer some context on the parts below, and after that, I'll run a few fast tests to get some numbers on the performance.
HP Z440 Workstation
The Z440 was an easy pick due to the fact that I currently owned it. This was the beginning point. About two years back, I wanted a computer that could act as a host for my virtual devices. The Z440 has a Xeon processor with 12 cores, and this one sports 128GB of RAM. Many threads and a great deal of memory, that need to work for hosting VMs. I bought it secondhand and after that switched the 512GB disk drive for a 6TB one to keep those virtual devices. 6TB is not needed for running LLMs, and therefore I did not include it in the breakdown. But if you prepare to gather lots of models, 512GB may not be enough.
I have actually pertained to like this workstation. It feels all extremely solid, and I have not had any issues with it. At least, until I started this project. It ends up that HP does not like competitors, and I came across some difficulties when switching elements.
2 x NVIDIA Tesla P40
This is the magic ingredient. GPUs are expensive. But, similar to the HP Z440, asteroidsathome.net typically one can discover older equipment, that used to be leading of the line and is still really capable, second-hand, for fairly little cash. These Teslas were suggested to run in server farms, for things like 3D making and other graphic processing. They come geared up with 24GB of VRAM. Nice. They fit in a PCI-Express 3.0 x16 slot. The Z440 has 2 of those, so we purchase two. Now we have 48GB of VRAM. Double nice.
The catch is the part about that they were suggested for servers. They will work fine in the PCIe slots of a typical workstation, but in servers the cooling is managed in a different way. Beefy GPUs consume a lot of power and can run really hot. That is the factor customer GPUs always come geared up with huge fans. The cards require to take care of their own cooling. The Teslas, nevertheless, have no fans whatsoever. They get simply as hot, however expect the server to supply a steady flow of air to cool them. The enclosure of the card is rather formed like a pipe, and you have two options: blow in air from one side or blow it in from the opposite. How is that for ? You definitely must blow some air into it, though, or you will damage it as quickly as you put it to work.
The solution is basic: just mount a fan on one end of the pipeline. And certainly, it seems a whole home industry has grown of people that sell 3D-printed shrouds that hold a standard 60mm fan in simply the right location. The problem is, the cards themselves are currently rather bulky, and it is challenging to discover a setup that fits 2 cards and two fan mounts in the computer case. The seller who sold me my 2 Teslas was kind enough to include two fans with shrouds, but there was no other way I could fit all of those into the case. So what do we do? We purchase more parts.
NZXT C850 Gold
This is where things got irritating. The HP Z440 had a 700 Watt PSU, which may have sufficed. But I wasn't sure, and I required to buy a new PSU anyhow since it did not have the ideal ports to power the Teslas. Using this helpful website, I deduced that 850 Watt would be sufficient, and I bought the NZXT C850. It is a modular PSU, meaning that you just require to plug in the cable televisions that you really need. It included a neat bag to store the extra cable televisions. One day, I might offer it a good cleaning and use it as a toiletry bag.
Unfortunately, HP does not like things that are not HP, so they made it difficult to swap the PSU. It does not fit physically, and they also altered the main board and CPU connectors. All PSU's I have ever seen in my life are rectangular boxes. The HP PSU likewise is a rectangle-shaped box, but with a cutout, making certain that none of the regular PSUs will fit. For no technical factor at all. This is simply to mess with you.
The installing was ultimately solved by utilizing 2 random holes in the grill that I somehow managed to line up with the screw holes on the NZXT. It sort of hangs steady now, and I feel fortunate that this worked. I have actually seen Youtube videos where individuals resorted to double-sided tape.
The adapter required ... another purchase.
Not cool HP.
Gainward GT 1030
There is another issue with utilizing server GPUs in this consumer workstation. The Teslas are intended to crunch numbers, not to play video games with. Consequently, they don't have any ports to link a screen to. The BIOS of the HP Z440 does not like this. It declines to boot if there is no other way to output a video signal. This computer will run headless, however we have no other choice. We need to get a third video card, that we do not to intent to use ever, just to keep the BIOS delighted.
This can be the most scrappy card that you can discover, naturally, but there is a requirement: we should make it fit on the main board. The Teslas are bulky and fill the 2 PCIe 3.0 x16 slots. The only slots left that can physically hold a card are one PCIe x4 slot and one PCIe x8 slot. See this site for some background on what those names suggest. One can not purchase any x8 card, however, because typically even when a GPU is advertised as x8, the actual adapter on it may be simply as broad as an x16. Electronically it is an x8, physically it is an x16. That will not deal with this main board, we really need the small adapter.
Nvidia Tesla Cooling Fan Kit
As said, the difficulty is to discover a fan shroud that fits in the case. After some searching, I discovered this set on Ebay a purchased two of them. They came delivered complete with a 40mm fan, and everything fits completely.
Be warned that they make a horrible lot of noise. You don't want to keep a computer system with these fans under your desk.
To keep an eye on the temperature level, I whipped up this fast script and put it in a cron task. It occasionally reads out the temperature on the GPUs and sends that to my Homeassistant server:
In Homeassistant I included a graph to the control panel that shows the values with time:
As one can see, the fans were noisy, but not especially effective. 90 degrees is far too hot. I searched the internet for a sensible upper limitation however could not find anything particular. The documentation on the Nvidia site discusses a temperature level of 47 degrees Celsius. But, what they mean by that is the temperature level of the ambient air surrounding the GPU, not the measured value on the chip. You understand, the number that really is reported. Thanks, Nvidia. That was valuable.
After some further browsing and checking out the viewpoints of my fellow internet citizens, my guess is that things will be fine, supplied that we keep it in the lower 70s. But do not quote me on that.
My very first effort to correct the circumstance was by setting a maximum to the power consumption of the GPUs. According to this Reddit thread, one can lower the power intake of the cards by 45% at the expense of only 15% of the performance. I attempted it and ... did not discover any difference at all. I wasn't sure about the drop in performance, having just a number of minutes of experience with this configuration at that point, but the temperature qualities were certainly unchanged.
And then a light bulb flashed on in my head. You see, just before the GPU fans, there is a fan in the HP Z440 case. In the image above, it remains in the best corner, inside the black box. This is a fan that draws air into the case, and I figured this would work in tandem with the GPU fans that blow air into the Teslas. But this case fan was not spinning at all, because the remainder of the computer did not need any cooling. Checking out the BIOS, I discovered a setting for the minimum idle speed of the case fans. It varied from 0 to 6 stars and was currently set to 0. Putting it at a higher setting did marvels for the temperature level. It likewise made more noise.
I'll reluctantly confess that the third video card was helpful when changing the BIOS setting.
MODDIY Main Power Adaptor Cable and Akasa Multifan Adaptor
Fortunately, sometimes things simply work. These 2 items were plug and play. The MODDIY adaptor cable linked the PSU to the main board and CPU power sockets.
I utilized the Akasa to power the GPU fans from a 4-pin Molex. It has the good function that it can power 2 fans with 12V and two with 5V. The latter certainly lowers the speed and therefore the cooling power of the fan. But it likewise reduces noise. Fiddling a bit with this and the case fan setting, I found an appropriate tradeoff in between noise and temperature level. For now a minimum of. Maybe I will require to review this in the summer season.
Some numbers
Inference speed. I gathered these numbers by running ollama with the-- verbose flag and asking it 5 times to write a story and balancing the outcome:
Performancewise, ollama is set up with:
All designs have the default quantization that ollama will pull for you if you don't define anything.
Another crucial finding: Terry is by far the most popular name for a tortoise, followed by Turbo and Toby. Harry is a preferred for hares. All LLMs are caring alliteration.
Power usage
Over the days I watched on the power consumption of the workstation:
Note that these numbers were taken with the 140W power cap active.
As one can see, there is another tradeoff to be made. Keeping the model on the card improves latency, however consumes more power. My present setup is to have actually 2 designs filled, one for coding, the other for generic text processing, and keep them on the GPU for up to an hour after last use.
After all that, am I delighted that I began this job? Yes, I believe I am.
I invested a bit more cash than planned, however I got what I desired: a way of in your area running medium-sized designs, totally under my own control.
It was a good option to start with the workstation I already owned, and see how far I could feature that. If I had actually begun with a brand-new device from scratch, it certainly would have cost me more. It would have taken me a lot longer too, as there would have been much more alternatives to pick from. I would also have been very tempted to follow the hype and purchase the most recent and biggest of everything. New and glossy toys are enjoyable. But if I buy something new, I desire it to last for several years. Confidently anticipating where AI will go in 5 years time is impossible right now, so having a less expensive maker, that will last a minimum of some while, feels acceptable to me.
I wish you all the best by yourself AI journey. I'll report back if I find something brand-new or interesting.
1
How is that For Flexibility?
Ada Koehler edited this page 2025-02-11 23:41:37 +08:00