Metadata-Version: 2.3
Name: commai
Version: 0.0.1
Summary: Gobal toolbox that allows you to connect, and verify your tools
License: MIT
Keywords: toolbox,verification,tools,global,machine learning,prompt,Artificial Intelligence,Large Language Models
Author: commune ai organization
Author-email: contact@communeai.org
Requires-Python: >=3.9,<=3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: PyNaCl (>=1.5.0,<2.0.0)
Requires-Dist: aiofiles
Requires-Dist: aiohttp
Requires-Dist: asyncio
Requires-Dist: base58 (>=1.0.3)
Requires-Dist: certifi (>=2019.3.9)
Requires-Dist: ecdsa (>=0.17.0)
Requires-Dist: eth-keys (>=0.2.1)
Requires-Dist: eth_utils (>=1.3.0)
Requires-Dist: fastapi (==0.115.8)
Requires-Dist: idna (>=2.1.0)
Requires-Dist: loguru
Requires-Dist: msgpack_numpy
Requires-Dist: munch
Requires-Dist: nest_asyncio
Requires-Dist: netaddr
Requires-Dist: openai
Requires-Dist: pandas
Requires-Dist: paramiko
Requires-Dist: psutil
Requires-Dist: py-bip39-bindings (>=0.1.9)
Requires-Dist: py-ed25519-zebra-bindings (>=1.0)
Requires-Dist: py-sr25519-bindings (>=0.2.0)
Requires-Dist: pycryptodome (>=3.11.0)
Requires-Dist: pytest
Requires-Dist: pyyaml
Requires-Dist: requests (>=2.21.0)
Requires-Dist: retry
Requires-Dist: safetensors
Requires-Dist: scalecodec (>=1.2.10,<1.3)
Requires-Dist: sse-starlette
Requires-Dist: torch
Requires-Dist: twine
Requires-Dist: typer
Requires-Dist: uvicorn
Requires-Dist: websocket-client (>=0.57.0)
Requires-Dist: xxhash (>=1.3.0)
Project-URL: Homepage, https://communeai.org/
Project-URL: Repository, https://github.com/commune-ai/commune
Description-Content-Type: text/markdown

<p align="center">
 <img src="https://raw.githubusercontent.com/commune-ai/commune/refs/heads/main/.github/assets/logo-asci.svg" width="490" height="60" alt="Commune AI" style="max-width: 100%;">
</p>

# Commune: Modular Consensus System

Commune AI provides a powerful framework for building distributed AI applications with modular consensus mechanisms. The system enables seamless integration of AI models, distributed computing, and blockchain technology.

## Features

These components can be applied to:

* 🔗 **Networks** - Create and manage distributed networks with custom consensus mechanisms
* 🤖 **AI Models** - Deploy and serve AI models in a distributed environment
* 💫 **Modules** - Build modular components that can be composed into larger systems
* 🔑 **Keys** - Manage cryptographic keys and identities securely
* 🖥️ **Servers** - Deploy and monitor distributed services
* ✨ **Validation** - Implement custom validation rules and scoring mechanisms

## Quick Tour

To immediately start using Commune, you can create and serve a module with just a few lines of code:

```python
import commune as c

# Create a simple module
class MyModule(c.Module):
    def __init__(self, param1=1):
        self.set_config(locals())
        
    def forward(self, x):
        return x * self.param1

# Serve the module
module = c.serve('MyModule')
```

Basic CLI usage:

```bash
# Create a new module
>>>c new_module my_module

# Serve a module
>>>c serve my_module

# Call a module function
>>>c call my_module/forward 10
```

## Installation

### With pip

```bash
pip install commune
```

### From source

```bash
git clone https://github.com/commune-ai/commune.git
cd commune
pip install -e .
```

### From pypi

```bash
pip install commune
```

### Development setup

```bash
chmod +x ./run/***
sudo ./run/install.sh  # Install development environment
```

## Core Components

### 1. Module System
Modules are the building blocks of Commune applications:

```python
import commune as c

class CustomModule(c.Module):
    def __init__(self, config=None):
        self.set_config(config)
    
    def process(self, data):
        return self.model(data)
```

### 2. Network Management
Create and manage distributed networks:

```python
# Start a local network
c.serve('mymodule', network='local')

# Join a subnet
c.serve('mymodule', network='subspace', netuid=0)
```

### 3. Validation System
Implement custom validation rules:

```python
class Validator(c.Module):
    def validate(self, module):
        score = self.evaluate_performance(module)
        return score
```

## CLI Reference

Commune provides an intuitive CLI interface:

```bash
# Module operations
c new_module <name>        # Create new module
c serve <module>           # Serve module
c call <module>/<function> # Call module function
c modules                  # List modules

# Key management
c add_key <name>          # Generate new key
c keys                    # List keys
c sign <message>          # Sign message

# Server management
c servers                 # List servers
c connect <module>        # Connect to server
c logs <module>           # View logs
```

## Why Commune?

1. **Modular Design**:
   - Build complex systems from simple components
   - Easy-to-use module system
   - Flexible composition of services

2. **Distributed Computing**:
   - Scale across multiple nodes
   - Built-in consensus mechanisms
   - Robust networking layer

3. **AI Integration**:
   - Deploy AI models as services
   - Distributed training support
   - Model validation and scoring

4. **Security**:
   - Built-in key management
   - Secure communication
   - Validation mechanisms

## Contributing

We welcome contributions! Please see our [Contributing Guide](https://github.com/commune-ai/commune/blob/main/CONTRIBUTING.md) for details.

## License

[MIT License](https://github.com/commune-ai/commune/blob/main/LICENCE)
