Local inference, zero cloud dependency

Build your own
AI computer.

From selecting components to running qwen3.6 35b locally on an RTX 5090 — exposed as an API via llama.cpp and wired into OpenCode.Your data stays yours.

RTX 5090llama.cppAPI Serverlocalhost:8080OpenCode● Connectedqwen3.6 35b a3b

Why build a local AI computer?

Large language models have become one of the most powerful tools available to software engineers, but the standard way of using them — sending your prompts through a cloud API — comes with tradeoffs that matter more every day. Privacy, cost, and availability are the three pillars that push people toward running models locally.

This project documents the complete process of building a machine purpose-designed for local AI inference. Starting from hardware selection, through assembly and OS setup, all the way to exposing a running model as an API endpoint that OpenCode can consume directly over your LAN.

The target setup runs qwen3.6 35b a3b — a 35-billion parameter mixture-of-experts model — quantized to Q4_K_M and fully offloaded onto a singleNVIDIA RTX 5090 with 32GB VRAM. The llama.cpp inference engine exposes it via an OpenAI-compatible API on port 8080, and OpenCode connects to it using a single config change. No cloud provider. No API keys. No rate limits.

Privacy first

Your code, your data, your prompts — never leave your network. Everything runs on hardware you own.

Zero cost per token

No subscription, no pay-per-use. After the initial hardware investment, inference is free forever.

No rate limits

Use the model as much as you want. No API caps, no throttling, no vendor lock-in.

Who is this for

  • Software engineers who want AI assistance without sending proprietary code to third-party APIs
  • Computer technicians interested in building and maintaining dedicated AI hardware
  • Technology enthusiasts who want to understand what's inside a local inference rig and how it all works together

Step 01

Select the components

Running a 35-billion parameter model locally demands serious hardware. Here's what you need — and why each component matters.

CPU

ModelAMD Ryzen 9 9950X
Cores / Threads16 / 32
Why it mattersData preprocessing & OS tasks. 16 cores handle everything without breaking a sweat.
Price~€470

GPU Critical

ModelNVIDIA RTX 5090
VRAM32GB GDDR7
Why it mattersThe single most important component. 32GB VRAM lets us load the full 35B model in quantized form with room for context.
Price~€4,075

System RAM

Capacity64GB DDR5-5600
Configuration2 × 32GB DDR5
Why it mattersOS, services, and fallback loading. DDR5-5600 ensures fast data transfer to the CPU.
Price~€943

Storage

ModelSamsung 990 Pro 2TB
TypeNVMe PCIe 4.0 SSD
Why it mattersModel files are large. 2TB gives you room for multiple models, datasets, and the OS.
Price~€345

Power Supply

Wattage1000W 80+ Gold
StandardATX 3.0
Why it mattersThe 5090 has transient power spikes. 1000W ATX 3.0 with native 12V-2x6 cable is non-negotiable.
Price~€131

Case

TypeMid-tower, mesh front
Key featureSupports ultra-wide GPUs (360mm+)
Why it mattersThe 5090 is massive. You need a case with GPU support brackets and excellent airflow for sustained inference loads.
Price~€90

Component cost breakdown

ComponentModelPrice (EUR)
CPUAMD Ryzen 9 9950X~€470
GPUNVIDIA RTX 5090 (32GB)~€4,075
System RAM64GB DDR5-5600 (2×32GB)~€943
StorageSamsung 990 Pro 2TB~€345
Power Supply1000W 80+ Gold ATX 3.0~€131
CaseMid-tower, mesh front~€90
Estimated total~€6,054

Prices sourced from Amazon.de (July 2025). GPU is the dominant cost at ~67% of total. Prices vary by brand, region, and availability.


Step 02

Assemble the machine

Standard PC build process with a few notes specific to the 5090 and high-end builds.

1. Prepare the motherboard

Install the CPU, RAM, and M.2 SSD on the motherboard outside the case. This is significantly easier and reduces the risk of dropping anything inside the case. Update the BIOS to the latest version before installation — AMD's 9950X benefits from recent AGESA updates.

2. Install in the case

Mount the motherboard, route cables, and install the PSU. Leave extra room behind the motherboard tray — the 5090's power cable is thick and needs bending radius.

3. Install the RTX 5090

Use the PCIE1 slot (closest to CPU). The 5090 is approximately 350mm long — verify your case supports it. Connect the two or three 12V-2x6 connectors from the PSU. Do not use adapters — ATX 3.0 native cables are designed for the 5090's power delivery.

4. First boot & verification

Power on and verify all components are detected in BIOS. Run a quick memory test (MemTest86) and confirm the SSD is recognized. Then proceed to install Ubuntu.


Step 03

Install Ubuntu Linux

Ubuntu 24.04 LTS is the sweet spot — excellent NVIDIA driver support, mature tooling, and the default environment for most AI frameworks.

user@ai-server:~

# Update everything

$ sudo apt update && sudo apt upgrade -y


# Install NVIDIA drivers (570+ for 5090)

$ sudo apt install -y nvidia-driver-570

$ sudo reboot


# Verify GPU is detected

$ nvidia-smi

┌─────────────────────────────────────────────────────────────────────────┐

│ NVIDIA-SMI 570.34.00 Driver Version: 570.34.00 CUDA Version: 13.0 │

├─────────────────────────────────────────────────────────────────────────┤

│ GPU Name Persistence-M Bus-Id Disp.A Vitality │

│ 0 NVIDIA RTX 5090 On 00000000:01:00.0 Off | 32GB │

├─────────────────────────────────────────────────────────────────────────┤

│ Memory-Usage GPU-Util Compute M. │

│ 312MiB / 32768MiB 0% Unused │

└─────────────────────────────────────────────────────────────────────────┘


# Install CUDA toolkit

$ sudo apt install -y cuda-toolkit-12-6

$ export PATH=/usr/local/cuda/bin:$PATH

$ export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH


# Install Python and uv (modern package manager)

$ curl -LsSf https://astral.sh/uv/install.sh | sh

$ uv python install 3.12

System configuration

OSUbuntu 24.04 LTS (Noble Numbat)
Kernel6.8+ (HWE kernel for latest hardware)
NVIDIA Driver570.x (proprietary, required for CUDA)
CUDA12.6
Python3.12 (managed via uv)
NetworkStatic LAN IP recommended (e.g., 192.168.1.100)

Step 04

Expose the API

llama.cpp provides a drop-in OpenAI-compatible API server. One command loads the model and starts serving inference requests.

Start the serversingle command

$ llama-server \

--model ./models/qwen3.6-35b-a3b-Q4_K_M.gguf \

--host 0.0.0.0 \

--port 8080 \

--ctx-size 32768 \

--n-gpu-layers 99 \

--threads 16 \

--batch-size 2048


Starting server...

[OK] Model loaded: qwen3.6-35b-a3b-Q4_K_M.gguf

[OK] KV cache: quantized

[OK] Computing mem: 18.17 GiB

[OK] GPU layers: 99 / 102 (fully offloaded)

[OK] Listening on http://0.0.0.0:8080

Model details
Model fileqwen3.6-35b-a3b-Q4_K_M.gguf
Size (Q4_K_M)~22 GB
ArchitectureTransformer, 35B parameters (3× active via MoE)
Context window32K tokens (configurable up to 128K)
Expected throughput~15-25 tokens/sec (single GPU, Q4)
API formatOpenAI-compatible (/v1/chat/completions)

Test the API

curl request

$ curl http://192.168.1.100:8080/v1/chat/completions \

-H "Content-Type: application/json" \

-d {"

"model": "qwen3.6-35b",

"messages": [{"role": "user", "content": "Hello!"}],

"temperature": 0.7

}'


Step 05

Connect OpenCode

Point OpenCode at your local llama.cpp server. Same LAN, zero latency to the cloud, full privacy.

OpenCode config.opencode.json

{

"provider": "openai",

"apiBaseUrl": "http://192.168.1.100:8080/v1",

"apiKey": "sk-no-key-required",

"model": "qwen3.6-35b-a3b"

}


That's it. OpenCode now uses your local model for all conversations.

Architecture overview

OpenCodeYour machineLAN · HTTPllama.cpp server:8080 · OpenAI APICUDARTX 509032GB VRAM · 99 layers.gguf model

What you get

100% Private

Every token stays on your machine. Nothing leaves your LAN.

Zero latency

No API rate limits, no network hops. Just your hardware, full speed.

Fully yours

No subscriptions, no vendor lock-in. Swap models whenever you want.