Page cover

Query Submission

End-users interact with AI models on LatticaAI by submitting queries through the Query Client. This document provides an overview of the steps required to submit queries.

Public Models for Demonstration

For providers who want to showcase their AI models and demonstrate how they operate with homomorphic encryption, LatticaAI offers the option to create a dedicated Demo Web Page. This page allows potential users to interact securely with the model without the need to set up a separate Query Client or define individual access tokens.

Once the demo page is created, a unique link will be provided to the AI provider. This link can be used in presentations, marketing materials, or shared directly with potential customers, making it easy to highlight the model’s capabilities and secure processing in a real-world scenario.

Providers can explore LatticaAI’s demo as an example of how the demo page works.

Overview

  • Query Client:

    All end-user activities are performed via the Query Client, which handles secure data encryption and communication with the LatticaAI backend.

  • Access Token:

    Each user receives a unique Access Token from the AI provider. This token is specific to the user and the model it is associated with. The token is used for authentication and is required for all communications with LatticaAI.

LatticaAI provides a Python and TypeScript SDK packages for query submission, allowing providers to implement their own user interface for end-users. It is the AI provider’s responsibility to build the UI using the provided SDK packages.


Query Submission Workflow

Drawing
Communication phases between the Query Client and an Access Point.
1

Handshake

The first step in query submission is the handshake process.

  • The Query Client establishes a connection with the corresponding model using the Access Token.

  • The handshake ensures the client receives all necessary metadata related to the model.

2

Generate Encryption Key (evk)

Before submitting queries, the user must create a pair of encryption keys:

  • Secret Key: Used to encrypt and decrypt messages.

  • Evaluation Key: Sent to the LatticaAI backend to enable efficient computation.

This is a one-time setup. The same keys can be reused for all interactions with the model.

3

Encrypt the Query

The user encrypts the query message using their Secret Key.

4

Send the Encrypted Query

  • The encrypted query and Access Token are transmitted to the LatticaAI backend for processing.

  • LatticaAI verifies the token, processes the query, and returns the result as an encrypted message.

5

Decrypt the Result

The user decrypts the encrypted result using their Secret Key to obtain the final output.


Queries can only be processed when a worker is running for the associated model.

AI Providers are responsible for running and monitoring workers through our console or Python SDK



Last updated

Was this helpful?