Skip to content

hex/llm-perplexity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

llm-perplexity

PyPI Changelog License

LLM access to pplx-api 3 by Perplexity Labs

Installation

Install this plugin in the same environment as LLM.

llm install llm-perplexity

Usage

First, set an API key for Perplexity AI:

llm keys set perplexity
# Paste key here

Run llm models to list the models, and llm models --options to include a list of their options.

Run prompts like this:

llm -m sonar-small 'Fun facts about pelicans'
llm -m sonar-large 'Fun facts about walruses'
llm -m sonar-huge 'Fun facts about whales'
llm -m sonar-small-chat 'Fun facts about wolves'
llm -m sonar-large-chat 'Fun facts about foxes'
llm -m llama-3.1-8b-instruct 'Fun facts about lemurs'
llm -m llama-3.1-70b-instruct 'Fun facts about coyotes'

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-perplexity
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

llm install -e '.[test]'

This plugin was made after the llm-claude-3 plugin by Simon Willison.