How is that For Flexibility?
As everybody is well conscious, the world is still going nuts attempting to develop more, more recent and better AI tools. Mainly by tossing absurd amounts of cash at the issue. Many of those billions go towards constructing inexpensive or free services that operate at a substantial loss. The tech giants that run them all are hoping to draw in as numerous 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 supremacy is reached, anticipate the enshittification to begin.
A likely method to make back all that money for establishing these LLMs will be by tweaking their outputs to the liking of whoever pays one of the most. An example of what that such tweaking looks like is the rejection of DeepSeek's R1 to discuss what occurred at Tiananmen Square in 1989. That a person is certainly politically encouraged, however ad-funded services will not exactly be fun either. In the future, I fully anticipate to be able to have a frank and truthful conversation about the Tiananmen occasions with an American AI representative, however the only one I can pay for will have presumed the persona of Father Christmas who, while holding a can of Coca-Cola, will intersperse the recounting of the tragic events with a happy "Ho ho ho ... Didn't you understand? The holidays are coming!"
Or maybe that is too far-fetched. Today, dispite all that money, the most popular service for code conclusion still has problem working with a couple of easy words, despite them existing in every dictionary. There need to be a bug in the "totally free speech", or something.
But there is hope. One of the techniques of an approaching gamer to shake up the market, is to damage the incumbents by launching their design free of charge, under a liberal license. This is what DeepSeek simply made with their DeepSeek-R1. Google did it earlier with the Gemma models, as did Meta with Llama. We can download these designs ourselves and run them on our own hardware. Even better, individuals 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, though. There are two choices to select from if you wish to run an LLM in your area. You can get a big, powerful video card from Nvidia, or you can buy an Apple. Either is expensive. The main spec that how well an LLM will carry out is the amount of memory available. VRAM when it comes to GPU's, regular RAM in the case of Apples. Bigger is better here. More RAM implies bigger models, which will considerably improve the quality of the output. Personally, I 'd say one requires at least over 24GB to be able to run anything beneficial. That will fit a 32 billion parameter design with a little headroom to spare. Building, or buying, a workstation that is equipped to manage that can quickly cost thousands of euros.
So what to do, if you don't have that quantity of money to spare? You purchase pre-owned! This is a viable choice, but as always, there is no such thing as a complimentary lunch. Memory may be the main concern, but do not ignore the significance of memory bandwidth and other specs. Older devices will have lower performance on those aspects. But let's not fret excessive about that now. I am interested in building something that at least can run the LLMs in a functional way. Sure, the latest Nvidia card may do it faster, however the point is to be able to do it at all. Powerful online designs can be great, but one should at least have the choice to switch to a regional one, if the scenario requires it.
Below is my attempt to build such a capable AI computer without investing excessive. I ended up with a workstation with 48GB of VRAM that cost me around 1700 euros. I could have done it for setiathome.berkeley.edu less. For example, it was not strictly needed to purchase a brand name new dummy GPU (see listed below), or I might have discovered somebody that would 3D print the cooling fan shroud for me, rather of delivering a ready-made one from a faraway country. I'll admit, I got a bit restless at the end when I found out I needed to buy yet another part to make this work. For me, this was an acceptable tradeoff.
Hardware
This is the full cost breakdown:
And this is what it looked liked when it first booted with all the parts installed:
I'll provide some context on the parts below, and after that, I'll run a few fast tests to get some numbers on the efficiency.
HP Z440 Workstation
The Z440 was an easy pick since I already owned it. This was the beginning point. About two years earlier, I wanted a computer system that might serve 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 lot of memory, that should work for hosting VMs. I bought it secondhand and then switched the 512GB hard disk drive for a 6TB one to keep those virtual machines. 6TB is not needed for running LLMs, and for that reason I did not include it in the breakdown. But if you prepare to collect many designs, 512GB may not be enough.
I have pertained to like this workstation. It feels all extremely solid, and I have not had any issues with it. A minimum of, until I began this job. It turns out that HP does not like competitors, and I experienced some troubles when swapping elements.
2 x NVIDIA Tesla P40
This is the magic ingredient. GPUs are costly. But, similar to the HP Z440, typically one can discover older devices, that used to be leading of the line and is still extremely capable, second-hand, for fairly little money. These Teslas were meant to run in server farms, for things like 3D rendering and other graphic processing. They come equipped with 24GB of VRAM. Nice. They fit in a PCI-Express 3.0 x16 slot. The Z440 has 2 of those, so we buy 2. Now we have 48GB of VRAM. Double nice.
The catch is the part about that they were meant for servers. They will work fine in the PCIe slots of a regular workstation, however in servers the cooling is handled differently. Beefy GPUs take in a great deal of power and can run extremely hot. That is the reason consumer GPUs constantly come geared up with big fans. The cards require to take care of their own cooling. The Teslas, nevertheless, have no fans whatsoever. They get simply as hot, but anticipate the server to supply a consistent circulation of air to cool them. The enclosure of the card is somewhat formed like a pipe, and you have two alternatives: blow in air from one side or blow it in from the other side. How is that for versatility? You definitely should blow some air into it, though, or you will damage it as soon as you put it to work.
The option is basic: simply mount a fan on one end of the pipeline. And certainly, it seems an entire cottage industry has actually grown of people that offer 3D-printed shrouds that hold a basic 60mm fan in simply the best location. The problem is, the cards themselves are already rather bulky, and it is not easy to find a setup that fits 2 cards and 2 fan installs in the computer case. The seller who offered me my 2 Teslas was kind adequate to consist of two fans with shrouds, but there was no method I might fit all of those into the case. So what do we do? We buy more parts.
NZXT C850 Gold
This is where things got frustrating. The HP Z440 had a 700 Watt PSU, which might have sufficed. But I wasn't sure, and I required to buy a brand-new PSU anyway due to the fact that it did not have the ideal connectors to power the Teslas. Using this helpful website, I deduced that 850 Watt would be enough, and I purchased the NZXT C850. It is a modular PSU, suggesting that you only need to plug in the cables that you actually require. It included a neat bag to save the spare cable televisions. One day, I might provide 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 challenging to swap the PSU. It does not fit physically, and they likewise altered the main board and CPU ports. All PSU's I have ever seen in my life are rectangular boxes. The HP PSU likewise is a rectangular box, however with a cutout, making certain that none of the typical PSUs will fit. For no technical factor at all. This is just to tinker you.
The mounting was eventually resolved by using 2 random holes in the grill that I in some way managed to align with the screw holes on the NZXT. It sort of hangs stable now, and I feel lucky that this worked. I have seen Youtube videos where people turned to double-sided tape.
The connector needed ... another purchase.
Not cool HP.
Gainward GT 1030
There is another concern with utilizing server GPUs in this customer workstation. The Teslas are planned to crunch numbers, not to play video games with. Consequently, they do not have any ports to connect a screen to. The BIOS of the HP Z440 does not like this. It refuses to boot if there is no chance to output a video signal. This computer system will run headless, however we have no other option. We need to get a 3rd video card, that we don't to intent to utilize ever, simply to keep the BIOS happy.
This can be the most scrappy card that you can discover, of course, but there is a requirement: we should make it fit on the main board. The Teslas are large and fill the two 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 indicate. One can not purchase any x8 card, though, because typically even when a GPU is advertised as x8, the real port on it may be just 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 obstacle is to discover a fan shroud that suits the case. After some searching, I found this package on Ebay a purchased 2 of them. They came delivered complete with a 40mm fan, and everything fits completely.
Be cautioned that they make a dreadful lot of noise. You don't want to keep a computer with these fans under your desk.
To keep an eye on the temperature, I worked up this quick script and put it in a cron job. It regularly reads out the temperature on the GPUs and sends out that to my Homeassistant server:
In Homeassistant I included a graph to the control panel that shows the values in time:
As one can see, the fans were noisy, but not particularly effective. 90 degrees is far too hot. I searched the internet for an affordable ceiling however could not find anything particular. The documentation on the Nvidia website points out a temperature level of 47 degrees Celsius. But, what they imply by that is the temperature level of the ambient air surrounding the GPU, not the measured worth on the chip. You understand, the number that actually is reported. Thanks, Nvidia. That was valuable.
After some more searching and checking out the viewpoints of my fellow internet citizens, my guess is that things will be great, provided that we keep it in the lower 70s. But don't quote me on that.
My first effort to correct the situation was by setting an optimum to the power consumption of the GPUs. According to this Reddit thread, one can decrease the power usage of the cards by 45% at the expense of just 15% of the performance. I tried it and ... did not notice any distinction at all. I wasn't sure about the drop in performance, having just a couple of minutes of experience with this configuration at that point, but the temperature attributes were certainly the same.
And after that a light bulb flashed on in my head. You see, prior to 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 sucks 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 found a setting for the minimum idle speed of the case fans. It ranged from 0 to 6 stars and was currently set to 0. Putting it at a higher setting did wonders for the temperature level. It also made more noise.
I'll hesitantly admit that the third video card was practical when adjusting the BIOS setting.
MODDIY Main Power Adaptor Cable and Akasa Multifan Adaptor
Fortunately, often things simply work. These two products were plug and play. The MODDIY adaptor cable television 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 nice feature that it can power 2 fans with 12V and two with 5V. The latter certainly lowers the speed and hence the cooling power of the fan. But it likewise decreases sound. Fiddling a bit with this and the case fan setting, I discovered an acceptable tradeoff between sound and temperature level. In the meantime a minimum of. Maybe I will require to revisit this in the summer season.
Some numbers
Inference speed. I collected these numbers by running ollama with the-- verbose flag and asking it five times to write a story and balancing the result:
Performancewise, ollama is set up with:
All models have the default quantization that ollama will pull for you if you don't specify anything.
Another important finding: Terry is by far the most popular name for a tortoise, followed by Turbo and Toby. Harry is a favorite for hares. All LLMs are caring alliteration.
Power consumption
Over the days I kept an eye 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 enhances latency, however takes in more power. My current setup is to have two designs filled, one for coding, the other for generic text processing, and keep them on the GPU for approximately an hour after last use.
After all that, am I delighted that I started this job? Yes, I believe I am.
I invested a bit more cash than prepared, but I got what I desired: a method of in your area running medium-sized models, entirely under my own control.
It was an excellent choice to begin with the workstation I already owned, and see how far I could come with that. If I had actually begun with a new machine from scratch, it certainly would have cost me more. It would have taken me a lot longer too, as there would have been many more options to pick from. I would likewise have been really lured to follow the hype and purchase the most recent and biggest of everything. New and shiny toys are fun. But if I buy something new, I desire it to last for many years. Confidently anticipating where AI will enter 5 years time is difficult right now, so having a cheaper maker, that will last a minimum of some while, feels satisfactory to me.
I want you best of luck by yourself AI journey. I'll report back if I discover something new or interesting.