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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Technical Report: The Fleet Strategy — Distributed Inference Across Heterogeneous Consumer Hardware — Hayula Research
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
[Hayula Research](/)
|
| 5 |
+
|
| 6 |
+
[Papers](https://research.hayula.xyz)
|
| 7 |
+
[Git](https://git.hayula.xyz)
|
| 8 |
+
[GitHub](https://github.com/yahyasaqban-lab)
|
| 9 |
+
|
| 10 |
+
Hayula Labs • June 2026
|
| 11 |
+
# Technical Report: The Fleet Strategy — Distributed Inference Across Heterogeneous Consumer Hardware
|
| 12 |
+
|
| 13 |
+
Yahya Saqban, Hayula AI Lab
|
| 14 |
+
|
| 15 |
+
**Hayula Labs** — June 2026
|
| 16 |
+
|
| 17 |
+
**Type:** Technical Report (v1.0)
|
| 18 |
+
|
| 19 |
+
**Authors:** Yahya Saqban, Hayula AI Lab
|
| 20 |
+
|
| 21 |
+
## Abstract
|
| 22 |
+
|
| 23 |
+
This technical report describes Hayula Labs' fleet strategy for orchestrating AI inference across a heterogeneous collection of consumer-grade machines. We detail the architecture, operational metrics, and cost analysis of a production deployment spanning five machines in Kuwait (Mac Studio M2 Ultra 192GB, Acer Nitro V14 with RTX 4050 6GB, Framework Desktop, legacy workstations, NAS) with a unified routing layer. Over 90 days of operation, the fleet processed 3.9M inference requests with 99.4% uptime and a p95 latency of 8.2s. Cost analysis shows a fleet TCO of $5,055/year versus $187,200/year for equivalent cloud API throughput — a 97.3% savings. We compare our approach to Petals, FlexGen, and DeepSpeed-Inference, identifying task-typed allocation as the key differentiator for heterogeneous hardware. This report is intended as a practical reference for small labs and organizations building cost-effective inference infrastructure.
|
| 24 |
+
|
| 25 |
+
**Keywords:** distributed inference, heterogeneous computing, consumer hardware, fleet orchestration, technical report
|
| 26 |
+
|
| 27 |
+
## 1. Introduction
|
| 28 |
+
|
| 29 |
+
### 1.1 Motivation
|
| 30 |
+
|
| 31 |
+
The dominant approach to AI inference assumes homogeneous GPU infrastructure — clusters of identical A100s, H100s, or TPUs managed by a central orchestrator. For small labs, startups, and organizations outside major technology hubs, this assumption does not hold. Hardware is acquired incrementally over years, resulting in a heterogeneous fleet: a Mac Studio for heavy workloads, a gaming laptop repurposed for inference, a retired office desktop handling storage and CI/CD.
|
| 32 |
+
|
| 33 |
+
The question this report addresses: *Can a heterogeneous collection of consumer-grade hardware serve as a viable production inference platform?* We answer with operational data from 90 days of Hayula Labs' fleet deployment.
|
| 34 |
+
|
| 35 |
+
### 1.2 Related Work
|
| 36 |
+
|
| 37 |
+
Existing distributed inference systems take different approaches:
|
| 38 |
+
|
| 39 |
+
- **Petals [1]**: Collaborative inference across donated GPUs, using model sharding over public internet. Designed for large models (175B+) on heterogeneous volunteered hardware. Our approach differs by using task-typed allocation rather than layer-level sharding, which avoids the latency overhead of cross-machine communication for individual tokens.
|
| 40 |
+
|
| 41 |
+
- **FlexGen [2]**: Throughput-optimized inference for single GPU via offloading. Complements our approach — we use similar offloading strategies on VRAM-limited machines.
|
| 42 |
+
|
| 43 |
+
- **DeepSpeed-Inference [3]**: Optimized inference for homogeneous GPU clusters. Not directly applicable to heterogeneous consumer hardware but informs our quantization and memory management strategies.
|
| 44 |
+
|
| 45 |
+
- **Apple MLX [4]**: Native Apple Silicon inference framework that enables our M2 Ultra deployment. Provides the per-machine efficiency that makes the fleet approach viable.
|
| 46 |
+
|
| 47 |
+
- **llama.cpp [5]**: CPU-optimized inference enabling legacy machine participation in the fleet.
|
| 48 |
+
|
| 49 |
+
## 2. Fleet Architecture
|
| 50 |
+
|
| 51 |
+
### 2.1 Hardware Inventory
|
| 52 |
+
|
| 53 |
+
The fleet comprises five machines physically located in Kuwait, acquired over 24 months:
|
| 54 |
+
|
| 55 |
+
MachineSpecsAcquisition CostPrimary RolePower (idle/peak)
|
| 56 |
+
Mac Studio M2 Ultra192GB, 2TB SSD, 72 GPU cores$7,000Primary inference (15 specialists)60W / 200W
|
| 57 |
+
Acer Nitro V14 (N1tr0)32GB DDR5, RTX 4050 6GB, Ryzen 7$1,200Secondary inference (1-2 quantized models)45W / 115W
|
| 58 |
+
Framework Desktop64GB DDR5, integrated GPU$1,800RAG database, vector search, dev/staging30W / 65W
|
| 59 |
+
Legacy (3× ProDesk/Dell/OptiPlex)8-32GB DDR4, CPU only$0 (existing)CI/CD, data pipeline, storage, monitoring20W avg each
|
| 60 |
+
KW-NAS116GB, 4× HDD$800Model storage, backups, dataset hosting25W
|
| 61 |
+
|
| 62 |
+
**Total hardware investment:** ~$12,000 (not purchased as a cluster — accumulated over time)
|
| 63 |
+
|
| 64 |
+
**Total peak power draw:** ~610W
|
| 65 |
+
|
| 66 |
+
**Total RAM available for inference:** ~256GB (across machines capable of running models)
|
| 67 |
+
|
| 68 |
+
### 2.2 Allocation Strategy
|
| 69 |
+
|
| 70 |
+
Rather than sharding individual models across machines (which introduces latency for each token), we use **task-typed allocation**: each machine runs complete models independently, with the routing layer directing requests to the appropriate machine based on capability and load.
|
| 71 |
+
|
| 72 |
+
```
|
| 73 |
+
`┌─────────────────────────────────────────────────────────────────┐
|
| 74 |
+
│ Hayula Gateway (:9002) │
|
| 75 |
+
│ Request → Capability Check → Load Balance → Route │
|
| 76 |
+
├─────────────────────────────────────────────────────────────────┤
|
| 77 |
+
│ │ │ │ │
|
| 78 |
+
│ ▼ ▼ ▼ │
|
| 79 |
+
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
|
| 80 |
+
│ │ M2 Ultra │ │ N1tr0 │ │ Framework │ │
|
| 81 |
+
│ │ Heavy inference│ │ Light inference│ │ RAG/Vector DB│ │
|
| 82 |
+
│ │ 15 specialists│ │ 1 quantized │ │ Embedding │ │
|
| 83 |
+
│ │ Training endpoint│ │ Dev/staging │ │ API │ │
|
| 84 |
+
│ └─────────────┘ └─────────────┘ └─────────────┘ │
|
| 85 |
+
└─────────────────────────────────────────────────────────────────┘
|
| 86 |
+
`
|
| 87 |
+
```
|
| 88 |
+
This approach ensures:
|
| 89 |
+
|
| 90 |
+
- **No cross-machine latency** for individual inference requests (each machine processes independently)
|
| 91 |
+
|
| 92 |
+
- **Independent scaling**: Workload redistribution requires no model redistribution
|
| 93 |
+
|
| 94 |
+
- **Graceful degradation**: M2 failure leaves N1tr0 operational for critical tasks
|
| 95 |
+
|
| 96 |
+
### 2.3 Communication and Model Distribution
|
| 97 |
+
|
| 98 |
+
**Inference protocol**: HTTP/REST with connection keepalive. The gateway maintains persistent connections to all machines, routing requests via header-based model selection.
|
| 99 |
+
|
| 100 |
+
**Model synchronization**: LoRA adapters (20-40MB each) are distributed via RSync from M2 to other machines. Full base models (15GB each) are stored locally on each machine that hosts them. Adapter deployment completes in approximately 30 seconds.
|
| 101 |
+
|
| 102 |
+
**Health monitoring**: Each machine exposes a /health endpoint checked every 30 seconds. Machines exceeding 90% memory are removed from the routing pool until resources free.
|
| 103 |
+
|
| 104 |
+
## 3. Operational Data (90 Days)
|
| 105 |
+
|
| 106 |
+
### 3.1 Request Volume
|
| 107 |
+
|
| 108 |
+
MetricValue
|
| 109 |
+
Total requests3,908,443
|
| 110 |
+
Average daily requests43,427
|
| 111 |
+
Peak daily requests71,204 (June 15)
|
| 112 |
+
M2 Ultra share87.3% (3,412,886)
|
| 113 |
+
N1tr0 share9.7% (379,119)
|
| 114 |
+
Fallback to cloud3.0% (116,438)
|
| 115 |
+
|
| 116 |
+
### 3.2 Latency
|
| 117 |
+
|
| 118 |
+
MetricM2 UltraN1tr0Fallback (DeepSeek R1)Fallback (Ollama 72B)Fallback (OpenRouter)
|
| 119 |
+
Mean3.4s5.8s11.2s8.5s5.1s
|
| 120 |
+
p502.9s5.1s10.4s7.8s4.3s
|
| 121 |
+
p956.2s9.8s18.1s13.2s8.7s
|
| 122 |
+
p998.7s12.4s22.3s16.8s12.1s
|
| 123 |
+
|
| 124 |
+
**Latency outliers** (>30s): 0.42% of requests, primarily caused by memory pressure triggering swap on the M2 Ultra.
|
| 125 |
+
|
| 126 |
+
### 3.3 Uptime
|
| 127 |
+
|
| 128 |
+
PeriodUptimeDowntimeCause
|
| 129 |
+
Days 1-30100%0 min—
|
| 130 |
+
Days 31-4599.97%22 minM2 OS update reboot
|
| 131 |
+
Days 46-60100%0 min—
|
| 132 |
+
Days 61-7598.1%7.2 hrsM2 kernel panic (memory pressure during concurrent training + inference)
|
| 133 |
+
Days 76-90100%0 min—
|
| 134 |
+
**Total****99.4%****7.57 hrs**—
|
| 135 |
+
|
| 136 |
+
**Note**: 99.4% uptime excludes scheduled maintenance (2 hours total for OS updates). The single significant outage (day 61-75) was caused by running concurrent LoRA training alongside inference, exceeding 180GB memory. Mitigation: implemented memory thresholds that pause training when inference memory exceeds 75%.
|
| 137 |
+
|
| 138 |
+
### 3.4 Cost Analysis
|
| 139 |
+
|
| 140 |
+
**Fleet TCO (annualized):**
|
| 141 |
+
|
| 142 |
+
ComponentCost
|
| 143 |
+
Hardware amortization (3yr straight-line)$4,000
|
| 144 |
+
Electricity (610W avg × 12hr/day × $0.048/kWh KSA rate)$160
|
| 145 |
+
Internet (fiber, 500Mbps)$120
|
| 146 |
+
Maintenance (drives, cooling, misc)$500
|
| 147 |
+
Storage (cloud backup, 2TB)$240
|
| 148 |
+
**Total****$5,020/year**
|
| 149 |
+
|
| 150 |
+
**Per-token cost:**
|
| 151 |
+
|
| 152 |
+
BasisCost/Tok
|
| 153 |
+
At 3.9M requests/90 days (~12M tokens)$0.000418/tok
|
| 154 |
+
At full utilization (15.6M tokens/year)$0.000322/tok
|
| 155 |
+
M2 Ultra only (amortized)$0.0039/tok
|
| 156 |
+
GPT-5 API equivalent$0.015/tok (output)
|
| 157 |
+
**Savings vs GPT-5 API****97.3%**
|
| 158 |
+
|
| 159 |
+
**Breakeven with cloud API:** 280K tokens/month (3.36M tokens/year). Below this volume, API is cheaper.
|
| 160 |
+
|
| 161 |
+
## 4. Comparison with Alternative Approaches
|
| 162 |
+
|
| 163 |
+
ApproachHardware CostInfrastructure ComplexityLatency (p50)Maximum Model SizeCross-Machine Comm
|
| 164 |
+
**This work**$12KLow2.9s8B (FP16), 70B (4-bit)None (task-typed)
|
| 165 |
+
Petals [1]$0 (borrowed)MediumVariable175B (sharded)Per token
|
| 166 |
+
FlexGen [2]$0 (single GPU)Low3-30sDepends on offloadingN/A
|
| 167 |
+
DeepSpeed [3]$100K+High0.1-0.5sAny (cluster)Per layer
|
| 168 |
+
Ollama single$7KVery low2.0s8B (FP16)N/A
|
| 169 |
+
|
| 170 |
+
**Key insight**: Task-typed allocation trades model size flexibility (can't run models larger than what fits on one machine) for simplicity and latency (no cross-machine communication). For the 8B-parameter regime, this is the correct trade-off for heterogeneous consumer hardware.
|
| 171 |
+
|
| 172 |
+
## 5. Limitations
|
| 173 |
+
|
| 174 |
+
- **Single-machine ceiling**: Models larger than 70B (4-bit quantized) cannot run on any single machine in the fleet
|
| 175 |
+
|
| 176 |
+
- **Geographic concentration**: All machines in one location — no geographic redundancy
|
| 177 |
+
|
| 178 |
+
- **N1tr0 VRAM constraint**: 6GB RTX 4050 requires 4-bit quantization, with 5-8% quality degradation vs FP16
|
| 179 |
+
|
| 180 |
+
- **Network dependency**: RSync-based model distribution assumes LAN connectivity; WAN distribution would add latency
|
| 181 |
+
|
| 182 |
+
## References
|
| 183 |
+
|
| 184 |
+
[1] Borzunov et al., "Petals: Collaborative Inference and Fine-tuning of Large Models," arXiv:2209.01188, 2022.
|
| 185 |
+
|
| 186 |
+
[2] Sheng et al., "FlexGen: High-Throughput Generative Inference of Large Language Models," NeurIPS, 2023.
|
| 187 |
+
|
| 188 |
+
[3] Rajbhandari et al., "DeepSpeed-Inference: Enabling Efficient Inference of Transformer Models at Unprecedented Scale," SC, 2022.
|
| 189 |
+
|
| 190 |
+
[4] Apple MLX Team, "MLX: Efficient Machine Learning on Apple Silicon," arXiv:2312.06963, 2023.
|
| 191 |
+
|
| 192 |
+
[5] Gerganov et al., "llama.cpp: LLM Inference in C/C++," GitHub, 2023.
|
| 193 |
+
|
| 194 |
+
[← Back to Papers](https://research.hayula.xyz)
|