LatticaAI Documentation
  • Welcome to LatticaAI
  • Conceptual Guide
  • Architecture Overview
    • Management Client
    • Query Client
  • Platform Workflows
    • Account Management
    • Model Management
    • User Access Management
    • Query Submission
    • Credit Management
    • Worker Management
  • How-To Guides
    • Client Installation
      • How-To: Install Management Client
      • How-To: Install Query Client
    • Model Lifecycle
      • How-To: Deploy AI model
      • How-To: Modify AI Model Settings
    • Access Control
      • How-To: Create User Access Token
      • How-To: Modify User Access Token Setting
      • How-To: Remove Token's Assignment
      • How-To: Assign Token to Model
      • How-To: See List of Tokens
    • Resource Management
      • How-To: Start Worker
      • How-To: Stop Worker
      • How-To: Monitor Worker Performance
    • Secure Query Processing
      • How To: Upload Evaluation Key
      • How-To: Encrypt Input Message
      • How To: Execute Query
      • How-To: Decrypt Output Data
      • How-To: Encrypt, Execute, and Decrypt in One Step
    • Account and Finance Operations
      • How-To: View Payment Transaction History
      • How-To: Update Account Information
      • How-To: View Credit Balance and Add Credit to Your Account
      • How-To: Monitor Balance and Usage
  • Demo Tutorials
    • Image Sharpening with LatticaAI Demo Tutorial
    • Sentiment Analysis with LatticaAI Demo Tutorial
    • Health Analysis with LatticaAI Demo Tutorial
    • Digit Recognition with LatticaAI Demo Tutorial
    • Zooming Into Each Step of Demo Run with LatticaAI flow
Powered by GitBook
On this page
  • Overview of the Process
  • Parameters

Was this helpful?

  1. How-To Guides
  2. Secure Query Processing

How To: Upload Evaluation Key

The Evaluation Key (EVK) enables efficient low-latency interactions with a specific AI model. To upload this key, you’ll need a User Access Token provided by the customer for the specific AI model.

This process consists of two parts: generating a key pair (secret and evaluation keys) and publishing the EVK to Lattica’s backend.

Overview of the Process

1

Generate Key Pair:

  • A Secret Key is generated and remains securely in the Query Client. Only the end-user has access to this key, which is later used for encrypting and decrypting messages.

  • An Evaluation Key (EVK) is also generated. This key is used during query processing for validation and secure computations.

2

Publish Evaluation Key:

The generated EVK is uploaded to Lattica’s backend. This ensures the backend is configured for processing encrypted queries for the specified AI model.

The Evaluation Key is generated only once per setup and can be used for ongoing encrypted interactions.

Use the following code snippet to upload an Evaluation Key.

Ensure you have the User Access Token ready, as this token specifies the AI model for which the secret and evaluation keys will be generated.

import lattica_common.app_api as agent_app
​
# Notice your query token expires in 30 days
query_token = "the_query_token_you_got_using_the_generate_user_token"

# user_data is a tuple of: 
# (serialized_context, serialized_secret_key, serialized_homseq)
# which you need for encrypting the query and querying the model
user_data = agent_app.user.query_offline_phase(query_token)
import { LatticaQueryClient } from 'lattica-query-client';

const client = new LatticaQueryClient('your-jwt-query-token');

// Uploaded the EK
const initialized = await client.init();
if (!initialized) {
  console.error('Initialization failed: The EK was not successfully uploaded.');
  throw new Error('EK upload failed.');
}
console.log('EK uploaded successfully.');

Parameters

  • JWT Access Token: A unique identifier created by the AI Provider.

PreviousSecure Query ProcessingNextHow-To: Encrypt Input Message

Last updated 4 months ago

Was this helpful?