Professional voice analytics and observability for AI agents. Monitor, analyze, and improve your voice AI applications with comprehensive tracking and actionable insights.
- π Real-time Session Monitoring - Track every voice interaction with comprehensive analytics
- π° Cost Tracking - Monitor STT, TTS, and LLM costs across all providers
- β‘ Performance Metrics - Analyze latency, response times, and quality scores
- π― Turn-by-Turn Analytics - Detailed conversation turn tracking with full context
- π OpenTelemetry Integration - Native OTEL support for distributed tracing
- π Bug Reporting System - Built-in user feedback collection during sessions
- π§ Easy Integration - One-line SDK integration with LiveKit agents
- π Usage Metrics - Track token usage, API calls, and session duration
- ποΈ Voice Analytics - STT, TTS, LLM, and VAD metrics tracking
pip install soundflareCreate a .env file in your project root:
# Soundflare Configuration
SOUNDFLARE_API_KEY=your_api_key_here
SOUNDFLARE_HOST_URL=your_host_url_herefrom dotenv import load_dotenv
import os
from soundflare import LivekitObserve
# Load environment variables
load_dotenv()
# Initialize observability
soundflare = LivekitObserve(
agent_id="your-agent-id",
apikey=os.getenv("SOUNDFLARE_API_KEY"),
host_url=os.getenv("SOUNDFLARE_HOST_URL"),
enable_otel=True # Enable OpenTelemetry integration
)
# Wrap your LiveKit session
session = AgentSession(...)
session_id = soundflare.start_session(session, phone_number="+1234567890")
# Ensure data is exported on shutdown
async def soundflare_shutdown():
await soundflare.export(session_id)
ctx.add_shutdown_callback(soundflare_shutdown)
await session.start(...)Enable built-in bug reporting to collect user feedback during sessions:
soundflare = LivekitObserve(
agent_id="your-agent-id",
apikey=os.getenv("SOUNDFLARE_API_KEY"),
host_url=os.getenv("SOUNDFLARE_HOST_URL"),
bug_reports_enable=True,
bug_reports_config={
'bug_start_command': ['feedback start', 'report issue'],
'bug_end_command': ['feedback over', 'done reporting'],
'response': 'Please tell me the issue?',
'continuation_prefix': 'So, as I was saying, ',
'debug': False
}
)Soundflare automatically integrates with OpenTelemetry for distributed tracing:
from opentelemetry import trace
# SDK automatically creates spans for:
# - Session lifecycle
# - STT operations
# - LLM calls
# - TTS generation
# - User turns and agent responses
# Access spans data
soundflare = LivekitObserve(
agent_id="your-agent-id",
apikey=os.getenv("SOUNDFLARE_API_KEY"),
host_url=os.getenv("SOUNDFLARE_HOST_URL"),
enable_otel=True
)| Metric | Description | Details |
|---|---|---|
| Latency | Response times for each component | STT, TTS, LLM processing times |
| Costs | Token usage and billing | Automatic cost calculation for major providers |
| Transcripts | Full conversation history | User input and agent responses |
| Quality | Transcription accuracy | Audio duration, confidence scores |
| Sessions | Call metadata | Duration, timestamps, phone numbers |
| Turns | Conversation flow | Turn-by-turn analysis with context |
| Tool Calls | Agent function executions | Track agent tool usage and results |
- Production Monitoring - Keep voice AI applications running smoothly
- Cost Optimization - Identify expensive operations and optimize spending
- Quality Assurance - Review call transcripts and agent responses
- Performance Debugging - Diagnose latency issues and bottlenecks
- User Feedback - Collect and analyze bug reports during calls
- Distributed Tracing - Track requests across microservices
Soundflare SDK provides:
- Lightweight Python SDK - Minimal overhead data collection
- Async Support - Non-blocking data transmission
- Event-Driven - Hooks into LiveKit agent lifecycle
- Metric Collection - Comprehensive STT/TTS/LLM metrics
- Session Management - Automatic session tracking and cleanup
- Core: Python 3.9+, asyncio
- Dependencies:
livekit-agents- Voice agent frameworkrequests- HTTP client for data transmissionpython-dotenv- Environment configuration
- Integrations: OpenTelemetry, LiveKit
Main class for observability integration.
Parameters:
agent_id(str): Unique identifier for your agentapikey(str, optional): API key for authenticationhost_url(str, optional): Host URL for data exportbug_reports_enable(bool): Enable bug reporting featurebug_reports_config(dict): Configuration for bug reportingenable_otel(bool): Enable OpenTelemetry integration
Methods:
start_session(session, phone_number=None): Initialize session trackingexport(session_id): Export session datahandle_bug_report(user_input, session): Process user feedback
The SDK automatically tracks:
- Session start/end times
- Conversation turns
- STT/TTS/LLM metrics
- Cost calculations
- OpenTelemetry spans
- Tool calls and executions
STT Metrics:
- Audio duration
- Latency
- Model name
- Streaming status
- Cost per request
LLM Metrics:
- Prompt tokens
- Completion tokens
- Latency
- Model name
- Cost per request
TTS Metrics:
- Characters generated
- Audio duration
- Latency
- Model name
- Cost per request
# Required
SOUNDFLARE_API_KEY=your_api_key
# Optional
SOUNDFLARE_HOST_URL=https://your-host.combug_reports_config = {
'bug_start_command': ['feedback start'], # Trigger phrases
'bug_end_command': ['feedback over'], # End phrases
'response': 'Please tell me the issue?', # Agent response
'continuation_prefix': 'So, as I was saying, ', # Resume prefix
'fallback_message': 'So, as I was saying,', # Fallback text
'collection_prompt': '', # Custom prompt
'debug': False # Debug logging
}- π§ Email: support@trillet.ai
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Discussions
Need enterprise features like custom deployments or dedicated support?
Contact us: support@trillet.ai
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with β€οΈ by the Trillet AI team
- Powered by LiveKit for real-time voice infrastructure
- Inspired by modern observability platforms
β If Soundflare helps your voice AI applications, consider giving us a star!