Skip to content

Conversation

embire2
Copy link

@embire2 embire2 commented Sep 9, 2025

Summary

This PR fixes issue #1873 by updating Perplexity model validation and adding support for the latest 2025 Perplexity API models.

Problem

  • Bolt.diy was showing outdated/invalid Perplexity models in the provider settings dropdown
  • API calls were failing due to invalid model names
  • No validation existed to prevent incorrect model selection
  • Static model list was outdated and didn't reflect current Perplexity offerings

Solution

Updated Model List (2025 Perplexity Models)

  • sonar: Latest Sonar model built on Llama 3.3 70B (127K context)
  • sonar-reasoning: Advanced reasoning model with Chain of Thought (127K context)
  • sonar-deep-research: Expert-level research model (127K context)
  • Legacy Llama-based models maintained for backward compatibility

Implementation Details

  1. Model Validation: Added comprehensive validation with helpful error messages
  2. Utility Functions: Created perplexity-utils.ts for centralized model management
  3. UI Component: Added ModelInput.tsx with real-time validation and suggestions
  4. Token Limits: Updated from 8,192 to 127,072 tokens for all Perplexity models
  5. Deprecation Handling: Added warnings for deprecated models with replacement suggestions

Changes Made

  • /app/lib/modules/llm/providers/perplexity.ts - Updated provider with new models and validation
  • /app/lib/modules/llm/providers/perplexity-utils.ts - New utility file for model management
  • /app/components/@settings/tabs/providers/components/ModelInput.tsx - New UI component
  • /app/lib/.server/llm/constants.ts - Updated Perplexity token limits

Testing

  • TypeScript compilation passes
  • ESLint checks pass
  • Build completes successfully
  • Model validation works correctly
  • Deprecation warnings display properly

Screenshots

Model validation provides real-time feedback and suggestions for valid model names

Related Issues

Fixes #1873

Author

Keoma Wright


This fix ensures Bolt.diy users can fully leverage Perplexity's powerful AI models for search, reasoning, and research tasks.

This comprehensive fix addresses issue stackblitz-labs#1873 where Bolt.diy was showing
outdated/invalid Perplexity models causing API errors.

Changes:
- Updated Perplexity models to 2025 API (sonar, sonar-reasoning, sonar-deep-research)
- Added legacy Llama-based models for backward compatibility
- Implemented model validation with helpful error messages
- Created perplexity-utils.ts for centralized model management
- Added ModelInput component for improved UX with suggestions
- Updated token limits from 8K to 127K for all Perplexity models
- Added deprecation warnings for old models

Author: Keoma Wright

Co-Authored-By: Keoma Wright <keoma@wright.dev>
@embire2 embire2 changed the title Fix: Update Perplexity model validation and add 2025 models (#1873) Fix: update Perplexity model validation and add 2025 models (#1873) Sep 9, 2025
@embire2 embire2 changed the title Fix: update Perplexity model validation and add 2025 models (#1873) fix: update Perplexity model validation and add 2025 models (#1873) Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add validation and suggestions for Perplexity model names in settings
1 participant