Skip to main content

BalanceAI Wrapper SDK

Goal

BalanceAI Wrapper enables connection of AI models (API endpoints to AI models) to the BalanceAI blockchain. Wrapper is a Python utility (command-line tools and libraries) that wraps API calls from locally run model APIs, exposing them to BalanceAI users. It provides security by validating requests from authenticated users, checking authorization, and storing information about requests/responses on-chain and in the InterPlanetary File System (IPFS).

BalanceAI Wrapper SDK allows to run BalanceAI Model(s) Node and participate in the BalanceAI Grants Programme

Architecture

image

Functionality

  • Wraps API calls from locally run API
  • Redirects API response to caller (Balance AI Client library)
  • Checks on-chain information about the caller (via caller address sent in payload)
  • Checks if the caller is authorised (the user meets model access criteria). Checks are done calling on-chain function
  • Stores usage information on-chain - payment info, calls (as hashed data)
  • Stores requests/responses in IPFS
  • Includes BAI wallet for signing