Incorporating Perplexity Sonar Reasoning models

Hey everyone, yesterday I installed bolt.diy and noticed that the perplexity.ts is out of date. It’s showing the older (soon to be discontinued models). Perplexity now offers Sonar Reasoning and Sonar Reasoning Pro which I was excited to try out. I modified the perplexity.ts file to incorporate these models, but it’s not working 100% properly. I was wondering if there are other files I need to modify or if that is something that is going to be updated soon?

Here’s the list of API models through Perplexity: Supported Models - Perplexity

Thanks

2 Likes

I edited the perplexity.ts (bolt.diy\app\lib\modules\llm\providers\perplexity.ts) file changing the models section to the following then it worked for the pro that I wanted, after refreshing bolt.diy, labels can be whatever you want obviously, but the ‘names:’ I changed to these

staticModels: ModelInfo = [
{
name: ‘sonar-small-online’,
label: ‘Sonar Small Online’,
provider: ‘Perplexity’,
maxTokenAllowed: 8192,
},
{
name: ‘sonar-pro’,
label: ‘Sonar Pro Online’,
provider: ‘Perplexity’,
maxTokenAllowed: 8192,
},
{
name: ‘sonar-reasoning-pro’,
label: ‘Sonar Reasoning Online’,
provider: ‘Perplexity’,
maxTokenAllowed: 8192,
},

save it and refresh bolt.diy. Hope it helps :slight_smile: