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

Uploaded Source

Built Distribution

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

Uploaded Python 3

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