nillion aivm
1.0.0
AIVM은 고급 암호화 프로토콜을 사용한 개인 정보 보호 추론을 위해 설계된 최첨단 프레임 워크입니다. AIVM을 사용하면 로컬 개발 네트워크 (DEVNET)를 배포하여 제공된 예제 또는 사용자 정의 모델을 사용하여 개인 추론을 탐색 할 수 있습니다.
가상 환경 생성 :
python3 -m venv .venv가상 환경 활성화 :
Linux/MacOS :
source .venv/bin/activateWindows에서 :
. v env S cripts a ctivate패키지 설치 :
실행 예제를 실행하려면 실행됩니다.
pip install " nillion-aivm[examples] "그렇지 않으면 자신의 코드를 생성하려는 경우 다음과 같이 할 수 있습니다.
pip install nillion-aivmAIVM Devnet 시작 :
aivm-devnet제공된 Jupyter 노트북 예제/Gettarted.ipynb를 열어 AIVM에서 개인 추론 예제를 실행하십시오.
작업을 완료 한 후 CTRL+C 눌러 DevNet 프로세스를 종료하십시오.
추가 사용법은 AIVM을 사용하여 개인 추론 워크 플로우를 설정하는 방법을 보여주는 예제 폴더를 참조하십시오.
import aivm_client as aic
# List all supported models
available_models = aic . get_supported_models ()
print ( available_models ) import torch
# Create a sample input (e.g., for LeNet5 MNIST)
random_input = torch . randn (( 1 , 1 , 28 , 28 )) # Batch size 1, 1 channel, 28x28 pixels # Encrypt the input
encrypted_input = aic . LeNet5Cryptensor ( random_input ) # Get prediction while maintaining privacy
result = aic . get_prediction ( encrypted_input , "LeNet5MNIST" ) get_prediction function은 aivm-devnet 노드와 함께 보안 계산 프로토콜을 자동으로 처리하여 추론 프로세스 전반에 걸쳐 입력 데이터가 비공개로 유지되도록합니다.
지원되는 아키텍처 (Berttiny 또는 Lenet5)를 따르는 경우 자신의 숙련 된 모델을 AIVM에 배포 할 수 있습니다.
import aivm_client as aic # For BertTiny models
aic . upload_bert_tiny_model ( model_path , "MyCustomBertTiny" )
# For LeNet5 models
aic . upload_lenet5_model ( model_path , "MyCustomLeNet5" ) # For BertTiny models
result = aic . get_prediction ( private_berttiny_input , "MyCustomBertTiny" )
# For LeNet5 models
result = aic . get_prediction ( private_lenet5_input , "MyCustomLeNet5" )이 프로젝트는 MIT 라이센스에 따라 라이센스가 부여됩니다.