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

Uploaded Source

Built Distribution

prem_utils-0.0.30-py3-none-any.whl (39.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for prem-utils-0.0.30.tar.gz
Algorithm Hash digest
SHA256 f62625f8428a8fd7935bc35c685f7587f6432e1a208092604a6b06286b32a0f2
MD5 67f4840d8cb058ae346c1666c18e433b
BLAKE2b-256 d0fd3775c7a65fd8daab4389c6d915d96d8fcfab4ce01cf1d2f31c151d54c5e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prem_utils-0.0.30-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

Hashes for prem_utils-0.0.30-py3-none-any.whl
Algorithm Hash digest
SHA256 4c31c1cac1b63158bb7fc549e1c095856c4bcd70c46963548dababf056dfb307
MD5 449b63d9719c35d8cf15dfe27389fed7
BLAKE2b-256 2438c875c5dead8c1f99522e6cc98e7054689e532e6a91edbe9569f8c40624c9

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