Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prem-utils

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prem-utils

Prem generic utils to use across Prem Components.

  • 0.0.47
  • PyPI
  • Socket score

Maintainers
2

🛠️ Prem Utils

Utilities, and Connectors in order to interact with all Model Serving and Fine-tuning Providers.

🗄️ Connectors

NameStatus
AnthropicActive
OpenAIActive
PerplexityActive
CohereActive
DeepInfraDeprecated
FireworksAIDeprecated
OctoAIDeprecated
GroqActive
LaminiDeprecated
MistralActive
OpenRouterActive
PremActive
ReplicateDeprecated
TogetherDeprecated

🤙 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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc