Product

Introducing the OpenGradient SDK

October 21, 2024
3 Min read
Cover image for Introducing the OpenGradient SDK

OpenGradient is excited to introduce the OpenGradient SDK (OG-SDK) & CLI to empower developers to leverage OpenGradient’s decentralized infrastructure for AI/ML model management and verifiable inference. Using the OG-SDK, users can easily store and manage machine learning models on our decentralized filestore and run end-to-end verifiable inference via the OpenGradient blockchain. The OG-SDK allows AI & ML practitioners to utilize the power of Web3 and fuel the fire of transparent, secure, and scalable AI.

Challenges of Centralized AI/ML Workflows

In traditional AI/ML workflows, model management and the compute powering inference are oftentimes completely private and centralized. This inherently raises concerns about data privacy, security, and scalability. As the landscape grows, these concerns will only be amplified, as organizations increasingly rely on the secrecy of highly protected in-house AI platforms. How can we guarantee that private entities will not alter a user's inputs or, even worse, run inference on a completely different model? How can users be certain that the model execution provided by their chosen inference provider is truly what they expect? For instance, could you confidently distinguish the output of ChatGPT-4 and Meta’s Llama 3.2? Users often lack assurances that their inputs are faithfully processed by the exact model they believe they’re using, raising concerns about transparency and trust.

OpenGradient’s Solution

Our solution to address the issues of centralized AI is to leverage decentralized blockchain technology, enabling verifiable AI. This approach offers transparency, security, and trust in AI model execution. The transition to decentralized ecosystems can be challenging for engineers accustomed to Web2 technologies. The complexity of integrating blockchain-based solutions into AI workflows presents a steep learning curve. Those working to further AI should focus exactly on that, building and testing next-generation models.

The OpenGradient SDK addresses these challenges by offering an integrated solution for decentralized AI.

The OG-SDK streamlines model management and fosters community collaboration by leveraging decentralized storage, allowing users to easily upload, download, and document their models. It also serves as a gateway to the OpenGradient decentralized compute network, enabling seamless access to compute nodes for inference execution. This includes the generation of verifiable proofs, which are published to a public data availability layer and verified by the decentralized network—without requiring direct interaction with smart contracts.

By shifting away from centralized compute and integrating a decentralized storage layer, OpenGradient takes a significant step towards realizing the vision of truly decentralized AI. As we look to the future, ensuring that the AI model execution is trustless, verifiable, and democratized becomes more critical than ever.

OG-SDK Is Developer-Friendly

The OG-SDK provides a streamlined developer experience into the world of decentralized model management & execution.

Getting started is as simple as running:

import opengradient
og.init(private_key=<your-private-key>)

The SDK offers two core sets of functionality:

  1. Model Management: Users can create and upload models to our decentralized filestore, making it easy to manage and share models within a decentralized environment.

  2. Verifiable Inference: Developers can trigger inferences on models in the registry using the SDK, powered by OpenGradient's decentralized inference network. This network delivers secure inference results along with cryptographic proofs of valid computation. Our validator nodes automatically verify these proofs behind the scenes, requiring no action from developers. All outputs and proofs are then published to a Data Availability (DA) layer, ensuring full transparency and auditability.

Initially, the SDK supports various inference types for ONNX models and select LLMs backed by the OpenGradient team. As the network grows and decentralizes, anyone will have the opportunity to contribute by adding models or offering compute resources.

The OG-SDK serves as a comprehensive service layer that combines the strengths of IPFS and decentralized compute and verification to enhance the developer experience. By integrating these powerful technologies, the SDK delivers scalable, democratized storage and inference capabilities, enabling developers to easily manage and execute models within a fully decentralized ecosystem.

OpenGradient’s future vision is to expand support for novel model architectures and encompass the broadest range of modeling techniques possible. The OpenGradient team will continue to evolve the OG-SDK, building on its robust model management functions and powerful inference capabilities to deliver the ultimate Web3 AI developer experience.

Start Building

Come try out the OpenGradient SDK today (PyPI)! Upload your own ONNX models, run inference, and see your proof-backed results. Start building with the OG-SDK today!!

Be sure to check for updates regularly by running:

pip install --upgrade opengradient

Learn more at SDK Documentation. sdk Gain more insights at OpenGradient Blog.

Follow us on X and join us on Discord.

Developers - Sign up to gain early access to our solutions.