hypernodes


Namehypernodes JSON
Version 0.1.9 PyPI version JSON
download
home_pagehttps://github.com/gilad-rubin/hypernodes
SummaryDS & AI Tools & Templates for Binding Hamilton with Hypster together
upload_time2024-10-09 06:43:57
maintainerNone
docs_urlNone
authorGillad Rubin
requires_python<4.0,>=3.10
licenseMIT
keywords template ai ds hypernodes
VCS
bugtrack_url
requirements hypster sf-hamilton graphviz
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center"><picture>
  <source media="(prefers-color-scheme: dark)" srcset="assets/dark_background_logo.svg">
  <img alt="hypernodes" src="assets/light_background_logo.svg" width=700">
</picture></div>

<p align="center">
  <a href="#installation">[Installation]</a> |
  <a href="#quick-start">[Quick Start]</a> |
  <a href="#license">[License]</a>
</p>

**`hypernodes`** is a lightweight Python package designed to bind together Hamilton DAGs and Hypster configurations to create modular, extensible and highly optimized AI workflows.

```{warning}
This package is currently in active development and should not be used in production environments.
```

## Installation

Install hypernodes using pip:

```bash
pip install hypernodes
```

## Quick Start

Here's a simple example of how to use hypernodes:

```python
from hypernodes import NodeRegistry
registry = NodeRegistry.initialize()

# Create or get a HyperNode
node = registry.create_or_get("example_node")

# Define Hypster configuration

from hypster import HP, config

@config
def my_config(hp: HP):
  data_path = hp.text_input("data")
  env = hp.select(["dev", "prod"], default="dev")
  llm_model = hp.select({"haiku": "claude-3-haiku-20240307",
                         "sonnet": "claude-3-5-sonnet-20240620"}, default="haiku")

# Save Hypster configuration
node.save_hypster_config(my_config)

# Define Hamilton DAG
def query(llm_model: str) -> str:
  return f"Querying {llm_model}..."

# Save Hamilton DAG
node.save_dag(dag)

# Load and execute
node = registry.load("example_node")
node.instantiate(selections={"llm_model": "sonnet"},
                 overrides={"data_path": "data_folder"})

results = node.execute()
print(results) # {'query': 'Querying claude-3-5-sonnet-20240620...'}
```

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/gilad-rubin/hypernodes",
    "name": "hypernodes",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "template, ai, ds, hypernodes",
    "author": "Gillad Rubin",
    "author_email": "gilad.rubin@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/66/c8/56e87a25f1ca808c936c5e02709f537232efdd113ceb6f6d82d1c6cfd560/hypernodes-0.1.9.tar.gz",
    "platform": null,
    "description": "<div align=\"center\"><picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"assets/dark_background_logo.svg\">\n  <img alt=\"hypernodes\" src=\"assets/light_background_logo.svg\" width=700\">\n</picture></div>\n\n<p align=\"center\">\n  <a href=\"#installation\">[Installation]</a> |\n  <a href=\"#quick-start\">[Quick Start]</a> |\n  <a href=\"#license\">[License]</a>\n</p>\n\n**`hypernodes`** is a lightweight Python package designed to bind together Hamilton DAGs and Hypster configurations to create modular, extensible and highly optimized AI workflows.\n\n```{warning}\nThis package is currently in active development and should not be used in production environments.\n```\n\n## Installation\n\nInstall hypernodes using pip:\n\n```bash\npip install hypernodes\n```\n\n## Quick Start\n\nHere's a simple example of how to use hypernodes:\n\n```python\nfrom hypernodes import NodeRegistry\nregistry = NodeRegistry.initialize()\n\n# Create or get a HyperNode\nnode = registry.create_or_get(\"example_node\")\n\n# Define Hypster configuration\n\nfrom hypster import HP, config\n\n@config\ndef my_config(hp: HP):\n  data_path = hp.text_input(\"data\")\n  env = hp.select([\"dev\", \"prod\"], default=\"dev\")\n  llm_model = hp.select({\"haiku\": \"claude-3-haiku-20240307\",\n                         \"sonnet\": \"claude-3-5-sonnet-20240620\"}, default=\"haiku\")\n\n# Save Hypster configuration\nnode.save_hypster_config(my_config)\n\n# Define Hamilton DAG\ndef query(llm_model: str) -> str:\n  return f\"Querying {llm_model}...\"\n\n# Save Hamilton DAG\nnode.save_dag(dag)\n\n# Load and execute\nnode = registry.load(\"example_node\")\nnode.instantiate(selections={\"llm_model\": \"sonnet\"},\n                 overrides={\"data_path\": \"data_folder\"})\n\nresults = node.execute()\nprint(results) # {'query': 'Querying claude-3-5-sonnet-20240620...'}\n```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "DS & AI Tools & Templates for Binding Hamilton with Hypster together",
    "version": "0.1.9",
    "project_urls": {
        "Homepage": "https://github.com/gilad-rubin/hypernodes",
        "Repository": "https://github.com/gilad-rubin/hypernodes"
    },
    "split_keywords": [
        "template",
        " ai",
        " ds",
        " hypernodes"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9cd6c640ce31fd1d8f5d458cf066eede179c8dc1c155cf6b1ec8e1898c8c2a48",
                "md5": "27a9d9d50f0f380bc92496693045f045",
                "sha256": "f598245ee756dd557d4c73573301cc561d2726d2fdb6f9baef83d551d75f501a"
            },
            "downloads": -1,
            "filename": "hypernodes-0.1.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "27a9d9d50f0f380bc92496693045f045",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 13015,
            "upload_time": "2024-10-09T06:43:56",
            "upload_time_iso_8601": "2024-10-09T06:43:56.164234Z",
            "url": "https://files.pythonhosted.org/packages/9c/d6/c640ce31fd1d8f5d458cf066eede179c8dc1c155cf6b1ec8e1898c8c2a48/hypernodes-0.1.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "66c856e87a25f1ca808c936c5e02709f537232efdd113ceb6f6d82d1c6cfd560",
                "md5": "86394ddb0fa0e6b864b9d9305857324e",
                "sha256": "ddb819911978b1650168ef275914413e0cdd449b9b78d75dd43f4d20be667527"
            },
            "downloads": -1,
            "filename": "hypernodes-0.1.9.tar.gz",
            "has_sig": false,
            "md5_digest": "86394ddb0fa0e6b864b9d9305857324e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 11900,
            "upload_time": "2024-10-09T06:43:57",
            "upload_time_iso_8601": "2024-10-09T06:43:57.895343Z",
            "url": "https://files.pythonhosted.org/packages/66/c8/56e87a25f1ca808c936c5e02709f537232efdd113ceb6f6d82d1c6cfd560/hypernodes-0.1.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-09 06:43:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gilad-rubin",
    "github_project": "hypernodes",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "hypster",
            "specs": []
        },
        {
            "name": "sf-hamilton",
            "specs": []
        },
        {
            "name": "graphviz",
            "specs": []
        }
    ],
    "lcname": "hypernodes"
}
        
Elapsed time: 0.39061s