mindfull / Readme.md
IamSamk
Mindfull Gradio Space deploy
27caffe
|
Raw
History Blame Contribute Delete
3.88 kB
README.md
πŸ›‘οΈ Police Bot Runtime β€” AI Voice Assistant for Bengaluru Police
This is the runtime layer of an AI-powered mental wellness assistant built for frontline Bengaluru Police officers. The assistant runs locally and privately using an LLM (via Ollama) and a fine-tuned voice cloning TTS model (via XTTS/F5-TTS), producing empathetic voice replies in real-time based on officer input.
πŸ’¬ Text In β†’ πŸ€– LLM Reply β†’ πŸ—£οΈ Voice Cloned Output
πŸ“Œ Project Goals
Create a voice-first wellness chatbot for police personnel
Fully private, runs entirely offline on powerful local machines
Replies are generated by an open-source LLM (police-bot) via Ollama
Responses are spoken aloud using a fine-tuned XTTS voice cloned from a real speaker
Easily extendable to integrate into a React-based web interface later
Future support for Kannada via multi-lingual XTTS fine-tuning
🧠 System Overview
This repo powers the runtime experience.
Ollama runs an LLM (LLaMA 3, Mistral etc.) via the police-bot model
Python script police_runtime.py communicates with Ollama (localhost:11434)
LLM reply is sent to police_bot_voice.py
XTTS reads a voice reference and generates a realistic audio response (output.wav)
Audio is played back to the officer
Example flow:
Officer: I'm feeling low today
Assistant: [spoken aloud] Namaskara! I’m here to support you. You're a valued member of the force...
πŸ“‚ Folder Structure
Your folder layout should look like:
police-bot-runtime/
β”‚
β”œβ”€β”€ police_runtime.py # Main loop: user input β†’ LLM β†’ voice
β”œβ”€β”€ police_bot_voice.py # Loads XTTS model, speaks response
β”‚
β”œβ”€β”€ my_finetuned_model/ # XTTS fine-tuned model files
β”‚ β”œβ”€β”€ config.json
β”‚ β”œβ”€β”€ dvae.ptj
β”‚ β”œβ”€β”€ mel_stats.pth
β”‚ β”œβ”€β”€ model.pth
β”‚ └── vocab.json
β”‚
β”œβ”€β”€ datasets-1/
β”‚ └── wavs/
β”‚ └── 0029.wav # Reference voice clip used for inference
β”‚
β”œβ”€β”€ venv/ # Python virtual environment
└── requirements.txt # (Optional) Dependency list
βš™οΈ Setup Instructions
🧩 Prerequisites:
Windows 10/11, 64-bit
Python 3.11 (recommended)
Ollama installed: https://ollama.com
Trained XTTS voice model (via F5-TTS or Coqui)
Clone or copy this folder as police-bot-runtime
Create a virtual environment:
bash
Copy
Edit
python -m venv venv
venv\Scripts\activate
Install dependencies:
bash
Copy
Edit
pip install TTS requests
Start the Ollama LLM (separate terminal):
bash
Copy
Edit
ollama run police-bot
Run the voice assistant:
bash
Copy
Edit
python police_runtime.py
You'll be prompted for input. Replies will be printed and voiced out.
πŸ§ͺ Testing Voice Model
Your test_voice.py should look like:
python
Copy
Edit
from TTS.api import TTS
tts = TTS(
model_path="my_finetuned_model/",
config_path="my_finetuned_model/config.json",
gpu=True
)
tts.tts_to_file(
text="Hey officer, everything okay?",
file_path="output.wav",
speaker_wav="datasets-1/wavs/0029.wav",
language="en"
)
🧠 How It Works
Ollama LLM (LLaMA3) is launched with ollama run police-bot
Text prompt is sent to http://localhost:11434/api/generate
Response is sent to XTTS model for synthesis
XTTS clones voice using speaker_wav file
Audio saved to output.wav and played using playsound or equivalent
πŸ› οΈ Future Enhancements
Integrate directly with the frontend (React + ShadCN + Web Speech API)
Support both English and Kannada voice cloning
Add emotional sentiment analysis (LLaMA + classifier)
Handle stress journaling and daily wellness logging
Auto-log sessions to Supabase or local DB
Deploy offline on a rugged laptop for field use
πŸ™ Acknowledgements
Voice cloning: F5-TTS / Coqui XTTS
LLM inference: Ollama + LLaMA3 8B
Frontend inspiration: GovSchemes project
This is a labor of respect and service. Designed to support those who protect us.
β€”