Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Add Premp AI provider #3722

Closed
tuanlv14 opened this issue May 18, 2024 · 2 comments
Closed

[Feature]: Add Premp AI provider #3722

tuanlv14 opened this issue May 18, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@tuanlv14
Copy link

The Feature

I suggest to add Premp provider under OpenAI compatibility:
curl --request POST
--url https://app.premai.io/v1/chat/completions
--header 'Authorization: API_KEY'
--header 'Content-Type: application/json'
--data '{
"project_id": PRO_ID,
"messages": [
{
"role": "user",
"content": "Who are you ?"
}
],
"model": "gpt-4-eu"
}'

Motivation, pitch

Add more a good provider with gpt4 free trial.

Twitter / LinkedIn details

No response

@tuanlv14 tuanlv14 added the enhancement New feature or request label May 18, 2024
@krrishdholakia
Copy link
Contributor

doesn't this already work? @tuanlv14

https://docs.litellm.ai/docs/providers/openai_compatible

@tuanlv14
Copy link
Author

doesn't this already work? @tuanlv14

https://docs.litellm.ai/docs/providers/openai_compatible

Yes. I had tried but current method was not working. Based on Premp API document, it required payload with project_user_ID. I did not know how I can custom project_ID with liteLLM parameters. Pls help me.

import requests

url = "https://app.premai.io/v1/chat/completions"

payload = {
"project_id": 123,
"session_id": "",
"repositories": {
"ids": [123],
"limit": 3,
"similarity_threshold": 0.5
},
"messages": [
{
"role": "user",
"content": "",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"params": {}
}
],
"model": "",
"system_prompt": "",
"max_tokens": 1,
"stream": True,
"temperature": 1
}
headers = {
"Authorization": "",
"Content-Type": "application/json"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants