Skip to main content

DS & AI Tools & Templates for Binding Hamilton with Hypster together

Project description

hypernodes

[Installation] | [Quick Start] | [License]

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

This package is currently in active development and should not be used in production environments.

Installation

Install hypernodes using pip:

pip install hypernodes

Quick Start

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

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

hypernodes-0.1.9.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

hypernodes-0.1.9-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file hypernodes-0.1.9.tar.gz.

File metadata

  • Download URL: hypernodes-0.1.9.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Darwin/23.6.0

File hashes

Hashes for hypernodes-0.1.9.tar.gz
Algorithm Hash digest
SHA256 ddb819911978b1650168ef275914413e0cdd449b9b78d75dd43f4d20be667527
MD5 86394ddb0fa0e6b864b9d9305857324e
BLAKE2b-256 66c856e87a25f1ca808c936c5e02709f537232efdd113ceb6f6d82d1c6cfd560

See more details on using hashes here.

File details

Details for the file hypernodes-0.1.9-py3-none-any.whl.

File metadata

  • Download URL: hypernodes-0.1.9-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.14 Darwin/23.6.0

File hashes

Hashes for hypernodes-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f598245ee756dd557d4c73573301cc561d2726d2fdb6f9baef83d551d75f501a
MD5 27a9d9d50f0f380bc92496693045f045
BLAKE2b-256 9cd6c640ce31fd1d8f5d458cf066eede179c8dc1c155cf6b1ec8e1898c8c2a48

See more details on using hashes here.

Supported by

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