Skip to main content

Submit PyTorch models for cloud compilation

Project description

Fusera SDK

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

Installation

From PyPI (Coming Soon)

pip install fusera

From Source

pip install git+https://github.com/fusera/fusera-sdk.git

Development Installation

git clone https://github.com/fusera/fusera-sdk.git
cd fusera-sdk
pip install -e .

Quick Start

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):

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:

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:

# 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fusera-0.2.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fusera-0.2.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file fusera-0.2.0.tar.gz.

File metadata

  • Download URL: fusera-0.2.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for fusera-0.2.0.tar.gz
Algorithm Hash digest
SHA256 948b921b60c36cd03d119462c6103b1759df72e9d9f8e99233bc0ab95d182fe6
MD5 c6553888f529ff79ee412cb6abae3466
BLAKE2b-256 68f68507900171c4b47390888cc798dab4d87683e23eb007073a5969d8364802

See more details on using hashes here.

File details

Details for the file fusera-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fusera-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for fusera-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db2da84cc12e4b1a1f1bda6aa050fa900a5b5ef1bc113dc6fed9cc33540544a6
MD5 7f7cbcc3add918aed9d321bd6701d22b
BLAKE2b-256 c73762ae54a289bee203ddc10676f90633bc0f7454c5f99a0c132d0f0c882db3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page