Skip to content

Installation Guide

This guide will help you install and set up the PaiTIENT Secure Model Service SDKs for both Python and Node.js.

Prerequisites

Before installing either SDK, you'll need:

  • An API key from PaiTIENT
  • Your client ID
  • For Python: Python 3.8 or higher
  • For Node.js: Node.js 14 or higher

Python SDK Installation

Using pip

The simplest way to install the Python SDK is using pip:

bash
pip install paitient-secure-model

From Source

You can also install from source:

bash
git clone https://github.com/saulbuilds/secure-model-service.git
cd secure-model-service
pip install -e .

Verify Installation

To verify the installation:

python
from paitient_secure_model import SecureModelClient

# Should print the version of the SDK
print(SecureModelClient.version())

Node.js SDK Installation

Using npm

Install the Node.js SDK using npm:

bash
npm install paitient-secure-model

Using yarn

Or with yarn:

bash
yarn add paitient-secure-model

Global CLI Installation

To use the command-line interface:

bash
npm install -g paitient-secure-model

Verify Installation

Verify the Node.js SDK installation:

javascript
const { SecureModelClient } = require('paitient-secure-model');

// Should print the version of the SDK
console.log(SecureModelClient.version());

Environment Setup

Both SDKs use environment variables for configuration. Set these in your environment:

bash
# API Key and Client ID (required)
export PAITIENT_API_KEY=your-api-key
export PAITIENT_CLIENT_ID=your-client-id

# API Endpoint (optional, defaults to production)
export PAITIENT_ENDPOINT=https://api.paitient.ai

# Logging level (optional, defaults to 'info')
export PAITIENT_LOG_LEVEL=info

For Windows:

powershell
# PowerShell
$env:PAITIENT_API_KEY = "your-api-key"
$env:PAITIENT_CLIENT_ID = "your-client-id"
cmd
# Command Prompt
set PAITIENT_API_KEY=your-api-key
set PAITIENT_CLIENT_ID=your-client-id

SDK Dependencies

Python Dependencies

The Python SDK depends on the following libraries (automatically installed with pip):

  • requests: For HTTP requests
  • boto3: For AWS integration
  • kubernetes: For Kubernetes integration
  • pydantic: For data validation
  • pycryptodome: For cryptographic operations
  • huggingface_hub: For model downloading
  • transformers: For model inference (optional)
  • torch: For model inference (optional)

Node.js Dependencies

The Node.js SDK depends on:

  • axios: For HTTP requests
  • aws-sdk: For AWS integration
  • @kubernetes/client-node: For Kubernetes integration
  • commander: For CLI functionality
  • inquirer: For interactive prompts
  • chalk: For colorized output
  • ora: For spinners and progress indicators

Docker Installation

We also provide Docker images for both SDKs:

bash
# Python SDK
docker pull paitient/secure-model-sdk-python:0.0.1

# Node.js SDK
docker pull paitient/secure-model-sdk-node:0.0.1

Using with Docker:

bash
# Python SDK
docker run -e PAITIENT_API_KEY=your-api-key \
           -e PAITIENT_CLIENT_ID=your-client-id \
           paitient/secure-model-sdk-python:0.0.1 \
           python -c "from paitient_secure_model import SecureModelClient; print(SecureModelClient.version())"

# Node.js SDK
docker run -e PAITIENT_API_KEY=your-api-key \
           -e PAITIENT_CLIENT_ID=your-client-id \
           paitient/secure-model-sdk-node:0.0.1 \
           node -e "const { SecureModelClient } = require('paitient-secure-model'); console.log(SecureModelClient.version())"

Troubleshooting

Common Installation Issues

Python

  • ImportError: Ensure you're using Python 3.8 or higher
  • Dependency Conflicts: Try installing in a virtual environment
  • AWS/Kubernetes Dependencies: Some dependencies may require additional system libraries

Node.js

  • Version Compatibility: Make sure you're using Node.js 14 or higher
  • Global Installation Permission Issues: You may need to use sudo for global installations
  • Package Lock Conflicts: Try clearing npm cache with npm cache clean --force

Getting Help

If you encounter issues:

  1. Check the Troubleshooting Guide
  2. Visit our GitHub repository
  3. Contact support at support@paitient.ai

Next Steps

Now that you've installed the SDK, you can:

Released under the MIT License.