perplexity-observability

Featured

Set up monitoring for Perplexity Sonar API with latency, cost, citation quality, and error tracking. Use when implementing monitoring dashboards, setting up alerts, or tracking Perplexity API health in production. Trigger with phrases like "perplexity monitoring", "perplexity metrics", "perplexity observability", "monitor perplexity", "perplexity dashboard".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Perplexity Observability ## Overview Monitor Perplexity Sonar API performance, cost, and quality. Key signals unique to Perplexity: citation count per response (quality indicator), search latency variability (web search is non-deterministic), and per-model cost differences. ## Key Metrics | Metric | sonar (typical) | sonar-pro (typical) | Alert Threshold | |--------|----------------|--------------------|-------------- | | Latency p50 | 1-2s | 3-5s | p95 > 15s | | Citations/response | 3-5 | 5-10 | 0 for 10min | | Error rate | <1% | <1% | >5% | | Cost/query | $0.005 | $0.02 | >$0.10 | ## Prerequisites - Perplexity API integration running - Metrics backend (Prometheus, Datadog, or custom) - Alerting system configured ## Instructions ### Step 1: Instrument the Perplexity Client ```typescript import OpenAI from "openai"; interface SearchMetrics { model: string; latencyMs: number; status: "success" | "error"; citationCount: number; totalTokens: number; cached: boolean; errorCode?: number; } const metrics: SearchMetrics[] = []; async function instrumentedSearch( client: OpenAI, query: string, model: string = "sonar", cached: boolean = false ): Promise<{ response: any; metrics: SearchMetrics }> { const start = performance.now(); let searchMetrics: SearchMetrics; try { const response = await client.chat.completions.create({ model, messages: [{ role: "user", content: query }], }); searchMetrics = { model, lat...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

perplexity-performance-tuning

Optimize Perplexity Sonar API performance with caching, streaming, model routing, and batching. Use when experiencing slow API responses, implementing caching strategies, or optimizing request throughput for Perplexity integrations. Trigger with phrases like "perplexity performance", "optimize perplexity", "perplexity latency", "perplexity caching", "perplexity slow".

2,266 Updated today
jeremylongshore
AI & Automation Featured

perplexity-cost-tuning

Optimize Perplexity costs through model routing, caching, token limits, and budget monitoring. Use when analyzing Perplexity billing, reducing API costs, or implementing budget alerts for Perplexity Sonar API. Trigger with phrases like "perplexity cost", "perplexity billing", "reduce perplexity costs", "perplexity pricing", "perplexity budget".

2,266 Updated today
jeremylongshore
AI & Automation Featured

perplexity-reliability-patterns

Implement reliability patterns for Perplexity Sonar API: circuit breaker, model fallback, streaming timeout, and citation validation. Trigger with phrases like "perplexity reliability", "perplexity circuit breaker", "perplexity fallback", "perplexity resilience", "perplexity timeout".

2,266 Updated today
jeremylongshore
AI & Automation Featured

perplexity-architecture-variants

Choose and implement Perplexity architecture blueprints for different scales: direct search widget, cached research layer, and multi-query pipeline. Trigger with phrases like "perplexity architecture", "perplexity blueprint", "how to structure perplexity", "perplexity project layout".

2,266 Updated today
jeremylongshore
AI & Automation Featured

perplexity-advanced-troubleshooting

Apply advanced debugging techniques for hard-to-diagnose Perplexity Sonar API issues. Use when standard troubleshooting fails, investigating inconsistent citations, or preparing evidence for support escalation. Trigger with phrases like "perplexity hard bug", "perplexity mystery error", "perplexity inconsistent results", "difficult perplexity issue", "perplexity deep debug".

2,266 Updated today
jeremylongshore