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-modelFrom 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-modelUsing yarn
Or with yarn:
bash
yarn add paitient-secure-modelGlobal CLI Installation
To use the command-line interface:
bash
npm install -g paitient-secure-modelVerify 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=infoFor 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-idSDK Dependencies
Python Dependencies
The Python SDK depends on the following libraries (automatically installed with pip):
requests: For HTTP requestsboto3: For AWS integrationkubernetes: For Kubernetes integrationpydantic: For data validationpycryptodome: For cryptographic operationshuggingface_hub: For model downloadingtransformers: For model inference (optional)torch: For model inference (optional)
Node.js Dependencies
The Node.js SDK depends on:
axios: For HTTP requestsaws-sdk: For AWS integration@kubernetes/client-node: For Kubernetes integrationcommander: For CLI functionalityinquirer: For interactive promptschalk: For colorized outputora: 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.1Using 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
sudofor global installations - Package Lock Conflicts: Try clearing npm cache with
npm cache clean --force
Getting Help
If you encounter issues:
- Check the Troubleshooting Guide
- Visit our GitHub repository
- Contact support at support@paitient.ai
Next Steps
Now that you've installed the SDK, you can:
- Follow the Quick Start Guide
- Explore the Python SDK Documentation
- Explore the Node.js SDK Documentation
- Learn about Authentication