| title | VoiceGuard |
|---|---|
| emoji | 🎙️ |
| colorFrom | indigo |
| colorTo | gray |
| sdk | docker |
| app_port | 7860 |
| pinned | true |
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.
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.
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
- 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. - 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.
- 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). - 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.
VoiceGuard exposes a unified processing endpoint.
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"]
}
}
| 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. |
- 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
- Environment: Create a
.envfile withGROQ_API_KEY=your_key. - Run:
uvicorn backend:app --reload
VoiceGuard is deployed via a CI/CD pipeline:
- Backend: Dockerized on Hugging Face Spaces. We utilize a custom
Dockerfilethat downloads necessary NLP assets during the build phase. - Frontend: Deployed via Streamlit Community Cloud, connected directly to our GitHub
mainbranch. - Synchronization: GitHub Actions ensure the cloud deployment mirrors the repository instantly on every push.
Musharraf Aziz AI/ML Engineer & Systems Architect
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.