#pls add support for perplexity.ai custom endpoint and api

1 messages · Page 1 of 1 (latest)

quiet zinc
#

https://docs.perplexity.ai/docs/getting-started

i want to use these models in Librechat -- Mistral 7B, Llama 13B, Code Llama 34B, Llama 70B, and Replit 3b.

it can be achieve via perplexity api

it will be very helpful feature for users like me

thx in advance

pplx-api

You can access pplx-api using HTTPS requests. Authenticating involves the following steps: Generate an API key through the Perplexity Account Settings Page. The API key is a long-lived access token that can be used until it is manually refreshed or deleted.Send the API key as a bearer token in the A...

brazen lion
#

Setting this up as a reverse proxy would work

quiet zinc
#

it did not

#

fuegovic tried it

spark otter
placid marsh
#

i noticed you mentioned some issues with the api address for perplexity

#

it seems like not using the v1 in the address is causing problems, right?

#

that's interesting!

#

it's important to make sure the api address is correct so that the model list can update properly

#

have you tried adding the v1 to the address and seeing if that resolves the issue?

#

sometimes even a small change can make a big difference

#

let me know how it goes!

brazen lion
spark otter
placid marsh
brazen lion
spark otter
brazen lion
#

I'll do it on my own, and yeah

#

done

spark otter
#

lol, that was fast!

brazen lion
#

lol

#

also what's your replit username?

spark otter
#

yes, @fuegovic

brazen lion
#

done

#

check replit

quiet zinc
#

wait what happaned here i am in the dark because i am the code nooby xD

spark otter
#

not sure if I did something wrong of if it's just not working 🤔

brazen lion
spark otter
#

I'm not sure whay the error, I can see it's calling the right url 🤷‍♂️

brazen lion
#

V1 is added, 🤔

brazen lion
#

Is there any docs for the API?

spark otter
placid marsh
#

hey there!

brazen lion
#

Yes it does

#

Wait got it

#

It worked!

#

Check the invited repl

brazen lion
spark otter
brazen lion
spark otter
#

wdym?

brazen lion
# spark otter

True, got it, what's the OPENAI_REVERSE_PROXY URL set to?

brazen lion
brazen lion
#

got the issue

#

Librechat is thinking this is not a openai model e.g gpt-3.5-turbo and not passing messages

#

I modified the api to handle that

brazen lion
#

it should work then

spark otter
#

gpt-llama-2-70b-chat,gpt-llama-2-13b-chat,gpt-codellama-34b-instruct,gpt-mistral-7b-instruct

like this?

quiet zinc
quiet zinc
#

wow

#

thank you so much guys i will test it soon

brazen lion
#

@spark otter Got it to work!!!

spark otter
#

nice!

mint aurora
brazen lion
#

req.body.model = req.body.model.replaceAll('gpt-', '') // enabling sending messages
delete req.body.stop; // deleting stop tokens handling
delete req.body.presence_penalty;
delete req.body.frequency_penalty; // greater than 0

mint aurora
#

it looks pretty similar to OpenAI at first glance

spark otter
#

they say "The API is conveniently OpenAI client-compatible for easy integration with existing applications."

brazen lion
#

custom handling for other types of text based models like replit code which requires prompts are also required, messages should be converted to prompt: 'User: message, Assistant: message and system and so on and soforth'

mint aurora
#

librechat supports prompt payloads, that would be an easy fix too

mint aurora
#

perplexity ai is $20/mo?

brazen lion
spark otter
brazen lion
#

Should I delete perplexity api then? @spark otter

spark otter
brazen lion
#

I'll keep it

quiet zinc
#

i got this error 😦

#

Something went wrong. Here's the specific error message we encountered: Failed to send message. HTTP 422 - {"detail":[{"loc":["body"],"msg":"ApiChatCompletionsRequest.init() missing 1 required keyword-only argument: 'messages'","type":"type_error"}]}

quiet zinc
#

gpt-llama-2-70b-chat,gpt-llama-2-13b-chat,gpt-codellama-34b-instruct,gpt-mistral-7b-instruct

#

these models

quiet zinc
#

i guess this link is not workin on my network that may be the cause