How data-gras/savi-sdk works
SAVI is a Python observability SDK that wraps LLM provider calls, measures completed responses, and reports telemetry either locally or to its SaaS backend. The main workflow is application → provider wrapper → model provider; the wrapper derives PII signals and a fingerprint, then emits usage and latency telemetry. The tree and README also identify auto-instrumentation, MCP instrumentation, tracing context, caching, and judging capabilities. Sampled excerpts are partial, so links for unsampled subsystems are limited to documented capabilities and clear module boundaries.
Main entry points: collector.py Telemetry Collector · pii.py PII And Fingerprint · anthropic.py Anthropic Wrapper · bedrock.py Bedrock Wrapper
Components 19
Provider Wrappers
- OpenAI Wrapper
savi/openai.py - Anthropic Wrapper
savi/anthropic.py - Azure Wrapper
savi/azure_openai.py - Vertex Wrapper
savi/google_vertex.py - Bedrock Wrapper
savi/bedrock.py - Cohere Wrapper
savi/cohere.py - Mistral Wrapper
savi/mistral.py
Telemetry Processing
- PII And Fingerprint
savi/pii.py - Telemetry Collector
savi/collector.py - Local Emitter
savi/local.py
Instrumentation
- Auto Instrumentation
savi/auto_instrument.py - MCP Instrumentation
savi/mcp_instrument.py - LLM Judge
savi/judge.py
Runtime Services
- Response Cache
savi/cache.py - Trace Context
savi/context.py
Other components
- Application
- LLM Providers
- SAVI Backend
- Terminal Output
Connections 45
- Application → OpenAI Wrapper: calls
- Application → Anthropic Wrapper: calls
- Application → Azure Wrapper: calls
- Application → Vertex Wrapper: calls
- Application → Bedrock Wrapper: calls
- Application → Cohere Wrapper: calls
- Application → Mistral Wrapper: calls
- OpenAI Wrapper → LLM Providers: requests
- Anthropic Wrapper → LLM Providers: requests
- Azure Wrapper → LLM Providers: requests
- Vertex Wrapper → LLM Providers: requests
- Bedrock Wrapper → LLM Providers: requests
- Cohere Wrapper → LLM Providers: requests
- Mistral Wrapper → LLM Providers: requests
- OpenAI Wrapper → PII And Fingerprint: masks, fingerprints
- Anthropic Wrapper → PII And Fingerprint: masks, fingerprints
- Azure Wrapper → PII And Fingerprint: masks, fingerprints
- Vertex Wrapper → PII And Fingerprint: masks, fingerprints
- Bedrock Wrapper → PII And Fingerprint: masks, fingerprints
- Cohere Wrapper → PII And Fingerprint: masks, fingerprints
- Mistral Wrapper → PII And Fingerprint: masks, fingerprints
- OpenAI Wrapper → Telemetry Collector: emits telemetry
- Anthropic Wrapper → Telemetry Collector: emits telemetry
- Azure Wrapper → Telemetry Collector: emits telemetry
- Vertex Wrapper → Telemetry Collector: emits telemetry
- Bedrock Wrapper → Telemetry Collector: emits telemetry
- Cohere Wrapper → Telemetry Collector: emits telemetry
- Mistral Wrapper → Telemetry Collector: emits telemetry
- Telemetry Collector → SAVI Backend: sends batches
- Telemetry Collector → Terminal Output: writes locally
- OpenAI Wrapper → Response Cache: reads and writes
- Anthropic Wrapper → Response Cache: reads and writes
- Azure Wrapper → Response Cache: reads and writes
- Vertex Wrapper → Response Cache: reads and writes
- Bedrock Wrapper → Response Cache: reads and writes
- Cohere Wrapper → Response Cache: reads and writes
- Mistral Wrapper → Response Cache: reads and writes
- Anthropic Wrapper → Trace Context: reads attribution
- Bedrock Wrapper → Trace Context: reads attribution
- Cohere Wrapper → Trace Context: reads attribution
- Mistral Wrapper → Trace Context: reads attribution
- Auto Instrumentation → Telemetry Collector: emits telemetry
- Auto Instrumentation → PII And Fingerprint: fingerprints prompts
- MCP Instrumentation → Telemetry Collector: instruments MCP
- LLM Judge → LLM Providers: evaluates models