Skip to main content
How-To · Secure Query Processing

How-To: Install Query Client

The query client encrypts inputs, sends them to a model and decrypts the results. This guide shows how to install it for Python or TypeScript.

Before you start​

Who it's for

Anyone who only queries a model, such as an app or a partner, with a User Access Token from the model's owner.

Already have Studio?

If you followed Installation & Setup, the Python query client is already installed with lattica-studio. Skip the Python tab.

Your keys stay local

The client keeps your secret key on your machine. Only encrypted data is sent to Lattica.

Install the client​

You need Python 3.11 or newer. Install the lattica-query package:

pip install lattica-query

Check that it works:

python -c "from lattica_query import QueryClient, QueryToken; print('lattica-query is ready')"

Keep your User Access Token in an environment variable rather than in code:

export LATTICA_QUERY_TOKEN="<your-user-access-token>"

Next​