LLM access to pplx-api 3 by Perplexity Labs
Install this plugin in the same environment as LLM.
llm install llm-perplexity
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'
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.