Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

title VoiceGuard
emoji 🎙️
colorFrom indigo
colorTo gray
sdk docker
app_port 7860
pinned true

🛡️ VoiceGuard

Secure, Real-time Audio Intelligence & Compliance Engine


Architecture: Microservice Backend: FastAPI Security: PII Redaction Processing: Llama_3.3_70B



📖 The Problem

Modern enterprises are rushing to integrate AI, but they face a critical roadblock: Data Exposure. When you send raw audio (which may contain names, credit cards, or medical IDs) to an LLM, you risk regulatory non-compliance (HIPAA, GDPR) and data leakage. Furthermore, most "AI wrappers" provide unstructured output, making it impossible to integrate that data into a CRM or ticketing system.

🚀 The Solution: VoiceGuard

VoiceGuard acts as an intelligent middleware proxy. It is designed to capture audio, strip sensitive identifiers at the edge (locally), and use an LLM to transform the "safe" text into structured, actionable JSON data.


🏗️ System Architecture & Methodology

VoiceGuard uses an interceptor pattern to ensure data never leaves the "safe zone" in its raw, sensitive state.

graph TD
    UI[Frontend Client] -->|Binary Audio Stream| API(FastAPI Ingestion)
    
    subgraph Privacy_Firewall [🔒 Privacy Firewall Layer]
    API --> ASR[Whisper-Large-V3 Transcription]
    ASR --> PII{Microsoft Presidio PII Scrubber}
    PII -->|Masks PII Locally| SAFE[Sanitized String]
    end

    subgraph Intelligence_Engine [🧠 Generative Intelligence Engine]
    SAFE --> Prompt[Structured Prompt Construction]
    Prompt --> LLM[Llama 3.3 70B via Groq]
    LLM -->|JSON Analytics| Output[Structured Data Output]
    end
    
    Output --> UI

Loading

Why We Did What We Did

  1. FastAPI over Flask: We chose FastAPI for its native asynchronous capabilities (async/await). In an audio pipeline, IO-bound operations (transcription, API calls) are frequent. FastAPI prevents blocking the main thread, allowing for high-throughput stream processing.
  2. Local PII Scrubbing (Presidio): We perform redaction before sending data to the LLM. This is a Zero-Trust architecture. Even if the LLM provider were compromised, they never see the user's raw PII.
  3. Structured JSON Mode: Most LLM implementations return conversational text. We forced structured output (response_format: {"type": "json_object"}) so the application can programmatically act on the data (e.g., auto-creating tickets, updating databases).
  4. Groq LPU Acceleration: We selected the Llama 3.3 70B model via Groq's LPU. The speed of LPU inference reduces the "time-to-insight" from 10+ seconds to sub-second, which is mandatory for live voice interactions.

🛠️ API Reference

VoiceGuard exposes a unified processing endpoint.

POST /process-audio

Request: multipart/form-data containing an audio file (mp3, wav, m4a).

Response Structure (JSON):

{
  "raw_transcript": "Hello, my name is Musharraf and my card is 1234-5678-9012.",
  "safe_transcript": "Hello, my name is [NAME REDACTED] and my card is [CARD REDACTED].",
  "analytics": {
    "sentiment": "Neutral",
    "compliance_flag": true,
    "action_items": ["Verify identity", "Process payment"]
  }
}

💻 Tech Stack Justification

Component Technology Why we chose it
Backend FastAPI High-concurrency, asynchronous, auto-generates docs.
ASR Whisper Large v3 Industry-leading accuracy for multi-speaker transcription.
PII Protection Microsoft Presidio Modular, enterprise-grade, supports custom regex.
LLM Engine Groq (Llama 3.3) Unmatched inference speed (LPUs) at zero cost.
Orchestration LangChain Simplified complex prompt chaining and logic.

⚙️ Installation & Deployment

Local Setup

  1. Clone & Install:
git clone [https://github.com/engrmaziz/voice-guard](https://github.com/engrmaziz/voice-guard)
pip install -r requirements.txt
python -m spacy download en_core_web_sm
  1. Environment: Create a .env file with GROQ_API_KEY=your_key.
  2. Run:
uvicorn backend:app --reload

Cloud Architecture

VoiceGuard is deployed via a CI/CD pipeline:

  • Backend: Dockerized on Hugging Face Spaces. We utilize a custom Dockerfile that downloads necessary NLP assets during the build phase.
  • Frontend: Deployed via Streamlit Community Cloud, connected directly to our GitHub main branch.
  • Synchronization: GitHub Actions ensure the cloud deployment mirrors the repository instantly on every push.

👨‍💻 Connect with the Developer

Musharraf Aziz AI/ML Engineer & Systems Architect

GitHub | Professional Profile


Disclaimer: This system is for demonstration purposes. When deploying in production, ensure adherence to regional data privacy laws (GDPR, CCPA) and implement robust authentication on the API endpoints.

About

VoiceGuard acts as an intelligent middleware proxy. It is designed to capture audio, strip sensitive identifiers at the edge (locally), and use an LLM to transform the "safe" text into structured, actionable JSON data.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages