Skip to content
perplexity-prod-checklist logo

Perplexity Production Checklist

perplexity-prod-checklist

Execute Perplexity production deployment checklist for Sonar API integrations.

SKILL.md

Full skill instructions

Perplexity Production Checklist

Overview

Complete checklist for deploying Perplexity Sonar API integrations to production. Perplexity-specific concerns: every API call performs a live web search (variable latency), citations link to third-party sites (must validate), and costs scale per-request plus per-token.

Prerequisites

  • Staging environment tested
  • Production API key generated (separate from dev/​staging)
  • Monitoring configured
  • Cost budget defined

Production Readiness Checklist

API Configuration

  • Production PERPLEXITY_API_KEY in secret manager (not env file)
  • Key starts with pplx- and has credits loaded
  • Separate API keys for dev/​staging/​prod
  • Base URL is https://api.perplexity.ai (not localhost/​proxy)
  • Model selection configured: sonar for fast, sonar-pro for deep

Code Quality

  • All search calls wrapped in retry with exponential backoff
  • Rate limiting implemented (50 RPM default)
  • Query sanitization strips PII before sending to Perplexity
  • Citations parsed from response (not extracted from text)
  • max_tokens set on all requests (prevents runaway costs)
  • Timeouts configured: 15s for sonar, 30s for sonar-pro
  • Error handling covers 401, 402, 429, 500+ status codes
  • No hardcoded API keys in source code

Performance

  • Result caching implemented for repeated queries
  • Cache TTL appropriate: 30min for news, 4hrs for research, 24hrs for facts
  • Streaming enabled for user-facing search (reduces perceived latency)
  • Request queue prevents burst overload
  • search_domain_filter used where appropriate (reduces search time)

Monitoring

  • Latency tracked per model (sonar ~2s, sonar-pro ~5s, deep-research ~30s)
  • Error rate monitored (alert on >5% failure rate)
  • Token usage tracked for cost projection
  • Citation count per response logged (quality signal)
  • 429 rate limit errors tracked with alert

Cost Controls

  • Monthly budget cap set on API key
  • Model routing: simple queries to sonar, complex to sonar-pro
  • max_tokens capped per endpoint
  • Cache hit rate monitored (target >30%)
  • Cost per query tracked by model

Graceful Degradation

async function searchWithFallback(query: string) {
  try {
    // Primary: sonar-pro for deep answers
    return await perplexity.chat.completions.create({
      model: "sonar-pro",
      messages: [{ role: "user", content: query }],
      max_tokens: 2048,
    });
  } catch (err: any) {
    if (err.status === 429 || err.status >= 500) {
      // Fallback: sonar for faster, cheaper response
      return await perplexity.chat.completions.create({
        model: "sonar",
        messages: [{ role: "user", content: query }],
        max_tokens: 512,
      });
    }
    throw err;
  }
}

Health Check Endpoint

app.get("/​health/​perplexity", async (req, res) => {
  const start = Date.now();
  try {
    const response = await perplexity.chat.completions.create({
      model: "sonar",
      messages: [{ role: "user", content: "ping" }],
      max_tokens: 5,
    });
    res.json({
      status: "healthy",
      latencyMs: Date.now() - start,
      model: response.model,
    });
  } catch (err: any) {
    res.status(503).json({
      status: "unhealthy",
      error: err.status || err.message,
      latencyMs: Date.now() - start,
    });
  }
});

Alerting Rules

AlertConditionSeverity
API UnreachableHealth check fails 3xP1
High Error Rate429/​5xx > 5% over 5minP2
High Latencyp95 > 15s for sonarP2
Budget ExceededMonthly cost > 80% capP2
Auth FailureAny 401/​402 errorP1

Error Handling

IssueCauseSolution
Variable latencyWeb search per requestSet appropriate timeouts per model
Broken citationsSource pages changedValidate citation URLs before displaying
Cost overrunNo model routingRoute simple queries to sonar
Rate limit spikesBurst trafficQueue requests with p-queue

Output

  • Production-ready Perplexity integration with all checks passing
  • Health check endpoint for monitoring
  • Graceful degradation from sonar-pro to sonar
  • Alerting rules configured

Resources

Next Steps

For version upgrades, see perplexity-upgrade-migration.

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
I
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View