Open Source

24/7 Headless AI Server on Xiaomi 12 Pro (Snapdragon 8 Gen 1 + Ollama/Gemma4)

A developer transformed an old smartphone into a dedicated, headless AI server accessible over a local network.

Deep Dive

A developer has successfully transformed a Xiaomi 12 Pro smartphone into a dedicated, 24/7 local AI inference server. The project, shared on Reddit, involved a deep technical overhaul of the consumer device to optimize it for continuous LLM operation. The core of the setup is the Snapdragon 8 Gen 1 chipset, which is now dedicated solely to running the Gemma4 large language model via the Ollama framework, making it accessible as an API over a local area network.

To achieve this, the developer first flashed a custom LineageOS ROM to strip away the standard Android user interface and background processes, freeing up approximately 9GB of RAM for the LLM. They then configured a truly headless state by freezing the Android framework and manually compiling networking software. Crucially, they engineered custom scripts for sustainability: a thermal daemon triggers an external cooling fan via a smart plug when CPU temperatures hit 45°C, and a power-delivery script limits battery charging to 80% to prevent degradation during constant operation.

This hack represents a significant proof-of-concept for decentralized, affordable AI infrastructure. By leveraging the powerful System-on-a-Chip (SoC) designs found in flagship smartphones and mitigating their thermal and power limitations through creative engineering, the project opens a path to repurposing older mobile hardware. It provides a blueprint for creating personal, private AI assistants or development endpoints without the cost and complexity of traditional server hardware, pushing the boundaries of where and how AI models can be deployed.

Key Points
  • Device repurposed into a headless server by flashing LineageOS, freeing ~9GB of RAM for the Gemma4 LLM via Ollama.
  • Custom scripts manage thermals (external cooling at 45°C) and battery health (charge capped at 80%) for 24/7 operation.
  • The Snapdragon 8 Gen 1 phone now serves as a LAN-accessible AI API, demonstrating low-cost, local AI infrastructure.

Why It Matters

It proves high-end consumer phones can be cheap, persistent local AI nodes, decentralizing access and reducing hardware costs.