An experimental developer tool for comparing different Perplexity AI models side by side. Built to help developers evaluate and choose the right model for their applications by comparing responses, costs, and performance.
- Clone the repository
git clone https://github.com/jsandai/pplx-api-compare.git- Enter the project directory
cd pplx-api-compare- Install dependencies
npm install- Create your .env file from the example
cp .env.example .env-
Get your API key from: https://docs.perplexity.ai/
-
Add your Perplexity API key to .env - alternatively paste it directly into the field within advanced settings
-
Start the development server
npm run devThe application will be available at http://localhost:3000 by default (or the next available port if 3000 is in use).
- Compare responses from multiple Perplexity models simultaneously
- Real-time cost calculation and token usage monitoring
- Comparison of various Perplexity models including Sonar (Pro, Reasoning, Deep Research) and the offline r1-1776 model.
- Dark/Light theme support
- Markdown rendering for responses
- Export results as JSON
- Configurable parameters (temperature, max tokens)
- API key management with local storage
- Responsive design for all screen sizes
This tool is designed for developers to:
- Test how different models respond to the same prompt
- Compare response quality and characteristics
- Understand the cost implications of each model
- Make informed decisions about which model best fits their needs
Note: This is an experimental developer utility, not intended for production use.
The application includes configurable parameters for fine-tuning your comparisons:
The tool supports the following models available through the Perplexity API:
sonar-pro(200k context)- Advanced search model.
- Note: May perform multiple searches per request.
sonar(128k context)- Lightweight, cost-effective search model.
sonar-reasoning-pro(128k context)- Enhanced reasoning model with multi-step problem-solving and real-time search.
sonar-reasoning(128k context)- Quick problem-solving and reasoning model.
sonar-deep-research(128k context)- Expert-level research model for exhaustive analysis and detailed reports.
r1-1776(128k context)- Offline chat model, does not use web search.
- Costs are estimated based on Perplexity's published pricing.
- Request Costs:
sonar: $0.008 / requestsonar-pro: $0.01 / requestsonar-reasoning: $0.008 / requestsonar-reasoning-pro: $0.01 / requestsonar-deep-research: $0.005 / search queryr1-1776: $0 / request (offline model)
- Note: For models with tiered request pricing (Sonar, Sonar Pro, Sonar Reasoning, Sonar Reasoning Pro), the costs displayed in the tool are based on the 'Medium' tier.
- Sonar Pro & Multi-Search:
sonar-pro(and potentially other models likesonar-deep-researchdepending on query complexity) may perform multiple internal searches. The tool's request cost reflects the base API call; however, actual costs from Perplexity might be higher if multiple search queries are initiated by the model for a single API response. This is particularly relevant forsonar-pro. - Token Costs: Input, output, and (for
sonar-deep-research) reasoning token costs are tracked based on API usage data and official pricing.
https://docs.perplexity.ai/guides/model-cards
When running npm install, you may see several deprecation warnings related to ESLint's dependencies. These warnings are:
- Coming from ESLint's internal dependencies
- Don't affect the functionality of the application
- Will be resolved in future ESLint updates
- Can be safely ignored for this experimental tool
- Node.js >= 18.0.0
- npm (comes with Node.js)
- Perplexity API key
This project is licensed under the MIT License - see the LICENSE file for details.

