Welcome to DeCentraChat Your one-stop decentralized platform for AI-powered model inferences. With 0gLab's serving layer, experience seamless querying of AI models while leveraging decentralized infrastructure for reduced latency through multiple GPU service providers.
- 0g Serving User Broker: Enables decentralized AI model inferences by interacting with multiple GPU service providers.
- 0g Storage SDK: Facilitates secure and decentralized storage of chat conversations and data.
- Solidity: Smart contract language used for storing and retrieving root hashes on the blockchain.
- Wagmi and Viem: Provides React hooks and Ethereum utilities for seamless blockchain integration.
- Next.js: Framework used for building the frontend and server-side rendering for optimal performance.
- Stateful models-By default,the models in the 0g marketplace are stateless,meaning they are non-contextual. But with the help of 0g Storage,we solve this issue by saving the conversations in a decentralized way. This helps in users to access their old chats and backup their new ones.
- View the tutorial here - https://youtu.be/YmOJdSoBU6Y
- Validate responses - Validate the responses with the help of the 0g sdk,which depends on the validity of the service provider and how the response was generated.This is denoted by a small check mark,near the response
To view the project in action,visit https://decentrachat.vercel.app/ (This needs users to execute the below program in their local machine for each request they send)
https://github.com/Raaghav-m/Decentrachat-helper
To get multiple requests,execute the below steps to get the code in your local system
- Clone the Repository:
git clone https://github.com/Raaghav-m/DeCentraChat cd DeCentraChat - Install Dependencies:
npm install
- Start the Local Server:
Access the Application: Open your browser and navigate to http://localhost:3000. Ensure you have Metamask installed for blockchain interactions.
npm run dev
Key Features
- Contextual AI: Transform stateless AI models into contextual AI by leveraging advanced prompt engineering techniques.
- Conversation Backup: Use 0g storage to securely store your chat history, allowing you to continue conversations where you left off.
- Smart Contract Integration: Efficiently store and retrieve root hashes of conversations for enhanced transparency and quick access.
- Model Selection: Choose from a range of AI models tailored to your use case, all at an affordable cost.
Security and Privacy
- Data is securely stored on decentralized nodes using 0g storage.
- Root hashes are stored on the blockchain, ensuring tamper-proof and transparent backups.
- User credentials and sensitive data are never stored or shared.
Usage Examples
-
Connect Wallet: Open the application and click "Connect Wallet." Authenticate using Metamask to link your Ethereum address.
-
Choose an AI Model: Browse through a curated list of AI models, each designed for specific use cases (e.g., NLP, image generation, etc.).
-
Create account Create an account associated with the provider and deposit funds.
-
Send a Prompt: Enter your query or command in the chatbox and let the selected AI model respond.
-
Backup Conversations: Store your chat history securely on 0g storage by clicking "Backup." Root hashes are generated and stored on the blockchain for future retrieval.
-
Retrieve Conversations: Retrieve your chat history from the blockchain by clicking "Retrieve."





