Dataset Viewer
Auto-converted to Parquet Duplicate
Search is not available for this dataset
image
imagewidth (px)
480
480
YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/datasets-cards)

GarbinAI

A modern AI platform for discovering, managing, and collaborating on Hugging Face models and Spaces. GarbinAI provides a comprehensive marketplace experience with advanced features for model management, community collaboration, and contribution tracking.

๐Ÿ› ๏ธ Tech Stack

Frontend

  • Next.js 15.5 - React framework with App Router and Turbopack
  • React 19 - UI library for building interactive interfaces
  • TypeScript 5 - Type-safe development
  • TailwindCSS 4 - Utility-first CSS framework for styling

Backend

  • Next.js API Routes - Serverless API endpoints
  • NextAuth 5 - Authentication with OAuth integration
  • PostgreSQL - Relational database for data persistence
  • node-postgres (pg) - PostgreSQL client for Node.js

Integrations

  • Hugging Face Hub - AI model and space management
  • MetaMask - Web3 wallet integration for Ethereum
  • Hugging Face OAuth - Seamless user authentication

Development Tools

  • Turbopack - Next-generation bundler for faster builds
  • PostCSS - CSS transformations and processing

๐Ÿš€ Features

Core Functionality

  • Model Marketplace: Browse and discover AI models with advanced filtering and search
  • Spaces Management: Create and manage Hugging Face Spaces with interactive demos
  • File Management: Upload, organize, and track files with accurate commit history
  • Pull Request System: Create, review, and merge contributions through a built-in PR system
  • Discussion Forums: Engage with the community through model discussions and Q&A
  • Contributor Tracking: Track contributions, metrics, and community engagement
  • Commit History: View detailed commit history with accurate timestamps and file associations

Authentication & Integration

  • Hugging Face OAuth: Seamless authentication using Hugging Face accounts
  • MetaMask Integration: Connect Ethereum wallets for Web3 features
  • Permission Management: Granular permission system for repository access

Blockchain & Web3 (Current)

  • MetaMask Wallet Integration: Connect and manage Ethereum wallets directly in the platform
  • Ethereum Mainnet Support: Full support for Ethereum mainnet transactions
  • Wallet State Management: Real-time wallet connection status and account tracking
  • Chain Switching: Programmatic network switching capabilities
  • Auto-Reconnect: Automatic wallet reconnection on page reload

Performance & Caching

  • Intelligent Caching: PostgreSQL-based caching for files, commits, and metadata
  • 90-100% Accuracy: Advanced commit matching algorithms for accurate file timestamps
  • Fast Performance: Optimized queries with indexed database tables

๐Ÿ“‹ Prerequisites

  • Node.js 18+ and npm/yarn/pnpm
  • PostgreSQL database (12+)
  • Hugging Face Account with OAuth app credentials
  • MetaMask (optional, for wallet features)

๐Ÿ› ๏ธ Installation

1. Clone the Repository

git clone <repository-url>
cd garbin-ai

2. Install Dependencies

npm install
# or
yarn install
# or
pnpm install

3. Set Up Environment Variables

Create a .env.local file in the root directory:

# Database
DATABASE_URL=postgresql://user:password@localhost:5432/garbin_ai

# Hugging Face OAuth
HUGGINGFACE_CLIENT_ID=your_client_id
HUGGINGFACE_CLIENT_SECRET=your_client_secret

# NextAuth
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_secret_key

# Optional: MetaMask
NEXT_PUBLIC_CHAIN_ID=1

4. Set Up Database

Run the database schema migration:

psql $DATABASE_URL -f database_tables.sql

This creates all necessary tables including:

  • User authentication and sessions
  • Model and space metadata
  • File and commit caching
  • Pull requests and discussions
  • Contributor metrics

5. Run Development Server

npm run dev
# or
yarn dev
# or
pnpm dev

Open http://localhost:3000 in your browser.

๐Ÿ“ Project Structure

garbin-ai/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/                    # Next.js App Router pages
โ”‚   โ”‚   โ”œโ”€โ”€ api/               # API routes
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ auth/          # Authentication endpoints
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ models/        # Model management APIs
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ spaces/        # Space management APIs
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ upload/        # File upload endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ models/            # Model pages
โ”‚   โ”‚   โ”œโ”€โ”€ spaces/            # Space pages
โ”‚   โ”‚   โ””โ”€โ”€ upload/            # Upload pages
โ”‚   โ”œโ”€โ”€ components/            # React components
โ”‚   โ”œโ”€โ”€ lib/                   # Utility libraries
โ”‚   โ”‚   โ”œโ”€โ”€ db.ts             # Database utilities
โ”‚   โ”‚   โ”œโ”€โ”€ huggingface.ts    # Hugging Face API client
โ”‚   โ”‚   โ”œโ”€โ”€ metamask.ts       # MetaMask integration
โ”‚   โ”‚   โ””โ”€โ”€ spaces.ts          # Space utilities
โ”‚   โ””โ”€โ”€ types/                # TypeScript type definitions
โ”œโ”€โ”€ database_tables.sql        # Database schema
โ”œโ”€โ”€ scripts/                   # Utility scripts
โ””โ”€โ”€ public/                    # Static assets

๐Ÿ”ง Configuration

Hugging Face OAuth Setup

  1. Go to Hugging Face Settings
  2. Create a new OAuth application
  3. Set redirect URI to: http://localhost:3000/api/auth/callback/huggingface
  4. Copy Client ID and Secret to your .env.local

Database Configuration

The application uses PostgreSQL with the following key tables:

  • users: User accounts and authentication
  • platform_models: Registered models metadata
  • platform_spaces: Registered spaces metadata
  • model_files: Cached file metadata
  • model_commits: Cached commit history
  • model_pull_requests: PR tracking
  • contributor_metrics: Contribution statistics

See database_tables.sql for the complete schema.

๐ŸŽฏ Usage

Creating a Model

  1. Sign in with your Hugging Face account
  2. Navigate to "Create Model" or visit /upload
  3. Fill in model details (name, description, type, license)
  4. Upload files or connect to existing Hugging Face repository
  5. Your model will be registered and appear in the marketplace

Importing from Hugging Face

  1. Go to "Import Models" or visit /models/import
  2. Enter the Hugging Face model ID (e.g., username/model-name)
  3. The model will be synced and added to your dashboard

Contributing to Models

  1. Navigate to a model page
  2. Click "Contribute" โ†’ "Create Pull Request"
  3. Upload your changes
  4. Create a PR with description
  5. Model owners can review and merge contributions

Managing Spaces

  1. Create a new Space at /spaces/create
  2. Configure SDK (Gradio, Streamlit, etc.)
  3. Upload files and deploy
  4. Share your interactive demo with the community

๐Ÿ” API Endpoints

Models

  • GET /api/models - List all models
  • GET /api/models/[id] - Get model details
  • POST /api/models/register - Register a new model
  • GET /api/models/[id]/files - Get model files
  • GET /api/models/[id]/commits - Get commit history
  • GET /api/models/[id]/prs - List pull requests
  • POST /api/models/[id]/sync - Sync model data

Spaces

  • GET /api/spaces - List all spaces
  • GET /api/spaces/[id] - Get space details
  • POST /api/spaces/create - Create a new space
  • POST /api/spaces/[id]/upload - Upload files to space
  • GET /api/spaces/[id]/prs - List pull requests

Authentication

  • GET /api/auth/signin - Sign in page
  • GET /api/auth/callback/huggingface - OAuth callback

๐Ÿงช Development

Running Tests

npm run test

Building for Production

npm run build
npm start

Database Migrations

When updating the schema:

psql $DATABASE_URL -f database_tables.sql

๐Ÿ› Troubleshooting

Database Connection Issues

Ensure your PostgreSQL database is running and DATABASE_URL is correctly set:

psql $DATABASE_URL -c "SELECT 1"

OAuth Authentication Fails

  1. Verify HUGGINGFACE_CLIENT_ID and HUGGINGFACE_CLIENT_SECRET are correct
  2. Check redirect URI matches your OAuth app settings
  3. Ensure NEXTAUTH_URL matches your deployment URL

File Upload Issues

  • Check file size limits (configured in API routes)
  • Verify Hugging Face API token has write permissions
  • Review browser console for error messages

Cache Not Updating

Force refresh the cache:

curl -X POST http://localhost:3000/api/models/{modelId}/sync

๐Ÿ”ฎ Roadmap & Future Features

Blockchain & Fair-Pay System (Coming Soon)

GarbinAI is building a comprehensive blockchain-enabled fair-pay system for the AI supply chain. This will revolutionize how contributors are rewarded for their work.

Smart Contract Infrastructure

  • Asset Registry: Tokenize datasets and models as NFTs/ERC-1155 tokens with off-chain storage pointers (IPFS/Filecoin/Arweave)
  • Provenance Graph: On-chain weighted graph tracking contribution percentages and asset lineage
  • Royalty Split Contracts: Automatic revenue distribution to all contributors via smart contracts
  • License Enforcement: Smart contract-based licensing with usage gates before compute access
  • Escrow & Arbitration: Dispute resolution system with escrow contracts for fair settlements

Fair-Pay Features

  • Pay-on-Use Model: Automatic revenue splits triggered by real usage (training/inference)
  • Usage Metering: AI Factory gateway signs usage receipts for transparent billing
  • Multi-Stakeholder Payouts: Reward data owners, annotators, curators, model designers, trainers, and GPU providers
  • Stablecoin Payments: Automatic distribution in stablecoins for global accessibility
  • Immutable Receipts: Blockchain-verified usage records and payment history

Contributor Features

  • Wallet-Linked Profiles: Connect contributor identities to blockchain wallets
  • Reputation System: On-chain reputation tracking based on contribution quality
  • Task Receipts: Mint lightweight NFTs/records for each labeled batch or contribution
  • Transparent Payouts: Real-time visibility into earnings and payment history
  • KYC Integration: Optional KYC at withdrawal thresholds for compliance

Cross-Chain Support

  • Multi-Chain Architecture: Support for BSC, Polygon, Arbitrum, and Ethereum
  • Chain-Agnostic Design: Flexible architecture allowing easy addition of new chains
  • Low-Cost Transactions: Optimized for micro-payouts with low gas fees

Enterprise & Compliance

  • License Templates: OpenRAIL-style and custom licensing with commercial terms
  • Usage Analytics: Privacy-preserving metrics with optional ZK attestations
  • Regulatory Compliance: Built-in support for KYC/AML at withdrawal points
  • Audit Trails: Complete on-chain audit trail for all transactions and payouts

Additional Planned Features

  • Streaming Payouts: Real-time payments during long training runs
  • DAO Governance: Reputation-weighted curation DAO for dataset/model approvals
  • Privacy-Preserving Metrics: TEEs or ZK attestations for usage tracking
  • Enterprise SSO: Single Sign-On integration for enterprise customers
  • Custom Invoicing: Enterprise billing and invoice generation

Note: These features are in active development. See the Proposal & Feasibility Report for detailed technical specifications.

๐Ÿ“š Documentation

๐Ÿ›ก๏ธ Security

  • OAuth tokens are securely stored in the database
  • Access tokens are encrypted and never exposed to the client
  • User permissions are validated on every API request
  • SQL injection protection via parameterized queries
  • CORS and CSRF protection via NextAuth

๐Ÿค Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

This project is private and proprietary.

๐Ÿ”— Blockchain Integration

Using MetaMask

The platform includes built-in MetaMask integration for Web3 features:

import { createMetaMaskManager } from '@/lib/metamask';

const wallet = createMetaMaskManager({
  enforceChainId: 1, // Ethereum mainnet
  autoReconnect: true,
});

// Connect wallet
await wallet.connect();

// Get current state
const state = wallet.getState();
console.log(state.accounts, state.chainId);

// Switch networks
await wallet.switchChain(137); // Polygon

// Disconnect
wallet.disconnect();

Wallet Status

The platform displays wallet connection status on the dashboard, showing:

  • Connection state (connected/idle/unavailable)
  • Connected account address
  • Current network/chain ID
  • Auto-reconnection status

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support

For issues and questions:


Made with โค๏ธ for the AI community

Downloads last month
396