perplexity-deploy-integration

Featured

Deploy Perplexity Sonar API integrations to Vercel, Cloud Run, and Docker. Use when deploying Perplexity-powered applications to production, configuring platform-specific secrets, or setting up edge functions. Trigger with phrases like "deploy perplexity", "perplexity Vercel", "perplexity production deploy", "perplexity Cloud Run", "perplexity Docker".

DevOps & Infrastructure 2,940 stars 439 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 Deploy Integration ## Overview Deploy applications using Perplexity Sonar API to edge and server platforms. Perplexity's OpenAI-compatible endpoint at `https://api.perplexity.ai/chat/completions` works from any platform that can make HTTPS requests. ## Prerequisites - Perplexity API key stored in `PERPLEXITY_API_KEY` - Platform CLI installed (vercel, gcloud, or docker) - Application tested locally ## Instructions ### Step 1: Vercel Edge Function ```typescript // api/search.ts import OpenAI from "openai"; export const config = { runtime: "edge" }; const perplexity = new OpenAI({ apiKey: process.env.PERPLEXITY_API_KEY!, baseURL: "https://api.perplexity.ai", }); export default async function handler(req: Request) { const { query, model = "sonar", stream = false } = await req.json(); if (stream) { const response = await perplexity.chat.completions.create({ model, messages: [{ role: "user", content: query }], stream: true, max_tokens: 2048, }); return new Response(response.toReadableStream(), { headers: { "Content-Type": "text/event-stream" }, }); } const response = await perplexity.chat.completions.create({ model, messages: [{ role: "user", content: query }], max_tokens: 2048, }); return Response.json({ answer: response.choices[0].message.content, citations: (response as any).citations || [], model: response.model, }); } ``` ```bash set -euo pipefail # Deploy to Vercel...

Details

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

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category