Skip to main content

RHAPSODY

Build Status Docs Python Version PyPI Version License

RHAPSODY – Runtime for Heterogeneous APplications, Service Orchestration and DYnamism

A unified runtime for executing AI and HPC workloads on supercomputing infrastructures. RHAPSODY seamlessly integrates traditional scientific computing with AI inference, enabling complex workflows that combine simulation, analysis, and machine learning.

What RHAPSODY Offers

  • Unified AI-HPC API: Single interface for compute tasks and AI inference
  • Multi-Backend Execution: Run on local machines, HPC clusters (Dragon), or distributed systems (Dask)
  • Async-First Design: Native asyncio integration for efficient task orchestration
  • Integratable Design: RHAPSODY is designed to be integratable with existing workflows and tools such as AsyncFlow and LangGraph/FlowGentic.
  • Scale-Ready: Scale your workload and workflows to thousands of tasks and nodes.

Quick Example: AI-HPC Workflow

import asyncio
from rhapsody.api import Session, ComputeTask, AITask
from rhapsody.backends import DragonExecutionBackend, DragonVllmInferenceBackend
from rhapsody.backends.ai.config import ModelConfig

async def main():
    # Initialize backends
    hpc_backend = await DragonExecutionBackend(name="hpc")
    ai_backend = await DragonVllmInferenceBackend(
        name="vllm", model=ModelConfig(model_name="HuggingFaceTB/SmolLM2-1.7B-Instruct", hf_token="...", tp_size=1)
    )

    # Create session with multiple backends
    async with Session(backends=[hpc_backend, ai_backend]) as session:

        # HPC simulation task
        simulation = ComputeTask(
            executable="./simulate",
            arguments=["--config", "params.yaml"],
            backend=hpc_backend.name
        )

        # AI analysis task
        analysis = AITask(
            prompt="Analyze the simulation results and identify key patterns...",
            backend=ai_backend.name
        )

        # Submit and execute
        await session.submit_tasks([simulation, analysis])

        # Wait for completion (tasks are awaitable!)
        sim_result = await simulation
        ai_result = await analysis

        print(f"Simulation: {sim_result['stdout']}")
        print(f"AI Analysis: {ai_result['response']}")

asyncio.run(main())

Installation

# Basic installation
pip install rhapsody-py

# With specific backends
pip install rhapsody-py[dask]           # Dask distributed computing
pip install rhapsody-py[dragon]         # Dragon runtime (Python 3.11-3.13)

# Development
pip install rhapsody-py[dev]

Documentation

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for new functionality
  5. Ensure all tests pass (make test-regular)
  6. Run code quality checks (pre-commit run --all-files)
  7. Commit your changes (git commit -m 'Add amazing feature')
  8. Push to the branch (git push origin feature/amazing-feature)
  9. Open a Pull Request

Reporting Issues

Please use the GitHub issue tracker to report bugs or request features.

License

RHAPSODY is licensed under the MIT License.

Acknowledgments

RHAPSODY is a collaborative project between two teams:

See the full Team page for details.

  • AsyncFlow: Asynchronous workflow management

NSF-Funded Project

RHAPSODY is supported by the National Science Foundation (NSF) under Award ID 2103986. This collaborative project aims to advance the state-of-the-art in heterogeneous workflow execution for scientific computing.

Citations

If you use RHAPSODY in your research, please cite:

@software{rhapsody2024,
  title={RHAPSODY: Runtime for Heterogeneous Applications, Service Orchestration and Dynamism},
  author={RADICAL Research Group, Rutgers University and Hewlett Packard Enterprise},
  year={2024},
  url={https://github.com/radical-cybertools/rhapsody},
  version={0.1.0}
}

Support

Metadata

Release files for rhapsody-py 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rhapsody-py 0.8.0
File Size Uploaded Provenance Actions
rhapsody_py-0.8.0.tar.gz 475.6 kB Without provenance Details for rhapsody_py-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rhapsody-py 0.8.0
File Interpreter ABI Platform Actions
rhapsody_py-0.8.0-py3-none-any.whl Python 3 none any Details for rhapsody_py-0.8.0-py3-none-any.whl

Total release size: 666.3 kB

Release files / rhapsody_py-0.8.0.tar.gz

Download URL rhapsody_py-0.8.0.tar.gz
Size 475.6 kB
Tags Source
SHA-256 checksum
How to use checksums
dc9a2d07abed1665f6b009cac37a08e2722ba6d03d41d3b12088b66611f9c19f
BLAKE2b-256 checksum
How to use checksums
c8a0b77196636541b78371fa5e4efc1f28e65b29e39589f50dac7dc066020964
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / rhapsody_py-0.8.0-py3-none-any.whl

Download URL rhapsody_py-0.8.0-py3-none-any.whl
Size 190.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
642701151f81aa41b5ea30aad1e1429abe6fc962b4ee8d8d0939d940c2a260e1
BLAKE2b-256 checksum
How to use checksums
1b7f430b099588134328fe8bae7f4849ab102cdfbfb738bef32dc12dfbf7ece4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Security for rhapsody-py 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page