perplexity-local-dev-loop

Featured

Configure Perplexity local development with mocking, testing, and hot reload. Use when setting up a development environment, configuring test workflows, or establishing a fast iteration cycle with Perplexity Sonar API. Trigger with phrases like "perplexity dev setup", "perplexity local development", "perplexity dev environment", "develop with perplexity", "mock perplexity".

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 Local Dev Loop ## Overview Set up a fast, cost-effective local development workflow for Perplexity Sonar API. Key challenge: every real API call performs a web search and costs money, so mocking and caching are essential for development. ## Prerequisites - Completed `perplexity-install-auth` setup - Node.js 18+ with npm/pnpm - `vitest` for testing ## Instructions ### Step 1: Project Structure ``` my-perplexity-project/ ├── src/ │ ├── perplexity/ │ │ ├── client.ts # OpenAI client wrapper for Perplexity │ │ ├── search.ts # Search functions with citation handling │ │ └── types.ts # Response type extensions │ └── index.ts ├── tests/ │ ├── fixtures/ # Saved API responses for mocking │ │ └── sonar-response.json │ ├── perplexity.test.ts │ └── setup.ts ├── .env.local # API key (git-ignored) ├── .env.example # Template └── package.json ``` ### Step 2: Type-Safe Client Wrapper ```typescript // src/perplexity/client.ts import OpenAI from "openai"; export interface PerplexityResponse extends OpenAI.ChatCompletion { citations?: string[]; search_results?: Array<{ title: string; url: string; snippet: string; }>; related_questions?: string[]; } export type PerplexityModel = "sonar" | "sonar-pro" | "sonar-reasoning-pro" | "sonar-deep-research"; export function createClient(apiKey?: string): OpenAI { return new OpenAI({ apiKey: apiKey || process.env.PERPLEXITY_API_KEY, ...

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-install-auth

Install and configure Perplexity Sonar API authentication. Use when setting up a new Perplexity integration, configuring API keys, or initializing the OpenAI-compatible client for Perplexity. Trigger with phrases like "install perplexity", "setup perplexity", "perplexity auth", "configure perplexity API key", "perplexity sonar setup".

2,266 Updated today
jeremylongshore
AI & Automation Featured

perplexity-sdk-patterns

Apply production-ready Perplexity Sonar API patterns for TypeScript and Python. Use when implementing Perplexity integrations, refactoring SDK usage, or establishing team coding standards for search-augmented generation. Trigger with phrases like "perplexity SDK patterns", "perplexity best practices", "perplexity code patterns", "idiomatic perplexity", "perplexity wrapper".

2,266 Updated today
jeremylongshore
AI & Automation Featured

perplexity-multi-env-setup

Configure Perplexity Sonar API across development, staging, and production environments. Use when setting up multi-environment search integrations, managing API keys per environment, or controlling cost through model routing by env. Trigger with phrases like "perplexity environments", "perplexity staging", "perplexity dev prod", "perplexity environment config".

2,266 Updated today
jeremylongshore
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-observability

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".

2,266 Updated today
jeremylongshore