Prem

Why Prem?

Prem is a platform that’s packaged with the necessary tools to effortlessly integrate Generative AI into your applications.

With Prem you can:

  • Simultaneously test and monitor LLMs in the Prem Lab: Compare the performance of multiple models and find the best fit for your use case.
  • Train models in the Prem Gym: Leverage Prem’s ability to autonomously fine-tune models. The Gym is your place to beef up your deployment models by continuously fine-tuning your data in order to improve performance.
  • Seamlessly create RAG-based assistants: Prem is capable of interacting with your documents. Just upload the documents, and we’ll take care of the rest.
  • Launch and use the Prem JavaScript and Python SDKs: Integrate your custom AI into your applications with minimal effort.

Quickstart

✌️ This guide shows you how to create a Generative AI application with Prem in minutes.

1

Activate your Prem account.

2

Sign in and generate an API key.

Alt Text

4

Head over to the Lab and experiment with various LLMs simultaneously.

Usage of the Prem Lab

5

After you've experimented with different models in the Lab, go to the Launchpad and choose the most suitable model for your use case.

Launch you Generative AI App with Prem

6

Now it's time to integrate Prem into your application.

Choose an SDK and install

Prem also exposes a simple REST API for interacting with the platform.

pip install premai

Run your first project.

from premai import Prem

client = Prem(
api_key=YOUR_API_KEY
)

messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Who won the world series in 2020?"},
]
model = "gpt-3.5-turbo"
project_id = PROJECT_ID

# Create completion

response = client.chat.completions.create(
project_id=project_id,
messages=messages,
model=model,
stream=False
)

print(response.choices)

# Create completion with stream

response = client.chat.completions.create(
project_id=project_id,
messages=messages,
model=model,
stream=True
)

for chunk in response:
if chunk.choices[0].delta["content"]:
print(chunk.choices[0].delta["content"], end="")

print(f"\nTrace ID: {response.trace_id}")

Next steps

Read the guides