Metadata-Version: 2.4
Name: ailoos
Version: 4.5.5
Summary: Unified SDK experience for AILOOS federated AI nodes
Author-email: Empoorio <dev@empoorio.com>
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://github.com/empoorio/ailoos
Project-URL: Bug Tracker, https://github.com/empoorio/ailoos/issues
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: psutil>=5.9.0
Requires-Dist: numpy>=1.21.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: requests>=2.28.0
Requires-Dist: tqdm>=4.64.0
Requires-Dist: structlog>=21.1.0
Requires-Dist: fastapi>=0.104.0
Requires-Dist: uvicorn[standard]>=0.24.0
Requires-Dist: websockets>=12.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: questionary>=2.0.0
Requires-Dist: cryptography>=41.0.0
Requires-Dist: PyJWT>=2.0.0
Requires-Dist: pyotp>=2.9.0
Requires-Dist: qrcode[pil]>=7.4.2
Requires-Dist: passlib[bcrypt]>=1.7.0
Requires-Dist: nest_asyncio>=1.5.0
Requires-Dist: ipfshttpclient>=0.7.0
Requires-Dist: substrate-interface>=1.7.11
Requires-Dist: web3<7.0.0,>=6.20.0
Requires-Dist: py-ecc>=6.0.0
Requires-Dist: sqlalchemy>=1.4.0
Requires-Dist: aiosqlite>=0.20.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: phe>=1.5.0
Requires-Dist: psycopg2-binary>=2.9.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: python-json-logger>=2.0.0
Requires-Dist: python-multipart>=0.0.6
Requires-Dist: duckduckgo-search>=3.9.0
Requires-Dist: prometheus-client>=0.20.0
Requires-Dist: beautifulsoup4>=4.12.0
Requires-Dist: torch>=2.0.0
Requires-Dist: transformers>=4.30.0
Requires-Dist: sentencepiece>=0.1.99
Requires-Dist: lz4>=4.3.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.20.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Dynamic: license-file
Dynamic: requires-python

# AILOOS SDK

AILOOS is a robust Python library for participating in decentralized federated learning networks. This SDK enables nodes to join training sessions, contribute processing power, and interact with the Ailoos ecosystem securely.

## Features

- **Federated Learning**: Participate in distributed model training sessions using FedAvg and other advanced algorithms.
- **Privacy First**: Secure key management and encrypted P2P communication (ECDSA + ECDH).
- **Decentralized Marketplace**: Interact with the data marketplace to list or purchase datasets.
- **Hardware Integration**: Smart capabilities detection for optimal workload assignment.

## Node Roles

AILOOS supports 7 specialized node roles:
1. **Scout**: Lightweight discovery and inference.
2. **Forge**: heavy-duty model training.
3. **Validator**: ZKP verification and auditing.
4. **Aggregator**: Secure model aggregation.
5. **Oracle**: Trusted external data provider.
6. **Archival**: Long-term storage history.
7. **Relay**: Cross-chain bridging.

See [Full Node Roles Documentation](docs/NODE_ROLES.md) for details.

## Network Scales

AILOOS organizes nodes into 5 intelligence scales:
1. **Sovereign (El Átomo)**: 1 Node.
2. **Binary (Binario)**: 2 Nodes. (Small personal networks)
3. **Phalanx (La Escuadra)**: 3-20 Nodes.
4. **Foundry (La Fundición)**: 100-5k Nodes.
5. **Nexus (El Coloso)**: 100k+ Nodes.

## Installation

AILOOS features a modular installation system to ensure high performance even on lightweight nodes:

```bash
# 1. Base Terminal & P2P Networking (For Scouts, Relays, Validators)
pip install ailoos

# 2. Heavy Computational Node (For Forge, requires PyTorch & Deep Learning engines)
pip install "ailoos[forge]"
```

> **Note:** If you intend to train or run local inference via the `ailoos-terminal`, you MUST install the `[forge]` extension.


### Initialize a Node

```python
import asyncio
from ailoos.sdk.node_sdk import NodeSDK

async def main():
    # Initialize the node
    node = NodeSDK(node_id="my-ai-node-01")
    
    # Connect and start participating
    await node.initialize()
    await node.start()
    
    # Keep running
    while True:
        await asyncio.sleep(1)

if __name__ == "__main__":
    asyncio.run(main())
```

### Advanced Usage

For granular control over components:

```python
from ailoos.sdk.advanced_client import create_ailoos_node

async def run_advanced():
    # Create node with specific capabilities
    node = await create_ailoos_node(
        node_id="advanced-node-01",
        enable_marketplace=True,
        enable_federated=True
    )
    
    # Search for datasets
    datasets = await node.search_datasets(query="satellite imagery")
    print(f"Found {len(datasets)} datasets")

    # Join a training session
    await node.join_training_session("session_v1_xyz")
```

## Requirements

- Python 3.8+
- Network connectivity for P2P and Federation

## License
 
Proprietary and Confidential. Copyright © 2026 Empoorio INC. All Rights Reserved. See [LICENSE](LICENSE) for full terms.
