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
Code Quality
Performance
Monitoring
Cost Controls
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
| Alert |
Condition |
Severity |
| API Unreachable |
Health check fails 3x |
P1 |
| High Error Rate |
429/5xx > 5% over 5min |
P2 |
| High Latency |
p95 > 15s for sonar |
P2 |
| Budget Exceeded |
Monthly cost > 80% cap |
P2 |
| Auth Failure |
Any 401/402 error |
P1 |
Error Handling
| Issue |
Cause |
Solution |
| Variable latency |
Web search per request |
Set appropriate timeouts per model |
| Broken citations |
Source pages changed |
Validate citation URLs before displaying |
| Cost overrun |
No model routing |
Route simple queries to sonar |
| Rate limit spikes |
Burst traffic |
Queue 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.
Source: jeremylongshore/claude-code-plugins-plus-skills → skills/.curated/perplexity-prod-checklist/SKILL.md
Also appears in: jeremylongshore/claude-code-plugins-plus-skills/plugins/saas-packs/perplexity-pack/skills/perplexity-prod-checklist/SKILL.md
1---
2name: perplexity-prod-checklist
3description: "'Execute Perplexity production deployment checklist for Sonar API integrations. Use when deploying Perplexity integrations to production, preparing for launch, or implementing go-live procedures. Trigger with phrases like \"perplexity production\", \"deploy perplexity\", \"perplexity go-live\", \"perplexity launch checklist\". '"
4allowed-tools: "Read, Bash(kubectl:*), Bash(curl:*), Grep"
5category: productivity-and-workflow
6source_repo: jeremylongshore/claude-code-plugins-plus-skills
7source_path: "skills/.curated/perplexity-prod-checklist/SKILL.md"
8source_url: https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/HEAD/skills/.curated/perplexity-prod-checklist/SKILL.md
9---
10
11# Perplexity Production Checklist
12
13## Overview
14
15Complete 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.
16
17## Prerequisites
18
19- Staging environment tested
20- Production API key generated (separate from dev/staging)
21- Monitoring configured
22- Cost budget defined
23
24## Production Readiness Checklist
25
26### API Configuration
27
28- [ ] Production `PERPLEXITY_API_KEY` in secret manager (not env file)
29- [ ] Key starts with `pplx-` and has credits loaded
30- [ ] Separate API keys for dev/staging/prod
31- [ ] Base URL is `https://api.perplexity.ai` (not localhost/proxy)
32- [ ] Model selection configured: `sonar` for fast, `sonar-pro` for deep
33
34### Code Quality
35
36- [ ] All search calls wrapped in retry with exponential backoff
37- [ ] Rate limiting implemented (50 RPM default)
38- [ ] Query sanitization strips PII before sending to Perplexity
39- [ ] Citations parsed from response (not extracted from text)
40- [ ] `max_tokens` set on all requests (prevents runaway costs)
41- [ ] Timeouts configured: 15s for sonar, 30s for sonar-pro
42- [ ] Error handling covers 401, 402, 429, 500+ status codes
43- [ ] No hardcoded API keys in source code
44
45### Performance
46
47- [ ] Result caching implemented for repeated queries
48- [ ] Cache TTL appropriate: 30min for news, 4hrs for research, 24hrs for facts
49- [ ] Streaming enabled for user-facing search (reduces perceived latency)
50- [ ] Request queue prevents burst overload
51- [ ] `search_domain_filter` used where appropriate (reduces search time)
52
53### Monitoring
54
55- [ ] Latency tracked per model (sonar ~2s, sonar-pro ~5s, deep-research ~30s)
56- [ ] Error rate monitored (alert on >5% failure rate)
57- [ ] Token usage tracked for cost projection
58- [ ] Citation count per response logged (quality signal)
59- [ ] 429 rate limit errors tracked with alert
60
61### Cost Controls
62
63- [ ] Monthly budget cap set on API key
64- [ ] Model routing: simple queries to `sonar`, complex to `sonar-pro`
65- [ ] `max_tokens` capped per endpoint
66- [ ] Cache hit rate monitored (target >30%)
67- [ ] Cost per query tracked by model
68
69### Graceful Degradation
70
71```typescript
72async function searchWithFallback(query: string) {
73 try {
74 // Primary: sonar-pro for deep answers
75 return await perplexity.chat.completions.create({
76 model: "sonar-pro",
77 messages: [{ role: "user", content: query }],
78 max_tokens: 2048,
79 });
80 } catch (err: any) {
81 if (err.status === 429 || err.status >= 500) {
82 // Fallback: sonar for faster, cheaper response
83 return await perplexity.chat.completions.create({
84 model: "sonar",
85 messages: [{ role: "user", content: query }],
86 max_tokens: 512,
87 });
88 }
89 throw err;
90 }
91}
92```
93
94### Health Check Endpoint
95
96```typescript
97app.get("/health/perplexity", async (req, res) => {
98 const start = Date.now();
99 try {
100 const response = await perplexity.chat.completions.create({
101 model: "sonar",
102 messages: [{ role: "user", content: "ping" }],
103 max_tokens: 5,
104 });
105 res.json({
106 status: "healthy",
107 latencyMs: Date.now() - start,
108 model: response.model,
109 });
110 } catch (err: any) {
111 res.status(503).json({
112 status: "unhealthy",
113 error: err.status || err.message,
114 latencyMs: Date.now() - start,
115 });
116 }
117});
118```
119
120## Alerting Rules
121
122| Alert | Condition | Severity |
123|-------|-----------|----------|
124| API Unreachable | Health check fails 3x | P1 |
125| High Error Rate | 429/5xx > 5% over 5min | P2 |
126| High Latency | p95 > 15s for sonar | P2 |
127| Budget Exceeded | Monthly cost > 80% cap | P2 |
128| Auth Failure | Any 401/402 error | P1 |
129
130## Error Handling
131
132| Issue | Cause | Solution |
133|-------|-------|----------|
134| Variable latency | Web search per request | Set appropriate timeouts per model |
135| Broken citations | Source pages changed | Validate citation URLs before displaying |
136| Cost overrun | No model routing | Route simple queries to sonar |
137| Rate limit spikes | Burst traffic | Queue requests with p-queue |
138
139## Output
140
141- Production-ready Perplexity integration with all checks passing
142- Health check endpoint for monitoring
143- Graceful degradation from sonar-pro to sonar
144- Alerting rules configured
145
146## Resources
147
148- [Perplexity API Documentation](https://docs.perplexity.ai)
149- [Model Pricing](https://docs.perplexity.ai/docs/getting-started/pricing)
150
151## Next Steps
152
153For version upgrades, see `perplexity-upgrade-migration`.
154
155---
156
157**Source:** [`jeremylongshore/claude-code-plugins-plus-skills`](https://github.com/jeremylongshore/claude-code-plugins-plus-skills) → `skills/.curated/perplexity-prod-checklist/SKILL.md`
158
159**Also appears in:** `jeremylongshore/claude-code-plugins-plus-skills/plugins/saas-packs/perplexity-pack/skills/perplexity-prod-checklist/SKILL.md`