A comprehensive installer for running AI models locally on Termux (Android) using Debian, Ollama, and various AI models with an interactive setup process.
- Modern Terminal UI with colors, emojis, and progress indicators
- Interactive Installation with step-by-step progress tracking
- Automatic Setup of Debian 12 via PRoot-Distro
- Ollama Integration with automatic installation and configuration
- Model Selection Menu with popular AI models
- TMUX Integration for background Ollama server management
- Error Handling with comprehensive error trapping
- Cross-Platform Compatibility for Termux on Android
The installer provides a selection menu with these options:
- DeepSeek R1 1.5B - Fast, lightweight (recommended for mobile)
- DeepSeek R1 7B - Balanced performance and quality
- DeepSeek R1 14B - Higher quality, more resource intensive
- DeepSeek R1 32B - High quality, requires significant resources
- Custom Models - Any model from the Ollama library
- Low-end devices (2-3GB RAM): 1.5B models
- Mid-range devices (4-6GB RAM): 7B models
- High-end devices (8GB+ RAM): 14B+ models
- Android 7.0+ (API level 24+)
- Termux (latest version from F-Droid or GitHub)
- 2GB free storage for basic models
- 3GB RAM minimum
- Android 10+ for better performance
- 4GB+ RAM for larger models
- 5GB+ free storage for multiple models
- 1.5B models: ~800MB
- 7B models: ~4GB
- 14B models: ~8GB
- 32B models: ~20GB
-
Download from F-Droid (Recommended):
- Install F-Droid first, then search for "Termux"
- Or download directly: https://f-droid.org/packages/com.termux/
-
Download from GitHub:
- Visit: https://github.com/termux/termux-app/releases
- Download the latest APK for your architecture
-
Install the APK and grant necessary permissions
# Update packages
pkg update && pkg upgrade -y
# Install essential tools
pkg install git wget curl -y
# Setup storage access
termux-setup-storage# Clone the repository
git clone https://github.com/Sidharth-e/MOMOS.git
cd MOMOS
# Choose your setup script:
# For simple setup: chmod +x scripts/momo_setup.sh
# For advanced setup: chmod +x scripts/setup.shOption 1: Simple Setup (momo_setup.sh)
# Run the simple setup script
bash scripts/momo_setup.shOption 2: Advanced Setup (setup.sh)
# Run the advanced setup script with progress bars
bash scripts/setup.shWhat the Installer Does:
- Updates Termux packages to latest versions
- Installs PRoot-Distro for Linux distribution support
- Installs Debian 12 with progress tracking
- Presents Model Selection menu with options
- Configures Debian environment
- Installs Ollama automatically
- Downloads Selected Model based on your choice
- Sets up TMUX Session for background Ollama server
- Provides Usage Instructions for next steps
Expected Time: 15-45 minutes depending on internet speed and model size
Once the installer completes, you can use your AI models:
# Enter the Debian environment
proot-distro login debian
# Start chatting with your selected model
ollama run deepseek-r1:1.5b # or whatever model you choseThe installer automatically creates a TMUX session for the Ollama server:
# Enter Debian environment
proot-distro login debian
# Check if TMUX session exists
tmux list-sessions
# Attach to the ollama_server session
tmux attach-session -t ollama_server
# To detach (leave server running): Press CTRL+B then D# Enter Debian environment
proot-distro login debian
# List installed models
ollama list
# Download additional models
ollama pull llama3:8b
ollama pull mistral:7b
# Remove models to free space
ollama rm model_name
# Get model information
ollama show model_nameIf you prefer to run commands directly:
# Enter Debian environment
proot-distro login debian
# Start Ollama server manually
ollama serve
# In another terminal, run any model
proot-distro login debian
ollama run deepseek-r1:1.5b # Fast model
ollama run deepseek-r1:7b # Balanced model
ollama run deepseek-r1:14b # Higher quality model# Solution: Make scripts executable
chmod +x scripts/*.sh
# Check permissions
ls -la scripts/# Solution: Update Termux packages
pkg update && pkg upgrade -y
# Refresh package lists
pkg update# Solution: Setup storage permissions
termux-setup-storage
# Grant permissions in Android Settings > Apps > Termux > Permissions# Check available space
df -h
# Clear Termux cache
pkg clean
# Remove unused packages
pkg autoremove# Check if proot-distro is installed
which proot-distro
# If not found, install it
pkg install proot-distro -y
# Verify installation
proot-distro --help# Check available distributions
proot-distro list
# Try installing Debian again
proot-distro install debian# Enter Debian environment
proot-distro login debian
# Install Ollama manually
curl -fsSL https://ollama.ai/install.sh | sh
# Verify installation
ollama --version# Enter Debian environment
proot-distro login debian
# Check internet connection
ping -c 3 google.com
# Try downloading the model again
ollama pull model_name
# Check available disk space
df -h# Check available RAM
free -h
# Use smaller models for mobile devices
# Recommended: 1.5B, 7B, or 8B models# Monitor memory usage
htop
# Kill unnecessary processes
pkill -f ollamapkg update && pkg upgrade -yproot-distro login debian -- bash -c "apt update && apt upgrade -y"proot-distro login debian -- bash -c "curl -fsSL https://ollama.ai/install.sh | sh"# Use the launcher's model selection
# Or manually:
proot-distro login debian -- bash -c "ollama pull model_name"If you're still having issues:
- Check the troubleshooting section above
- Verify your Android version and Termux compatibility
- Check Termux logs:
logcat | grep termux - Ensure sufficient storage and RAM
- Try a fresh Termux installation if all else fails
- Check your internet connection during installation
Enjoy your modern AI experience on Termux! π§ β¨π€
If this README helped you, consider giving it a star! β