LiveKit Agent
Prerequisites
- Python > 3.10
venv(comes with Python)- Internet connection for downloading models and dependencies
Setup
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python agent.py download-files
python agent.py console
Usage & Metrics Collection
-
Start the agent in console mode:
python agent.py console
-
Interact with the agent through voice or text input
-
Stop the agent by pressing
Ctrl + Cto gracefully shutdown and save metrics -
View collected metrics in the generated file:
cat livekit_agent_metrics.json
Metrics Data
The agent automatically collects comprehensive metrics including:
- LLM Metrics: Token usage, response times (TTFT), model performance
- TTS Metrics: Character count, audio generation times (TTFB), audio duration
- STT Metrics: Audio processing duration, transcription accuracy
- Session Data: Conversation turns, timestamps, duration
- Usage Summary: Official LiveKit usage statistics
Metrics File Structure
{
"sessions": [
{
"session_id": "uuid",
"duration": 12.22,
"total_llm_calls": 3,
"total_llm_tokens_input": 71,
"total_llm_tokens_output": 51,
"total_tts_calls": 1,
"total_tts_characters": 56,
"total_stt_calls": 2,
"total_stt_duration": 9.95,
"conversation_turns": 7,
"transcripts": [...],
"usage_summary": {...}
}
]
}
Key Features
- ✅ Automatic metrics collection using LiveKit's official metrics system
- ✅ Real-time monitoring with console output during sessions
- ✅ Persistent storage in JSON format for analysis
- ✅ Conversation tracking with full transcript history
- ✅ Usage analytics for cost estimation and optimization
- ✅ Error-safe serialization handles all LiveKit metric types
Troubleshooting
If you encounter any issues:
- Ensure all dependencies are installed:
pip install -r requirements.txt - Check that your environment variables are set correctly
- Verify internet connection for model downloads
- Make sure you have proper API keys configured
Metadata
Release files for pype-observe 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pype_observe-1.0.0.tar.gz | 12.2 kB | Without provenance | Details for pype_observe-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pype_observe-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for pype_observe-1.0.0-py3-none-any.whl |
Total release size: 24.0 kB
Release files / pype_observe-1.0.0.tar.gz
| Download URL | pype_observe-1.0.0.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
788a2fae964a54e271c8245d97e3d038973140707cbf5f9a05bcbb8fa5d7190f
|
|
BLAKE2b-256 checksum How to use checksums |
01ccace68b0fcfdae88cb70455d414ff8606e3c2c8a4d23e250a4ec23fb3a77e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|
Release files / pype_observe-1.0.0-py3-none-any.whl
| Download URL | pype_observe-1.0.0-py3-none-any.whl |
|---|---|
| Size | 11.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c37632d55d79cbcbf4fcb93e7150d420f362cde0da40d5ed6ff507963cb3ad3
|
|
BLAKE2b-256 checksum How to use checksums |
b7fe871d47ea479f14821d1ccf233cda0a0dfd865fdd6071d9fcc88ffe68b862
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.10
|
Security for pype-observe 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.