1+ #! /bin/bash
2+
3+ # OSVMarchi AI/ML Tools Installer
4+ # Installs comprehensive AI, ML, and development tools
5+
6+ set -euo pipefail
7+
8+ # Colors for output
9+ RED=' \033[0;31m'
10+ GREEN=' \033[0;32m'
11+ BLUE=' \033[0;34m'
12+ YELLOW=' \033[1;33m'
13+ NC=' \033[0m' # No Color
14+
15+ log_info () {
16+ echo -e " ${BLUE} [INFO]${NC} $1 "
17+ }
18+
19+ log_success () {
20+ echo -e " ${GREEN} [SUCCESS]${NC} $1 "
21+ }
22+
23+ log_warning () {
24+ echo -e " ${YELLOW} [WARNING]${NC} $1 "
25+ }
26+
27+ log_error () {
28+ echo -e " ${RED} [ERROR]${NC} $1 "
29+ }
30+
31+ # Check if yay is available
32+ check_yay () {
33+ if ! command -v yay & > /dev/null; then
34+ log_error " yay AUR helper is required but not installed"
35+ log_info " Please install yay first: pacman -S yay"
36+ exit 1
37+ fi
38+ }
39+
40+ # Install AI/ML Core Tools
41+ install_ai_core () {
42+ log_info " Installing AI/ML Core Tools..."
43+
44+ local ai_packages=(
45+ " gpt4all" # Chat with GPT-like models locally
46+ " koboldai" # Interactive story/writing AI
47+ " text-generation-webui" # Web front-end for LLMs
48+ " llama-cpp" # Run Llama/CodeLlama efficiently
49+ " ollama-bin" # Easy LLM CLI interface
50+ " whisper-cpp" # Fast local speech-to-text
51+ " stable-diffusion-webui" # Stable Diffusion image generation
52+ )
53+
54+ for pkg in " ${ai_packages[@]} " ; do
55+ log_info " Installing $pkg ..."
56+ if yay -S --noconfirm --needed " $pkg " ; then
57+ log_success " $pkg installed successfully"
58+ else
59+ log_warning " Failed to install $pkg , continuing..."
60+ fi
61+ done
62+ }
63+
64+ # Install AI Development Tools
65+ install_ai_dev () {
66+ log_info " Installing AI Development Libraries..."
67+
68+ local dev_packages=(
69+ " python-deep-translator" # Local multi-language translation
70+ " onnxruntime" # ONNX model runtime (already in main packages)
71+ " sillytavern-git" # Chatbot frontend for local LLMs
72+ " diffusionbee-bin" # Easy Stable Diffusion GUI
73+ )
74+
75+ for pkg in " ${dev_packages[@]} " ; do
76+ log_info " Installing $pkg ..."
77+ if yay -S --noconfirm --needed " $pkg " ; then
78+ log_success " $pkg installed successfully"
79+ else
80+ log_warning " Failed to install $pkg , continuing..."
81+ fi
82+ done
83+ }
84+
85+ # Install Container and VM Tools
86+ install_container_tools () {
87+ log_info " Installing Container and Virtualization Tools..."
88+
89+ local container_packages=(
90+ " devpod-bin" # Development environments in containers
91+ " qemu" # Full system emulation
92+ " libvirt" # Virtualization management
93+ " virt-viewer" # VM console viewer
94+ )
95+
96+ for pkg in " ${container_packages[@]} " ; do
97+ log_info " Installing $pkg ..."
98+ if yay -S --noconfirm --needed " $pkg " ; then
99+ log_success " $pkg installed successfully"
100+ else
101+ log_warning " Failed to install $pkg , continuing..."
102+ fi
103+ done
104+ }
105+
106+ # Show installation summary
107+ show_summary () {
108+ echo
109+ log_success " AI/ML Tools Installation Complete!"
110+ echo
111+ log_info " Installed AI/ML Tools:"
112+ log_info " • gpt4all - Chat with local GPT-like models"
113+ log_info " • koboldai - Interactive story/writing AI"
114+ log_info " • text-generation-webui - LLM web interface"
115+ log_info " • llama-cpp - Efficient Llama model runner"
116+ log_info " • ollama-bin - Easy LLM CLI tool"
117+ log_info " • whisper-cpp - Local speech-to-text"
118+ log_info " • stable-diffusion-webui - Image generation"
119+ echo
120+ log_info " Development Tools:"
121+ log_info " • python-transformers - HuggingFace library (already installed)"
122+ log_info " • onnxruntime - ONNX model runtime (already installed)"
123+ log_info " • tesseract - OCR for images/PDFs (already installed)"
124+ log_info " • rust - Rust programming language (already installed)"
125+ log_info " • clickhouse - Analytics database (already installed)"
126+ log_info " • rocksdb - Key-value database (already installed)"
127+ echo
128+ log_info " Container & VM Tools:"
129+ log_info " • docker + docker-compose (already installed)"
130+ log_info " • kubernetes + kubectl (already installed)"
131+ log_info " • distrobox - Container environments (already installed)"
132+ log_info " • virt-manager - VM management (already installed)"
133+ echo
134+ log_warning " Note: Some AI tools may require additional setup or model downloads"
135+ log_info " Check individual tool documentation for configuration details"
136+ }
137+
138+ # Main installation function
139+ main () {
140+ log_info " Starting AI/ML Tools Installation..."
141+ echo
142+
143+ # Check prerequisites
144+ check_yay
145+
146+ # Install in categories
147+ install_ai_core
148+ echo
149+ install_ai_dev
150+ echo
151+ install_container_tools
152+ echo
153+
154+ # Update package database
155+ log_info " Updating package database..."
156+ sudo updatedb
157+
158+ # Show summary
159+ show_summary
160+ }
161+
162+ # Show help
163+ show_help () {
164+ cat << EOF
165+ OSVMarchi AI/ML Tools Installer
166+
167+ This script installs a comprehensive set of AI, machine learning, and development tools.
168+
169+ USAGE:
170+ $0 [OPTIONS]
171+
172+ OPTIONS:
173+ -h, --help Show this help message
174+
175+ TOOLS INSTALLED:
176+ AI/ML Core:
177+ • gpt4all - Local GPT-like chat models
178+ • koboldai - Interactive AI for writing
179+ • text-generation-webui - LLM web interface
180+ • llama-cpp - Llama model runner
181+ • ollama-bin - Easy LLM CLI
182+ • whisper-cpp - Speech-to-text
183+ • stable-diffusion-webui - Image generation
184+
185+ Development:
186+ • AI development libraries and frameworks
187+ • Container and virtualization tools
188+ • Database systems (ClickHouse, RocksDB)
189+ • Programming languages (Rust, C++)
190+
191+ EXAMPLES:
192+ $0 # Install all AI/ML tools
193+ $0 --help # Show this help
194+
195+ EOF
196+ }
197+
198+ # Parse command line arguments
199+ case " ${1:- } " in
200+ -h|--help)
201+ show_help
202+ exit 0
203+ ;;
204+ " " )
205+ main
206+ ;;
207+ * )
208+ log_error " Unknown option: $1 "
209+ echo " Use '$0 --help' for usage information"
210+ exit 1
211+ ;;
212+ esac
0 commit comments