The humanloop.complete()and humanloop.chat() call encapsulates the LLM provider calls (for example openai.Completions.create()), the model-config selection and logging steps in a single unified interface. There may be scenarios that you wish to manage the LLM provider calls directly in your own code instead of relying on Humanloop.
For example, you may be using an LLM provider that currently is not directly supported by Humanloop such as Hugging Face.
To support using your own model provider, we provide additional humanloop.log() and humanloop.projects.get_active_config() methods in the SDK.
In this guide, we walk through how to use these SDK methods to log data to Humanloop and run experiments.
First you need to install and initialize the SDK. If you have already done this, skip to the next section.
Open up your terminal and follow these steps:
data_id as before.See our guide on capturing user feedback.
Note that you can also use a similar pattern for non-OpenAI LLM providers. For example, logging results from Hugging Face’s Inference API: