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

Uploaded Source

Built Distribution

prem_utils-0.0.39-py3-none-any.whl (41.0 kB view details)

Uploaded Python 3

File details

Details for the file prem_utils-0.0.39.tar.gz.

File metadata

  • Download URL: prem_utils-0.0.39.tar.gz
  • Upload date:
  • Size: 29.1 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.39.tar.gz
Algorithm Hash digest
SHA256 1f97deac254ae2ed163de62f9590d0b11a8481a723f70add5019e3be116afa58
MD5 df08bf0b5e8a7206658f73bcdcf500b2
BLAKE2b-256 579186e63f2e5645d27af363587d60f9380fa7bdab9d7d323cd2a6c86cb9622c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prem_utils-0.0.39-py3-none-any.whl
  • Upload date:
  • Size: 41.0 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.39-py3-none-any.whl
Algorithm Hash digest
SHA256 c752be85f170c09e9a98c63ccf90e2c4b2ee5e0f78891a28f9b2d73f30b5c0a5
MD5 cb93a038078a759919e790415567f3d5
BLAKE2b-256 ef85e09c8527405a2c3fd35f43649472d208f8eca564b6c8ee5a75a06fd904dd

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