Metadata-Version: 2.4
Name: byteshare
Version: 0.0.1
Summary: A lightweight, distributed tensor store for ML inference. The spiritual successor to Apache Plasma, without the Ray dependency.
Project-URL: Homepage, https://github.com/byteshare/byteshare
Project-URL: Documentation, https://github.com/byteshare/byteshare
Project-URL: Repository, https://github.com/byteshare/byteshare
Project-URL: Issues, https://github.com/byteshare/byteshare/issues
Author: ByteShare Contributors
License: Apache-2.0
License-File: LICENSE
Keywords: distributed,inference,machine-learning,object-store,shared-memory,tensor,zero-copy
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: System :: Distributed Computing
Requires-Python: >=3.10
Provides-Extra: all
Requires-Dist: boto3>=1.26; extra == 'all'
Requires-Dist: pyzmq>=25.0; extra == 'all'
Requires-Dist: redis>=4.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1; extra == 'dev'
Provides-Extra: redis
Requires-Dist: redis>=4.0; extra == 'redis'
Provides-Extra: s3
Requires-Dist: boto3>=1.26; extra == 's3'
Provides-Extra: zmq
Requires-Dist: pyzmq>=25.0; extra == 'zmq'
Description-Content-Type: text/markdown

# ByteShare

> 🚀 A lightweight, distributed tensor store for ML inference
> 
> The spiritual successor to Apache Plasma, without the Ray dependency.

[![PyPI version](https://badge.fury.io/py/byteshare.svg)](https://badge.fury.io/py/byteshare)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)

## Why ByteShare?

- **Apache Plasma is dead** - Removed from Arrow 12.0.0 (May 2023)
- **Ray is too heavy** - You just want object sharing, not a full cluster (~150MB)
- **Redis doesn't understand tensors** - Serialization overhead kills performance
- **SharedMemory is local only** - No cross-node support

ByteShare fills this gap: **a lightweight, zero-dependency distributed tensor store**.

## Features

- ✅ **Zero external dependencies** - Pure Python + PyZMQ (optional backends available)
- ✅ **Pass by Reference** - ObjectRef contains only metadata, data transferred on `get()`
- ✅ **Same-node zero-copy** - SharedMemory backend for multi-process sharing
- ✅ **Cross-node efficient transfer** - ZMQ ROUTER/DEALER with connection pooling
- ✅ **Auto lifecycle management** - TTL expiration, optional reference counting
- ✅ **Native Tensor support** - PyTorch, NumPy, with optimal serialization

## Installation

```bash
pip install byteshare

# Optional backends
pip install byteshare[zmq]     # ZMQ transport (recommended for distributed)
pip install byteshare[redis]   # Redis backend
pip install byteshare[s3]      # S3 backend
pip install byteshare[all]     # All optional dependencies
```

## Quick Start

```python
from byteshare import ByteStore, ObjectRef
import torch

# Create a store
store = ByteStore()

# Store a tensor
tensor = torch.randn(1, 16, 125, 96, 96, dtype=torch.float16)
ref: ObjectRef = store.put(tensor, name="embeddings", ttl=120)

# Retrieve it (zero-copy if same process/node)
tensor = store.get(ref)

# Delete when done
store.delete(ref)
```

## Use Cases

- **Disaggregated ML inference** - Share embeddings/latents between pipeline stages
- **Multi-process ML** - Zero-copy tensor sharing between workers
- **Distributed pipelines** - Pass tensors across nodes without serialization pain

## Roadmap

- [ ] v0.1.0 - MVP: ObjectRef, LocalMemory, SharedMemory backends
- [ ] v0.2.0 - Distributed: ZMQ transport, cross-node get
- [ ] v0.3.0 - Production: Async API, Prometheus metrics, disk spill
- [ ] v0.4.0 - Extensions: Redis/S3 backends, UCX RDMA transport

## License

Apache 2.0

## Contributing

Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) first.

