The maihem python package allows you to simulate AI personas and generate synthetic text data for training and evaluating your LLMs. It also provides text data evaluations.

Installation

To install, run the following command in a terminal:

pip install maihem

Make sure you have upgraded to the latest version with the following command in the terminal.

pip install maihem --upgrade

Import maihem package

To import the maihem package, in python add this line

import maihem

Get API key

You need an API key to access our service. Log into your account here, then click in the Account tab on the left. You will find your API key there. Store it safely and don’t share it with anyone else.

Set API key

Before using the maihem package, you need to set your maihem API key as an environment variable. You can add it directly in your python code, or to your local bash script.

Alternative 1: In python code

In the beggining of your code add the following lines with your corresponding API key:

import os

os.environ['MAIHEM_API_KEY'] = '<your_maihem_api_key>'

Alternative 2: In local bash script