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.31.tar.gz
(28.0 kB
view details)
Built Distribution
File details
Details for the file prem-utils-0.0.31.tar.gz
.
File metadata
- Download URL: prem-utils-0.0.31.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2014ebb71f25782561f74fd01411cd81149d9d4d08f5ee54937b1d8c3cdf4cf1 |
|
MD5 | 33adda4b578e8adbcb5f4597d9440bd6 |
|
BLAKE2b-256 | 4c2fdc4717baed48b8f78ecf3fb51dcf6659bdad48e411729af114c075389da8 |
File details
Details for the file prem_utils-0.0.31-py3-none-any.whl
.
File metadata
- Download URL: prem_utils-0.0.31-py3-none-any.whl
- Upload date:
- Size: 39.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fdd37f51f8298b7c322fc1fecfad22dfbb59db18c88f5d8b2384975506d719b |
|
MD5 | e160081b7332b139610795184d90b84e |
|
BLAKE2b-256 | 97f18137a0771c878d3d28cb241fa4c039b099fc36a4f02a1f36c64f6e154d97 |