Metadata-Version: 2.4
Name: fusera
Version: 0.2.0
Summary: Submit PyTorch models for cloud compilation
Author: Fusera Team
Author-email: Fusera Team <team@fusera.dev>
License: MIT
Project-URL: Homepage, https://fusera.dev
Project-URL: Documentation, https://docs.fusera.dev
Project-URL: Source, https://github.com/fusera/fusera-sdk
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
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-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: torch>=2.5.0
Requires-Dist: requests>=2.25.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: mypy>=1.5.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Dynamic: author
Dynamic: requires-python

# Fusera SDK

Submit PyTorch models for cloud compilation with a single line of code.

## Installation

### From PyPI (Coming Soon)
```bash
pip install fusera
```

### From Source
```bash
pip install git+https://github.com/fusera/fusera-sdk.git
```

### Development Installation
```bash
git clone https://github.com/fusera/fusera-sdk.git
cd fusera-sdk
pip install -e .
```

## Quick Start

```python
import fusera
import torch.nn as nn
from dotenv import load_dotenv

# This line looks for a .env file and loads the variables from it
load_dotenv()

# Define your model
model = nn.Sequential(
    nn.Linear(10, 100),
    nn.ReLU(),
    nn.Linear(100, 10)
)

# Submit for compilation
result = fusera.compile(model)
print(result['message'])
# Output: ✓ Model submitted! Track progress at: https://fusera.dev/jobs/job_123...
```

## Configuration

The SDK uses these environment variables (configured in `.env`):

```bash
FUSERA_API_URL=http://your-backend-url:8000    # Backend API endpoint
FUSERA_API_KEY=fus_your_key_here               # Your API key
FUSERA_DEV_MODE=false                          # Set to true for local testing
```

## API Reference

### `fusera.compile(model, **kwargs)`

Submit a PyTorch model for cloud compilation.

**Parameters:**
- `model` (torch.nn.Module): The PyTorch model to compile
- `**kwargs`: Additional compilation options

**Returns:**
- `dict`: Response containing job ID and tracking URL

**Example:**
```python
import fusera
import torch.nn as nn

model = nn.Sequential(
    nn.Linear(10, 100),
    nn.ReLU(),
    nn.Linear(100, 10)
)

result = fusera.compile(model)
print(result['job_id'])  # job_abc123...
print(result['dashboard_url'])  # https://fusera.dev/jobs/job_abc123...
```

### Exceptions

- `FuseraError`: Base exception for all Fusera SDK errors
- `AuthenticationError`: Invalid or missing API key
- `CompilationError`: Model compilation failed
- `NetworkError`: Network connection issues

## Development

To contribute to the SDK:

```bash
# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Type checking
mypy fusera

# Linting
ruff check fusera

# Format code
ruff format fusera
```

## License

MIT License - see LICENSE file for details.
