Together AI
Together AI provides fully managed API endpoints for open-source large language models (LLMs), allowing developers for building and running generative AI.
The best part is you can use these open-source models directly without worrying about the underlying infrastructure,
How will this help?
They offer API endpoints for models like Llama-2, Mistral-7B, CodeLlama, and more. You can use these endpoints to evaluate the performance of these models using UpTrain.
Before we start you will need an Together AI API key. You can get it here
How to integrate?
First, let’s import the necessary packages and define Together AI API Key
We will be using Mixtral-8x7B-Instruct-v0.1 for this example. You can find a full list of available models here.
Let’s define a dataset on which we want to perform the evaluations
Now, let’s use UpTrain to evaluate for Context Relevance. You can find the complete list of metrics supported by UpTrain here
Let’s look at the output of the above code:
According to these evaluations:
- Context Relevance: Since the context has information on the most popular sport globally, UpTrain has rated the context to be relevant to the question.
- Factual Accuracy: Since the facts mentioned in the response are grounded to the context, UpTrain has rated the response as factually accurate.