Skip to main content

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


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.35.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

prem_utils-0.0.35-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

Details for the file prem-utils-0.0.35.tar.gz.

File metadata

  • Download URL: prem-utils-0.0.35.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

Hashes for prem-utils-0.0.35.tar.gz
Algorithm Hash digest
SHA256 d68228c5088d94ccdb5da4ed8f48622f923d7a1fa1f59174f3958889e95a9107
MD5 7064e778e856c5b80197f69f20955601
BLAKE2b-256 4627c3b44d61d628274516645c9566d644d8257ce573c1aca6641d6cec88c001

See more details on using hashes here.

File details

Details for the file prem_utils-0.0.35-py3-none-any.whl.

File metadata

  • Download URL: prem_utils-0.0.35-py3-none-any.whl
  • Upload date:
  • Size: 40.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for prem_utils-0.0.35-py3-none-any.whl
Algorithm Hash digest
SHA256 fd2e27441040f1f1668eac0199c43ee118e6749b9fb940331acdd24914025e97
MD5 7bb32b43274cfa93dead4f7c3c6efb92
BLAKE2b-256 a12878e10c40123cd90e9203a709f25f4d33a7ab075624931e8728935b1cb7ed

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page