Z-AI is a high-performance, multi-modal personal assistant built in Rust. Unlike traditional assistants, Z is designed with a "Toxic, Savage, and Unfiltered" personality, offering a unique (and often roasting) interaction experience.
It supports voice and text input, integrates with multiple LLM providers, and can control system media across macOS, Linux, and Windows.
- Multi-Modal Input: Seamlessly switch between voice (Wake Word activated) and keyboard input.
- Aggressive Personality: Powered by custom system prompts to be sarky, toxic, and brutally honest.
- Triple-Provider LLM Support:
- Google Gemini (Primary: 2.0 Flash)
- OpenAI (gpt-4o-mini)
- Groq/xAI (Llama 3.3 / Grok-Beta)
- High-Fidelity Voice:
- STT: Fast transcription via Groq (Whisper-large-v3).
- TTS: Premium voice synthesis via ElevenLabs, with local system fallbacks.
- Universal Music Control: Control Spotify or YouTube Music via voice commands (
PLAY,PAUSE,STOP). - Cross-Platform: Tailored commands for macOS (
osascript), Linux (playerctl), and Windows (powershell).
- Rust: Install Rust (Edition 2021).
- System Dependencies:
- Linux:
alsadevelopment files (e.g.,libasound2-dev),playerctl. - macOS: Native support.
- Windows: PowerShell.
- Linux:
Create a .env file in the root directory and add your API keys:
GEMINI_API_KEY=your_gemini_key
OPENAI_API_KEY=your_openai_key
GROQ_API_KEY=your_groq_key
ELEVEN_LABS_API_KEY=your_elevenlabs_key- Clone the repository:
git clone https://github.com/HANZSEIO/Z-ai_Rust.git cd Z-ai_Rust - Run the application:
cargo run --release
- Wake Word: Say "Z", "Zee", or "Zed" to activate the assistant.
- Active Mode: Once activated (indicated by a sound and UI prompt), you have 60 seconds to speak.
- Music Control: Try saying:
- "Z, play some Phonk"
- "Stop the music"
- Text Mode: Simply type your message in the terminal at any time.
- Exit: Type
exitorquit.
src/main.rs: Orchestrates the async event loop usingtokio, managing concurrent audio listening and terminal input.src/core/audio.rs: Handles low-level audio stream management (cpal), WAV encoding (hound), and STT/TTS API calls.src/core/cloud_api.rs: Manages the LLM logic, system prompts, and fallback mechanisms between providers.
Z-AI is configured to be toxic and unfiltered. It is intended for entertainment purposes and "toxic friend" simulations. But you can configure manualy Use at your own risk :).
Built with attitude.
by HANZS -