hulse-py

The Hulse Python client allows you to leverage Hugging Face's NLP models to run queries on your Hulse clusters (personal computers).

The current beta version offers models from the Hugging Face Transformers library. Please refer to the Hugging Face's documentation for more in-depth information about the models and tasks covered (see all NLP models here).

Installation

You can install the Hulse Python Client with pip:

pip install hulse

You will need your API key to use the Hulse Python Client (available in your Hulse dashboard). Note that the Python Client also comes with a CLI allowing you to host directly from your terminal as an alternative to the desktop app.

Hulse Python Client

Let's look at 2 interesting functions of the Hulse Python client:

  • query method: given a task, some data, and your API key, seamlessly process your data using your Hulse cluster.

  • host CLI command: given your API key, start a Hulse host directly from the command line (by-passing the download of the macOS app).

To get an idea of how you can use Hulse to accelerate your inference workloads, jump to the example section.

Query method

Here is an example usage of the query method. Let's say we wish to analyse data with a text-classification NLP model, we can do so as follows:

hulse/test.py
import hulse

api_key = "my-api-key" # find it on your dashboard
data = "Just some interesting, although boring, text."
client = hulse.Hulse()
result = client.query(task="text-classification", data=data, api_key=api_key)

This will send your query to the Hulse servers, which will be dispatched to an active member of your clusters, whom will process the query, using the provided data and task. The result will be forwarded back to you.

Host command

hulse-py also includes a CLI to run a host from your terminal. This can be simpler than using the macOS app, and doesn't change anything for other cluster members using your computing power.

hulse host --key="my-api-key"

The host starts in the background of your shell, and runs until interruption.

Last updated