Orbyte is a platform that allows users to rent out their idle GPUs for running GenAI workloads, while others can submit tasks to be executed on the network. Payments are handled using a mock cryptocurrency system.
- GPU Registration: Users can register their GPUs with specifications and pricing
- Task Submission: Submit AI/ML tasks to be executed on available GPUs
- Payment System: Mock cryptocurrency payments for GPU usage
- User Authentication: Secure user registration and authentication
- Task Management: Track and manage your submitted tasks
- GPU Management: Monitor and manage your registered GPUs
- Backend: Python with FastAPI
- Database: SQLite (with SQLAlchemy ORM)
- Authentication: JWT (JSON Web Tokens)
- Frontend: Typescript + Svelte + TailwindCSS
- Containerization: Docker (To be implemented)
- Python 3.11
- pip (Python package manager)
- Node.js 18+ (includes npm)
- pnpm (recommended) or npm
-
Clone the repository
git clone https://github.com/nMaroulis/orbyte.git cd orbyte
-
Set up a virtual environment (recommended)
python3.11 -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
-
Install dependencies
cd backend pip install -r requirements.txt
-
Set up environment variables Create a
.env
file in thebackend
directory with the following content:SECRET_KEY=your-secret-key-here DATABASE_URL=sqlite:///./orbyte.db ACCESS_TOKEN_EXPIRE_MINUTES=10080 # 7 days
-
Start the backend server
# From the project root ./run.sh
-
Access the API documentation
- Open your browser and go to: http://localhost:8000/api/docs
- This will show the interactive Swagger/OpenAPI documentation
-
Install frontend dependencies
# From the project root cd frontend pnpm install # or npm install if not using pnpm
-
Set up environment variables Create a
.env
file in thefrontend
directory with:VITE_API_BASE_URL=http://localhost:8000/api
-
Start the development server
pnpm dev # or npm run dev
- The frontend will be available at: http://localhost:5173
- The page will reload when you make changes
-
Build for production
pnpm build # or npm run build pnpm preview # to preview the production build
- Framework: Svelte 4
- Language: TypeScript 5
- Styling: TailwindCSS 3
- State Management: Svelte stores
- HTTP Client: Built-in fetch API with custom wrapper
- Form Handling: HTML5 form validation with custom components
- Routing: SvelteKit file-based routing
dev
: Start development serverbuild
: Build for productionpreview
: Preview production buildcheck
: Run type checkingcheck:watch
: Run type checking in watch modelint
: Run ESLintformat
: Format code with Prettier
POST /api/auth/register
- Register a new userPOST /api/auth/token
- Login and get access tokenGET /api/auth/me
- Get current user details
GET /api/gpus/
- List all available GPUsPOST /api/gpus/
- Register a new GPUGET /api/gpus/{gpu_id}
- Get GPU detailsPUT /api/gpus/{gpu_id}
- Update GPU detailsDELETE /api/gpus/{gpu_id}
- Delete a GPU
GET /api/tasks/
- List all tasksPOST /api/tasks/
- Submit a new taskGET /api/tasks/{task_id}
- Get task detailsPOST /api/tasks/{task_id}/cancel
- Cancel a task
GET /api/payments/
- List all paymentsGET /api/payments/sent
- List sent paymentsGET /api/payments/received
- List received paymentsGET /api/payments/{payment_id}
- Get payment detailsPOST /api/payments/{task_id}/pay
- Create a payment for a task
orbyte/
├── backend/ # Backend application
│ ├── core/ # Core functionality
│ ├── models/ # Database models
│ └── ...
│
├── frontend/ # Frontend application
│ ├── src/
│ │ ├── lib/ # Shared utilities and components
│ │ ├── routes/ # Application routes (pages)
│ │ ├── app.css # Global styles
│ │ └── app.html # Main HTML template
│ ├── static/ # Static assets
│ ├── .env # Frontend environment variables
│ ├── package.json # Dependencies and scripts
│ └── ...
│
└── ...
│ ├── routers/ # API routes
│ ├── schemas/ # Pydantic models
│ ├── services/ # Business logic
│ ├── database.py # Database configuration
│ ├── init_db.py # Database initialization
│ ├── main.py # FastAPI application
│ └── requirements.txt # Python dependencies
└── README.md # This file
pytest
This project uses black
for code formatting and isort
for import sorting.
pip install black isort
black .
isort .
This project is licensed under the MIT License - see the LICENSE file for details.
- Implement a real blockchain payment system
- Add more sophisticated GPU scheduling and load balancing
- Implement user roles and permissions
- Add more comprehensive tests
- Implement a React frontend
- Add Docker support for easy deployment
- Implement WebSocket for real-time updates
- Add monitoring and logging
- Implement rate limiting and API keys
Contributions are welcome! Please feel free to submit a Pull Request.