Prem generic utils to use across Prem Components.
Project description
🛠️ Prem Utils
Utilities, and Connectors in order to interact with all Model Serving and Fine-tuning Providers.
🗄️ Connectors
Name | Status |
---|---|
Anthropic | Active |
OpenAI | Active |
Perplexity | Active |
Cohere | Active |
DeepInfra | Deprecated |
FireworksAI | Deprecated |
OctoAI | Deprecated |
Groq | Active |
Lamini | Deprecated |
Mistral | Active |
OpenRouter | Active |
Prem | Active |
Replicate | Deprecated |
Together | Deprecated |
🤙 Usage
pip install prem-utils
import asyncio
from inspect import iscoroutine
from prem_utils.connectors import openai
connector = openai.OpenAIConnector(api_key="")
prompt = "Hello, how are you?"
response = connector.chat_completion(model="gpt-3.5-turbo", messages=[{"role": "user", "content": prompt}])
if iscoroutine(response):
response = asyncio.run(response)
message = response["choices"][0]["message"]["content"]
print(message)
📦 Contribute
Install the necessary dependencies
virtualenv venv -p=3.11
source venv/bin/activate
pip install -r requirements.txt
Test all or one connector
# will run all the connectors
python e2e.py
# only one connector
python e2e.py --name perplexity
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
prem_utils-0.0.40.tar.gz
(29.2 kB
view hashes)
Built Distribution
Close
Hashes for prem_utils-0.0.40-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6c06eeeca8ce9c6d6a68bea902d5c4638cbbd9a70a0970a68d0d46cda5d56ac |
|
MD5 | fb1ea5f6c20fbbe12f40eb4a230015ab |
|
BLAKE2b-256 | af171d5b64748914c1302397f5890ad663d5318e85a57f295f27069cb4425f74 |