Hardware & InferenceThe full stack

From chip to token — every layer of the LLM inference stack

Apple Silicon vs NVIDIA GPUs · MLX and Core ML · llama.cpp, vLLM, TGI, TensorRT-LLM · GGUF quantization — everything you need to understand and run AI models on any hardware.

Apple SiliconNVIDIA GPUsInference StackQuantization

01Apple Silicon

Apple

The best consumer hardware for local AI

Apple Silicon's unified memory architecture eliminates the CPU↔GPU bottleneck that limits CUDA-based local inference. The GPU and CPU share the same physical DRAM — no PCIe transfers, no memory copies, no bottleneck.

Why this matters for LLMs

LLM inference is memory bandwidth-bound, not compute-bound. Every generated token requires loading all model weights from memory. A Mac M4 Max at 546 GB/s rivals an A100 (2 TB/s) once you account for the 4-bit quantization available locally — effective bandwidth for a Q4 model is comparable. And the Mac does it silently, on battery.

AppleApple M4
base
Neural Engine38 TOPS
Memory Bandwidth120 GB/s
Unified Memory16/32 GB
GPU Cores10

MLX performance

~25 tokens/sec with Llama 3.1 8B (Q4)

First M4 chip. Neural Engine upgraded to 38 TOPS (vs 18 on M3). Excellent for daily use with smaller quantized models.

AppleApple M4 Pro
pro
Neural Engine38 TOPS
Memory Bandwidth273 GB/s
Unified Memory24/48/64 GB
GPU Cores20

MLX performance

~18 tokens/sec with Llama 3.1 70B (Q4_K_M) on 64GB

273 GB/s memory bandwidth — this is the key spec for LLM inference speed. With 64GB you can run 70B models comfortably.

AppleApple M4 Max
max
Neural Engine38 TOPS
Memory Bandwidth546 GB/s
Unified Memory36/64/96/128 GB
GPU Cores40

MLX performance

~35 tokens/sec with Llama 3.1 70B (Q4_K_M) on 128GB

546 GB/s bandwidth makes this a serious inference machine. 128GB unified memory = run 70B models at near full precision or 405B heavily quantized.

AppleApple M3 Ultra
ultra
Neural Engine36 TOPS
Memory Bandwidth819 GB/s
Unified Memory96/192 GB
GPU Cores80

MLX performance

~28 tokens/sec with Llama 3.1 70B (Q4_K_M) on 192GB

Two M3 Max dies connected via UltraFusion. 819 GB/s bandwidth and up to 192GB unified memory — the most capable Apple Silicon available today for local LLM inference. Ships in Mac Studio (2024). Source: apple.com/mac-studio/specs

AppleApple M5
base
Neural Engine38 TOPS
Memory Bandwidth153 GB/s
Unified Memory16/24/32 GB
GPU Cores10

MLX performance

~32 tokens/sec with Llama 3.1 8B (Q4)

First M5 chip, released October 2025. Apple claims doubled AI performance from M4. 153 GB/s bandwidth is 28% faster than M4 base. Built on TSMC N3P (3rd-gen 3nm). Up to 32GB unified memory — a meaningful step up from M4's 32GB ceiling.

AppleApple M5 Pro
pro
Neural Engine38 TOPS
Memory Bandwidth307 GB/s
Unified Memory24/48/64 GB
GPU Cores20

MLX performance

~22 tokens/sec with Llama 3.1 70B (Q4_K_M) on 64GB

307 GB/s memory bandwidth — 12% faster than M4 Pro. Efficiency cores replaced by all-new 'super cores' for improved multithreaded performance. 30% faster than M4 Pro overall. MacBook Pro 14"/16" announced March 2026.

AppleApple M5 Max
max
Neural Engine38 TOPS
Memory Bandwidth614 GB/s
Unified Memory36/64/96/128 GB
GPU Cores40

MLX performance

~42 tokens/sec with Llama 3.1 70B (Q4_K_M) on 128GB

614 GB/s bandwidth — 12% faster than M4 Max. GPU is up to 50% faster for specific ML workflows. 128GB unified memory. M5 Ultra is planned for Mac Studio later in 2026 but not yet available.

Frameworks for Apple Silicon

MLX

MLX is Apple's open-source machine learning framework designed from scratch for the unified memory architecture of Apple Silicon. Unlike PyTorch or JAX which were designed for CUDA GPUs, MLX treats the CPU and GPU as a unified device — no data copies between memory pools. This makes it dramatically more efficient for inference on Mac hardware.

pip install mlx
Core ML

Core ML is Apple's framework for deploying ML models on iOS, iPadOS, macOS, watchOS, and tvOS. It automatically routes computation to the most efficient processor — CPU, GPU, or Neural Engine. Models converted to .mlpackage format run with optimized memory access and power efficiency. Used by on-device Siri, autocorrect, and third-party apps.

02NVIDIA GPUs

NVIDIA

The industry standard for AI training and serving

CUDA's ecosystem dominance makes NVIDIA the default for production AI. From RTX 4090 for local development to GB200 NVL72 racks for hyperscale serving — the full range.

NVIDIANVIDIA H100 SXM5
datacenter
ArchitectureHopper
FP16 TFLOPS1,979 TFLOPS
Memory80GB HBM3
Bandwidth3.35 TB/s
TDP700W

The workhorse of the AI data center. NVLink 4.0 allows 8-GPU NVSwitch configurations. Transformer Engine handles FP8 mixed precision automatically.

~$2–4/hr on AWS p4d, Lambda, Vast.ai
NVIDIANVIDIA H200 SXM
datacenter
ArchitectureHopper (H200)
FP16 TFLOPS1,979 TFLOPS
Memory141GB HBM3e
Bandwidth4.8 TB/s
TDP700W

Same compute as H100, but 141GB HBM3e at 4.8 TB/s bandwidth. The extra memory means you can fit larger models without quantization. ~43% more bandwidth than H100.

~$3–6/hr on Lambda, CoreWeave
NVIDIANVIDIA B200 SXM (Blackwell)
datacenter
ArchitectureBlackwell
FP16 TFLOPS4,500 TFLOPS
Memory192GB HBM3e
Bandwidth8 TB/s
TDP1000W

2× faster than H100 for inference. Introduces FP4 precision (18 PFLOPS). GB200 NVL72 rack connects 72 GPUs into a single logical unit with 1.4 TB of memory. The new standard for 2025+.

Not widely available yet — NVL72 racks starting Q1 2025
NVIDIANVIDIA RTX 4090
consumer
ArchitectureAda Lovelace
FP16 TFLOPS165 TFLOPS
Memory24GB GDDR6X
Bandwidth1.008 TB/s
TDP450W

Best consumer GPU for ML. 24GB VRAM lets you run 13B–34B models quantized. LoRA fine-tuning of 7B–13B models. Widely supported by llama.cpp, vLLM, Ollama.

~$0.40–0.80/hr on Vast.ai
NVIDIANVIDIA RTX 5090
consumer
ArchitectureBlackwell (consumer)
FP16 TFLOPS838 TFLOPS
Memory32GB GDDR7
Bandwidth1.79 TB/s
TDP575W

First consumer GPU with 32GB VRAM and GDDR7 memory. 2× memory bandwidth vs 4090. Can run Llama 3.1 70B at Q3 quantization. Major leap for local AI practitioners.

~$0.70–1.20/hr on Vast.ai (est.)

03Inference Software Stack

Runtimes, serving engines, and harness tools

The layer between your model weights and a running API. Choose based on hardware, scale, and latency requirements.

Inference Stack Layers (top → bottom)

Your Application / API ClientOpenAI-compatible REST endpoint
Serving Layer — Ollama · vLLM · TGI · TRT-LLMBatching, scheduling, streaming, multi-GPU
Runtime Engine — llama.cpp · mlx-lmTokenization, KV cache, attention kernels
Model Weights — GGUF · AWQ · GPTQ · HuggingFaceQuantized weight tensors
Compute Backend — CUDA · Metal · ROCm · CPUKernel execution
Hardware — NVIDIA GPU · Apple Silicon · AMD GPU · CPUPhysical silicon
llama.cppRun any LLM on any hardware — CPU, GPU, or Apple Silicon

llama.cpp is Georgi Gerganov's C/C++ implementation of LLM inference that runs on virtually any hardware with no GPU required. It introduced the GGUF quantization format, enabling 4-bit quantized models to run on consumer hardware. It's the engine behind Ollama, LM Studio, and dozens of other tools.

Backends
CPU (BLAS)CUDAMetal (Apple)VulkanROCm (AMD)SYCL (Intel)
Formats
GGUF
localcpumetalcudaopen-source
brew install llama.cpp GitHub

Key capability: Universal cross-platform inference with GGUF quantization

vLLMHigh-throughput production LLM serving with PagedAttention

vLLM is the leading open-source LLM serving framework for production use, developed at UC Berkeley. Its core innovation is PagedAttention — a memory management algorithm inspired by OS virtual memory that increases GPU KV cache utilization from ~30% to over 90%, enabling much higher throughput at lower cost.

Backends
CUDA (NVIDIA)ROCm (AMD)Intel GaudiTPU (experimental)
Formats
HuggingFaceGGUF (via llama.cpp)AWQGPTQ
productioncudaservinghigh-throughput
pip install vllm GitHub

Key capability: PagedAttention — 24× higher throughput vs naive HuggingFace inference

mlx-lmFirst-class LLM inference and fine-tuning on Apple Silicon via MLX

mlx-lm is Apple's official LLM package built on top of MLX. It provides CLI tools and a Python API for running HuggingFace models on Apple Silicon with full Metal GPU acceleration and unified memory. Supports QLoRA fine-tuning directly on Mac — no CUDA GPU needed.

Backends
Metal (Apple Silicon GPU)CPU fallback
Formats
MLX (native)HuggingFace → MLX conversion
applemetallocalfine-tuningmlx
pip install mlx-lm GitHub

Key capability: Native Apple Silicon LLM inference + QLoRA fine-tuning on Mac

TensorRT-LLMNVIDIA's optimized inference engine — maximum GPU utilization

TensorRT-LLM is NVIDIA's production inference library that compiles LLMs into highly optimized CUDA kernels. It applies operator fusion, INT8/FP8 quantization, and in-flight batching automatically. Used by NVIDIA Triton inference server for serving at data-center scale.

Backends
CUDA (NVIDIA only)
Formats
HuggingFace → TRT-LLM compiled engine
nvidiacudaproductiondata-center
docker pull nvcr.io/nvidia/tritonserver GitHub

Key capability: Operator fusion + FP8 quant = maximum tokens/sec on NVIDIA hardware

Text Generation Inference (TGI)HuggingFace's production-grade LLM serving toolkit

TGI is HuggingFace's open-source LLM serving solution. It implements continuous batching, tensor parallelism across multiple GPUs, token streaming, and quantization (GPTQ, AWQ, EETQ). It powers the HuggingFace Inference Endpoints service and is widely used in enterprise deployments.

Backends
CUDAROCmCPU
Formats
HuggingFaceGPTQAWQEETQ
huggingfaceproductioncudamulti-gpu
docker run ghcr.io/huggingface/text-generation-inference GitHub

Key capability: Continuous batching + tensor parallelism + streaming

OllamaThe easiest way to run any open model locally

Ollama wraps llama.cpp with a user-friendly CLI, automatic model management, and a local REST API that mirrors OpenAI's API. One command to pull and run any model from their library. Auto-detects and uses Metal (Mac), CUDA (NVIDIA), or falls back to CPU.

Backends
Metal (Apple)CUDA (NVIDIA)ROCm (AMD)CPU
Formats
GGUF (via llama.cpp)
localeasyopenai-compatiblecross-platform
brew install ollama && ollama run llama3.1 GitHub

Key capability: One-command model management + OpenAI-compatible local API

04Quantization

GGUF levels, AWQ, GPTQ — choosing the right format

Quantization lets you trade a small amount of quality for a large reduction in memory and compute. Q4_K_M has become the community default — 4× smaller than FP16 with ~98% of the quality.

GGUFGGML Unified Format

GGUF is the file format used by llama.cpp for quantized models. It replaced the older GGML format in August 2023. A single .gguf file contains model weights, tokenizer, metadata, and architecture info. The quantization level trades model quality for file size and memory use.

LevelBits/weight7B VRAMQualityRecommendation
Q2_K2.63~~3.0 GB
Extreme compression — noticeable quality loss
Q4_K_Mdefault4.83~~4.8 GB
Recommended balance — near full quality at 4-bit
Q5_K_M5.68~~5.7 GB
High quality — minimal loss vs FP16
Q6_K6.57~~6.6 GB
Very high quality — near lossless
Q8_08.5~~7.2 GB
Essentially lossless — use when you have the VRAM
F1616~~14.0 GB
Full half precision — reference quality
AWQ
Activation-aware Weight Quantization

AWQ is a 4-bit quantization method that identifies and protects the 1% of weights most important for model quality. Unlike GPTQ (which quantizes uniformly), AWQ achieves better perplexity at the same bit width. Widely supported by vLLM and TGI.

Best for: Best for CUDA GPU inference serving with vLLM
GPTQ
Generative Pre-trained Transformers Quantization

GPTQ is a post-training quantization method that uses second-order information (Hessians) to minimize quantization error layer by layer. Produces INT4 models with minimal accuracy loss. Widely used for HuggingFace model deployment.

Best for: Standard for HuggingFace INT4 quantized models