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.34.tar.gz
(28.9 kB
view details)
Built Distribution
File details
Details for the file prem-utils-0.0.34.tar.gz
.
File metadata
- Download URL: prem-utils-0.0.34.tar.gz
- Upload date:
- Size: 28.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 736632e4934dc457b66bfd76eafe9aff9d028615bad39926044e84eaa49f558f |
|
MD5 | 8bd3ef419036c5c9c13535b272f180fb |
|
BLAKE2b-256 | 5d12f7146edc3947fc755e8a0e655d0205db484b26a9cdd00aa9d57be22fad9c |
File details
Details for the file prem_utils-0.0.34-py3-none-any.whl
.
File metadata
- Download URL: prem_utils-0.0.34-py3-none-any.whl
- Upload date:
- Size: 40.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f971bdc220bc4a9f0009241159760dd75c92c61392cee8e5210d49891933a5e |
|
MD5 | 22191731e11a09d950b0a376a7bd7c05 |
|
BLAKE2b-256 | 573c4f188e3ac3eae4a8a052dceed7d6f5fa47eebd049d77330fe43a900623d9 |