deepshell / README.md
muralipala1504
Fix: specify Dockerfile.hf in README for HF build
3d52446
|
Raw
History Blame Contribute Delete
11.1 kB
---
title: DeepShell
emoji: πŸ’»
colorFrom: green
colorTo: blue
sdk: docker
dockerfile: Dockerfile.hf
app_port: 7860
license: mit
short_description: AI DevOps assistant with Hindi TTS β€” Linux, Docker, K8s
pinned: false
tags:
- devops
- linux
- docker
- kubernetes
- fastapi
- tts
- hindi
- sysadmin
- llm
- groq
- piper
- infrastructure
- cloud
- ansible
- terraform
---
# πŸ’» DeepShell ModUI
![Python](https://img.shields.io/badge/python-3.11+-blue.svg)
![FastAPI](https://img.shields.io/badge/FastAPI-async-green.svg)
![Docker](https://img.shields.io/badge/docker-ready-2496ED.svg)
![License](https://img.shields.io/badge/license-MIT-purple.svg)
![LLM](https://img.shields.io/badge/LLM-Groq%20%7C%20Cerebras%20%7C%20Ollama-orange.svg)
![TTS](https://img.shields.io/badge/TTS-Piper%20%7C%20Web%20Speech-brightgreen.svg)
> **AI-powered DevOps assistant AND trainer** β€” specialized for Linux SysAdmin, DevOps, Docker, Kubernetes, IaC, and Cloud operations. Not a generic ChatGPT wrapper. Strictly focused. Blazing fast. Runs 100% offline with Ollama.
**Real-time streaming** β€’ **3 AI modes** β€’ **Multilingual Voice TTS** β€’ **Syntax highlighting** β€’ **Light/Dark theme** β€’ **Docker ready** β€’ **Groq + Cerebras + Ollama**
---
## πŸš€ What is DeepShell ModUI?
DeepShell ModUI is a fast, minimal web application that brings AI assistance directly into your infrastructure workflows:
- **Frontend**: Responsive chat UI β€” Vanilla JS, zero frameworks, light/dark theme
- **Backend**: FastAPI with SSE streaming + /translate + /tts endpoints
- **LLM**: Groq (default) β†’ Cerebras (failover) β†’ Ollama (offline)
- **Smart Context**: Maintains conversation history for better responses
- **Strict Scope**: Refuses off-topic questions β€” stays on DevOps/SysAdmin only
- **Three Modes**: Assistant, Trainer, and Dry Run
- **Multilingual TTS**: Piper (offline, self-hosted) for Hindi + Web Speech API for English
Perfect for **DevOps engineers**, **SysAdmins**, **Cloud admins**, and **IaC Specialists** who need accurate commands and scripts β€” fast.
---
## πŸ€– Three Modes β€” One Tool
### πŸ”΅ Assistant Mode (Default)
Fast, direct answers. Commands, scripts, and explanations for DevOps tasks.
### πŸŽ“ Trainer Mode
Structured teaching format β€” ideal for learning and upskilling. Every response follows a consistent teaching structure with What it does, Command/Example, Breaking it down, Common mistakes, Try this next, and Pro tip sections.
### πŸ” Dry Run Mode
Safety-first command analysis β€” see exactly what WOULD happen before running anything. Shows risk level and safe alternatives.
Toggle between modes instantly using the **Assistant / Trainer / Dry Run** buttons in the header.
---
## ✨ Features
### Free Version
- βœ… **Assistant Mode** β€” fast, direct DevOps answers
- βœ… **Trainer Mode** β€” structured teaching with examples and pro tips
- βœ… **Dry Run Mode** β€” safety-first command analysis before execution
- βœ… **πŸ”Š Multilingual Voice TTS** β€” English (Web Speech API) + Hindi via Piper (self-hosted, offline)
- βœ… **🌐 Language selector** β€” EN / HI / TA / TE / AR in header dropdown
- βœ… **πŸ” Replay** β€” replay last response anytime
- βœ… **πŸŒ™/β˜€οΈ Theme toggle** β€” light and dark mode with persistence
- βœ… Real-time streaming responses via SSE
- βœ… Syntax highlighting β€” Bash, Python, Dockerfile, YAML, HCL (Terraform)
- βœ… Session context β€” AI remembers your conversation
- βœ… Copy buttons on all code blocks
- βœ… Export chat as Markdown file
- βœ… Clear chat to reset session
- βœ… Keyboard shortcuts (Ctrl+Enter, Ctrl+K, Escape)
- βœ… Green status indicator β€” live backend health check
- βœ… Strict AI scope β€” politely refuses off-topic questions
- βœ… Works locally or over LAN
- βœ… Docker Compose β€” DeepShell + LibreTranslate as sidecar
- βœ… Start/Stop scripts β€” no terminal lock
- βœ… **Groq** β€” blazing fast cloud inference
- βœ… **Cerebras** β€” failover provider
- βœ… **Ollama** β€” run 100% offline, no API key needed
### Coming Soon β€” Pro Version πŸ’Ž
- πŸ”œ One-click command execution with approval flow
- πŸ”œ Persistent chat history (database)
- πŸ”œ Multi-host support (remote server connections)
- πŸ”œ Workflow automation and command chaining
- πŸ”œ File upload β€” analyze logs and configs
- πŸ”œ Chatterbox TTS β€” cloned voice as your personal instructor
- πŸ”œ Quiz mode for certification prep (RHCSA, CKA, AWS)
- πŸ”œ Stop audio on language switch
---
## πŸ› οΈ Tech Stack
| Layer | Technology |
|-------|-----------|
| Frontend | HTML5, CSS3, Vanilla JavaScript |
| Backend | FastAPI, Uvicorn, SSE |
| LLM (Cloud) | Groq API β€” llama-3.3-70b-versatile |
| LLM (Failover) | Cerebras β€” llama3.1-8b |
| LLM (Local) | Ollama β€” phi3, qwen2.5-coder, llama3 etc |
| Syntax | Prism.js (dark + light themes) |
| Markdown | marked.js |
| TTS (English) | Web Speech API (browser native) |
| TTS (Hindi) | Piper TTS β€” hi_IN-rohan-medium (self-hosted, offline) |
| Translation | LibreTranslate (self-hosted, en→hi) |
| Python | 3.11+ |
---
## 🌐 Multilingual TTS Architecture
DeepShell uses a self-hosted translation + TTS pipeline β€” no cloud APIs, no rate limits, no data leaving your network:
- **English**: Web Speech API (browser built-in, zero latency)
- **Hindi**: LibreTranslate β†’ Piper TTS (offline, self-hosted)
- **Sentence-by-sentence**: Audio starts immediately, no full-response wait
- **Fallback**: If backend TTS fails, falls back to Web Speech API automatically
> ⚠️ **Note**: Switching language mid-playback does not stop current audio. This will be fixed in a future release.
---
## πŸ–ΌοΈ Preview
> 🌐 **Live Demo**: [deepshell.cloud](https://deepshell.cloud) β€” try it directly in your browser!
---
## ⚑ Quick Start (Python β€” No Docker)
### Prerequisites
- Python 3.11+
- Git
- Groq API key β€” [Get one free](https://console.groq.com) OR Ollama for offline use
### 1. Clone and Install
```bash
git clone https://github.com/muralipala1504/deepshell_modui.git
cd deepshell_modui
pip install -r deepshell-backend/requirements.txt
pip install httpx
pip install -e deepshell-backend/
```
### 2. Set Groq API Key
```bash
echo 'export GROQ_API_KEY="your_groq_api_key_here"' >> ~/.bashrc
source ~/.bashrc
```
### 3. Install Piper TTS (Hindi voice)
```bash
cd ~
wget https://github.com/rhasspy/piper/releases/download/2023.11.14-2/piper_linux_x86_64.tar.gz
tar -xzf piper_linux_x86_64.tar.gz
mkdir -p ~/piper/voices
wget https://huggingface.co/rhasspy/piper-voices/resolve/main/hi/hi_IN/rohan/medium/hi_IN-rohan-medium.onnx -O ~/piper/voices/hi_IN-rohan-medium.onnx
wget https://huggingface.co/rhasspy/piper-voices/resolve/main/hi/hi_IN/rohan/medium/hi_IN-rohan-medium.onnx.json -O ~/piper/voices/hi_IN-rohan-medium.onnx.json
```
### 4. Install LibreTranslate (Hindi translation)
```bash
python3 -m venv ~/.venvs/libretranslate
source ~/.venvs/libretranslate/bin/activate
pip install libretranslate==1.9.5
deactivate
```
### 5. Firewall (remote/LAN access only)
```bash
# firewalld (RHEL/CentOS/Fedora/AlmaLinux)
sudo firewall-cmd --add-port=8001/tcp --permanent
sudo firewall-cmd --add-port=5000/tcp --permanent
sudo firewall-cmd --reload
# ufw (Ubuntu/Debian)
sudo ufw allow 8001/tcp
sudo ufw allow 5000/tcp
```
### 6. Start / Stop
```bash
# Start DeepShell + LibreTranslate in background
./start.sh
# Check logs
tail -f deepshell.log
tail -f libretranslate.log
# Stop everything
./stop.sh
```
### 7. Open in Browser
---
## 🎯 What DeepShell Excels At
| Domain | Examples |
|--------|---------|
| 🐳 Docker | Dockerfiles, compose files, container management |
| ☸️ Kubernetes | kubectl commands, YAML manifests, troubleshooting |
| πŸ”§ Linux SysAdmin | System commands, log analysis, performance tuning |
| πŸ—οΈ IaC | Terraform (HCL), Ansible, CloudFormation |
| ☁️ Cloud | AWS CLI, best practices |
| πŸ“œ Scripting | Bash, Python automation for ops tasks |
> DeepShell politely refuses general knowledge, entertainment, or anything outside DevOps/SysAdmin scope.
---
## πŸ”’ Security & Safety
- βœ… **No automatic execution** β€” commands displayed with copy buttons only
- βœ… **Dry Run mode** β€” analyze before you execute
- βœ… **User control** β€” you decide what runs on your system
- βœ… **Session isolation** β€” each browser session is independent
- βœ… **No data persistence** β€” conversations in-memory only (free version)
- βœ… **Rate limiting** β€” built-in via slowapi
- βœ… **Strict AI scope** β€” refuses off-topic requests
- βœ… **Ollama option** β€” LLM data never leaves your network
- βœ… **Self-hosted TTS** β€” Piper runs locally, no audio sent to cloud
---
## ⌨️ Keyboard Shortcuts
| Shortcut | Action |
|----------|--------|
| `Ctrl + Enter` | Send message |
| `Ctrl + K` | Clear chat |
| `Escape` | Focus input |
---
## πŸ›£οΈ Roadmap
### Phase 1 β€” Free Version βœ… Complete
- βœ… SSE streaming + session context
- βœ… Syntax highlighting (Bash, Python, Dockerfile, YAML, HCL)
- βœ… Copy buttons + Export chat as Markdown
- βœ… Docker Compose support + Start/Stop scripts
- βœ… Assistant / Trainer / Dry Run modes
- βœ… Multilingual Voice TTS β€” English + Hindi (Piper, offline)
- βœ… Self-hosted translation via LibreTranslate
- βœ… Backend /translate + /tts endpoints
- βœ… Replay + Light/Dark theme
- βœ… Groq + Cerebras + Ollama provider support
### Phase 2 β€” Pro Version πŸ’Ž Next
- πŸ”œ One-click command execution with approval flow
- πŸ”œ Persistent history (database)
- πŸ”œ Chatterbox TTS β€” cloned voice instructor
- πŸ”œ Quiz mode for certification prep (RHCSA, CKA, AWS)
- πŸ”œ Multi-session management
- πŸ”œ Workflow automation
- πŸ”œ Stop audio on language switch
### Phase 3 β€” Advanced
- πŸ”œ File upload (analyze logs, configs)
- πŸ”œ Multi-host support
- πŸ”œ Kubernetes dashboard integration
- πŸ”œ Additional Indian languages (Tamil, Telugu)
---
## 🀝 Contributing
Contributions welcome! Please:
- Keep code simple and maintainable
- Focus on DevOps/SysAdmin/IaC use cases
- Follow existing code style
- Test before submitting PRs
---
## πŸ“ License
MIT License β€” see [LICENSE](LICENSE) for details.
---
## πŸ™ Acknowledgments
- [Groq](https://groq.com) β€” blazing-fast LLM inference
- [Cerebras](https://cloud.cerebras.ai) β€” fast failover inference
- [Ollama](https://ollama.com) β€” local LLM runtime
- [FastAPI](https://fastapi.tiangolo.com) β€” excellent async framework
- [Piper TTS](https://github.com/rhasspy/piper) β€” fast offline neural TTS
- [LibreTranslate](https://libretranslate.com) β€” self-hosted translation
- [Prism.js](https://prismjs.com) β€” syntax highlighting
- [marked.js](https://marked.js.org) β€” markdown rendering
---
## πŸ“§ Contact
**Maintainer**: [@muralipala1504](https://github.com/muralipala1504)
**Issues**: [GitHub Issues](https://github.com/muralipala1504/deepshell_modui/issues)
**Website**: [deepshell.cloud](https://deepshell.cloud) βœ… LIVE
---
*Built with ❀️ for DevOps engineers who value speed, accuracy, and control.*