Perplexity AI is a cutting-edge answer engine that utilizes large language models (LLMs) to provide accurate and informative responses to user inquiries. By leveraging the power of AI, Perplexity AI aims to enhance the search experience by delivering concise answers along with relevant sources, saving users time and effort. Additionally, Perplexity AI offers features like summarizing information from web pages and generating creative content, making it a versatile tool for research, learning, and exploring new ideas.
perplexity
const { LLMInterface } = require('llm-interface');
LLMInterface.setApiKey({'perplexity': process.env.PERPLEXITY_API_KEY});
async function main() {
try {
const response = await LLMInterface.sendMessage('perplexity', 'Explain the importance of low latency LLMs.');
console.log(response.results);
} catch (error) {
console.error(error);
throw error;
}
}
main();
The following model aliases are provided for this provider.
default
: llama-3-sonar-large-32k-onlinelarge
: llama-3-sonar-large-32k-onlinesmall
: llama-3-sonar-small-32k-onlineagent
: llama-3-sonar-large-32k-online
The following parameters can be passed through options
.
frequency_penalty
: Details not available, please refer to the LLM provider documentation.max_tokens
: Details not available, please refer to the LLM provider documentation.presence_penalty
: Details not available, please refer to the LLM provider documentation.return_citations
: Details not available, please refer to the LLM provider documentation.return_images
: Details not available, please refer to the LLM provider documentation.stream
: Details not available, please refer to the LLM provider documentation.temperature
: Details not available, please refer to the LLM provider documentation.top_k
: Details not available, please refer to the LLM provider documentation.top_p
: Details not available, please refer to the LLM provider documentation.
- Streaming
Commercial (Credit Card Required): The Perplexity API requires a credit card to get started.
To get an API key, first create a Perplexity AI account, then visit the link below.
Perplexity AI documentation is available here.
Anthropic