DEV Community

Jeffrey.Feillp
Jeffrey.Feillp

Posted on

Tian AI: I Built an AI Assistant That Runs 100% Offline on My Phone (No Cloud, No Subscription)

Tian AI: I Built an AI Assistant That Runs 100% Offline on My Phone

I got tired of paying $20/month for ChatGPT, sending my private conversations to servers I don't control, and being useless without internet. So I built my own AI that runs entirely on my phone.

The Problem

Every mainstream AI has the same three problems:

  1. Your data leaves your device — Every query goes to someone else's server
  2. Subscription fees — $10-200/month, forever
  3. No offline mode — Useless when you have no signal

I wanted something that works like Jarvis from Iron Man — a private AI that lives on my device, knows my data, and works anywhere.

What I Built: Tian AI

Tian AI is an open-source, self-evolving AI system that runs completely offline on Android (via Termux), Linux, or any device that can run Python.

Core Specs

Feature Detail
LLM Engine Qwen2.5-1.5B via llama.cpp (runs on ARM/CPU)
Project Size 770+ Python files, 171K+ lines of code
Knowledge Base SQLite with millions of indexed concepts
Backend Flask REST API
Privacy Zero data leaves your device
Cost Free & open source
GitHub github.com/3969129510/tian-ai

Architecture

Tian AI is built around five specialized engines:

1. Thinker — Three-tier reasoning engine:

  • Fast Mode: Simple responses (~1-3s on mobile)
  • Chain-of-Thought: Step-by-step reasoning for complex problems
  • Deep Mode: Multi-perspective analysis with reflection and synthesis

2. Talker — Multi-turn conversation with short/long-term memory

3. Knowledge Retriever — Million-entry SQLite knowledge base with 0.04-0.1s lookup time

4. Agent Scheduler — Autonomous task planning, dependency resolution, and execution

5. Self-Evolution System — The AI analyzes its own code, suggests improvements, and patches itself

The Self-Evolution Feature

This is what makes Tian AI unique. Most AI systems are static — trained once, never changed. Tian AI has an XP/leveling system where:

  • Every interaction earns XP
  • Level-ups unlock new capabilities
  • The system uses Python AST parsing to analyze its own code
  • It generates patches, validates them, and applies them automatically
  • Version tracking: M1 → M1-E1 → M1-E2 → M2

Running on Phone (Real Test)

I run Tian AI on a Realme V70s (Android) via Termux:

# Start llama.cpp server
llama-server -m qwen-1.5b-q4.gguf --port 8080 -t 4 -c 2048

# Launch Tian AI
python run.py
Enter fullscreen mode Exit fullscreen mode

The 1.5B model runs smoothly on mobile hardware. Knowledge retrieval takes under 100ms. Full LLM reasoning takes 1-60s depending on complexity.

Agent System in Action

Tian AI's agent scheduler can autonomously:

  • Plan and execute multi-step tasks
  • Resolve task dependencies (topological sorting)
  • Check safety whitelists before executing commands
  • Self-evaluate after each task
  • Handle file operations, code analysis, and automation

Safety is built in: whitelisted directories, no dangerous commands (rm -rf, sudo), read-only by default.

Why Local AI Matters

The AI industry is obsessed with larger models and bigger clouds. But there's a quiet revolution happening on the edge:

  • Apple Intelligence runs on-device
  • Llama.cpp makes local inference practical
  • Qwen2.5 proves small models can be remarkably capable

Tian AI is part of this movement. It proves that a personal AI doesn't need cloud infrastructure. It doesn't need a subscription. It doesn't need your data.

Get Started

git clone https://github.com/3969129510/tian-ai
cd tian-ai
pip install -r requirements.txt
# Download Qwen2.5-1.5B GGUF model
python run.py
Enter fullscreen mode Exit fullscreen mode

Support the Project

Tian AI is completely free and open source. If you find it useful:

USDT (TRC-20): TNeUMpbwWFcv6v7tYHmkFkE7gC5eWzqbrs
BTC: bc1ph7qnaqkx4pkg4fmucvudlu3ydzgwnfmxy7dkv3nyl48wwa03kmnsvpc2xv

GitHub: github.com/3969129510/tian-ai


Tian AI — Your Private AI, Completely Offline.

Top comments (0)