New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ai-sdk/perplexity

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ai-sdk/perplexity

The **[Perplexity provider](https://sdk.vercel.ai/providers/ai-sdk-providers/perplexity)** for the [AI SDK](https://sdk.vercel.ai/docs) contains language model support for Perplexity's Sonar API - a powerful answer engine with real-time web search capabil

  • 0.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
648
Maintainers
2
Weekly downloads
 
Created
Source

AI SDK - Perplexity Provider

The Perplexity provider for the AI SDK contains language model support for Perplexity's Sonar API - a powerful answer engine with real-time web search capabilities.

Features

  • Real-time web search grounding for accurate, up-to-date responses
  • Support for advanced queries and follow-up questions
  • Multiple tiers available:
    • Sonar Pro: Enhanced capabilities for complex tasks with 2x more citations
    • Sonar: Lightweight offering optimized for speed and cost
  • Industry-leading answer quality
  • Data privacy - no training on customer data
  • Self-serve API access with scalable pricing

Setup

The Perplexity provider is available in the @ai-sdk/perplexity module. You can install it with:

npm i @ai-sdk/perplexity

Provider Instance

You can import the default provider instance perplexity from @ai-sdk/perplexity:

import { perplexity } from '@ai-sdk/perplexity';

Example

import { perplexity } from '@ai-sdk/perplexity';
import { generateText } from 'ai';

const { text } = await generateText({
  model: perplexity('sonar-pro'),
  prompt: 'What are the latest developments in quantum computing?',
});

Documentation

Please check out the Perplexity provider documentation for more information.

Keywords

FAQs

Package last updated on 04 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc