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.47.tar.gz
(31.2 kB
view details)
Built Distribution
File details
Details for the file prem_utils-0.0.47.tar.gz
.
File metadata
- Download URL: prem_utils-0.0.47.tar.gz
- Upload date:
- Size: 31.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 572608deb53277ba021cf9a87ead82598be33a2809a1f2bc728d7d4d226b13b6 |
|
MD5 | ecb22c2c1827220dc7dcb687634e9319 |
|
BLAKE2b-256 | f02c925197011caf96485be0ecf1a417bcc57d8f91f23ef172aafcfe4671670a |
File details
Details for the file prem_utils-0.0.47-py3-none-any.whl
.
File metadata
- Download URL: prem_utils-0.0.47-py3-none-any.whl
- Upload date:
- Size: 43.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43a0db92ffdb780d2a71870a7e8d54eae060bd9a9b1ae1fcfd6660a784050a75 |
|
MD5 | 926505ef2da58e89b10cacada036cea1 |
|
BLAKE2b-256 | d14b54def295ef5577cdfdaba9e285fcfec0aa38a04cc69e9e6aca1cb76708e1 |