hypster


Namehypster JSON
Version 0.2.34 PyPI version JSON
download
home_pagehttps://github.com/gilad-rubin/hypster
SummaryA flexible configuration system for Python projects
upload_time2024-11-21 12:34:49
maintainerNone
docs_urlNone
authorGilad Rubin
requires_python<4.0,>=3.10
licenseMIT
keywords configuration ai machine-learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
  <picture>
    <source srcset="assets/hypster_white_text.png" media="(prefers-color-scheme: dark)">
    <img src="assets/hypster_with_text.png" alt="Hypster Logo" width="600"/>
  </picture>
</p>

</p>
<p align="center">
  <span style="font-size: 18px;">
    <a href="https://gilad-rubin.gitbook.io/hypster">[Documentation]</a> |
    <a href="https://gilad-rubin.gitbook.io/hypster/getting-started/installation">[Installation]</a> |
    <a href="#quick-start">[Quick Start]</a>
  </span>
</p>

**`Hypster`** is a lightweight configuration system for AI & Machine Learning projects.
It offers minimal, intuitive pythonic syntax, supporting hierarchical and swappable configurations.

## Installation

You can install Hypster using pip:

```bash
pip install hypster
```

## Quick Start

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

```python
from hypster import HP, config

@config
def my_config(hp: HP):
    chunking_strategy = hp.select(['paragraph', 'semantic', 'fixed'], default='paragraph')

    llm_model = hp.select({'haiku': 'claude-3-haiku-20240307',
                           'sonnet': 'claude-3-5-sonnet-20240620',
                           'gpt-4o-mini': 'gpt-4o-mini'}, default='gpt-4o-mini')

    llm_config = {'temperature': hp.number(0),
                  'max_tokens': hp.number(64)}

    system_prompt = hp.text('You are a helpful assistant. Answer with one word only')
```

Now we can instantiate the configs with our values:

```python
results = my_config(final_vars=["chunking_strategy", "llm_config", "llm_model"],
                    values={"llm_model" : "haiku", "llm_config.temperature" : 0.5})
```

## Inspiration

Hypster draws inspiration from Meta's [hydra](https://github.com/facebookresearch/hydra) and [hydra-zen](https://github.com/mit-ll-responsible-ai/hydra-zen) framework.
The API design is influenced by [Optuna's](https://github.com/optuna/optuna) "define-by-run" API.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## 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/hypster",
    "name": "hypster",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "configuration, ai, machine-learning",
    "author": "Gilad Rubin",
    "author_email": "me@giladrubin.com",
    "download_url": "https://files.pythonhosted.org/packages/6c/0b/73a993d168702a11c8e2f87e3456f64572fba9919693c9d9b92e9ec1b06d/hypster-0.2.34.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <picture>\n    <source srcset=\"assets/hypster_white_text.png\" media=\"(prefers-color-scheme: dark)\">\n    <img src=\"assets/hypster_with_text.png\" alt=\"Hypster Logo\" width=\"600\"/>\n  </picture>\n</p>\n\n</p>\n<p align=\"center\">\n  <span style=\"font-size: 18px;\">\n    <a href=\"https://gilad-rubin.gitbook.io/hypster\">[Documentation]</a> |\n    <a href=\"https://gilad-rubin.gitbook.io/hypster/getting-started/installation\">[Installation]</a> |\n    <a href=\"#quick-start\">[Quick Start]</a>\n  </span>\n</p>\n\n**`Hypster`** is a lightweight configuration system for AI & Machine Learning projects.\nIt offers minimal, intuitive pythonic syntax, supporting hierarchical and swappable configurations.\n\n## Installation\n\nYou can install Hypster using pip:\n\n```bash\npip install hypster\n```\n\n## Quick Start\n\nHere's a simple example of how to use Hypster:\n\n```python\nfrom hypster import HP, config\n\n@config\ndef my_config(hp: HP):\n    chunking_strategy = hp.select(['paragraph', 'semantic', 'fixed'], default='paragraph')\n\n    llm_model = hp.select({'haiku': 'claude-3-haiku-20240307',\n                           'sonnet': 'claude-3-5-sonnet-20240620',\n                           'gpt-4o-mini': 'gpt-4o-mini'}, default='gpt-4o-mini')\n\n    llm_config = {'temperature': hp.number(0),\n                  'max_tokens': hp.number(64)}\n\n    system_prompt = hp.text('You are a helpful assistant. Answer with one word only')\n```\n\nNow we can instantiate the configs with our values:\n\n```python\nresults = my_config(final_vars=[\"chunking_strategy\", \"llm_config\", \"llm_model\"],\n                    values={\"llm_model\" : \"haiku\", \"llm_config.temperature\" : 0.5})\n```\n\n## Inspiration\n\nHypster draws inspiration from Meta's [hydra](https://github.com/facebookresearch/hydra) and [hydra-zen](https://github.com/mit-ll-responsible-ai/hydra-zen) framework.\nThe API design is influenced by [Optuna's](https://github.com/optuna/optuna) \"define-by-run\" API.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A flexible configuration system for Python projects",
    "version": "0.2.34",
    "project_urls": {
        "Homepage": "https://github.com/gilad-rubin/hypster",
        "Repository": "https://github.com/gilad-rubin/hypster"
    },
    "split_keywords": [
        "configuration",
        " ai",
        " machine-learning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "83535ae46121bb6758d6813a64b632cdda812d59ebb832b3e6aec0ec21a0d613",
                "md5": "3ec87e4c6528b5938ea2ca4a45d655c1",
                "sha256": "fcfc79e9fe046b3ad1e0d3c63f74b376299991939cce064b8f408dd745ab6f8e"
            },
            "downloads": -1,
            "filename": "hypster-0.2.34-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3ec87e4c6528b5938ea2ca4a45d655c1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 26768,
            "upload_time": "2024-11-21T12:34:48",
            "upload_time_iso_8601": "2024-11-21T12:34:48.305694Z",
            "url": "https://files.pythonhosted.org/packages/83/53/5ae46121bb6758d6813a64b632cdda812d59ebb832b3e6aec0ec21a0d613/hypster-0.2.34-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c0b73a993d168702a11c8e2f87e3456f64572fba9919693c9d9b92e9ec1b06d",
                "md5": "5f131f53007f94d144a8a5f4d2e60c65",
                "sha256": "44470669e5de153de6cb0c52adad97945be6996e677f72cb9a1825ee481b584b"
            },
            "downloads": -1,
            "filename": "hypster-0.2.34.tar.gz",
            "has_sig": false,
            "md5_digest": "5f131f53007f94d144a8a5f4d2e60c65",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 23533,
            "upload_time": "2024-11-21T12:34:49",
            "upload_time_iso_8601": "2024-11-21T12:34:49.352400Z",
            "url": "https://files.pythonhosted.org/packages/6c/0b/73a993d168702a11c8e2f87e3456f64572fba9919693c9d9b92e9ec1b06d/hypster-0.2.34.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-21 12:34:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gilad-rubin",
    "github_project": "hypster",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "hypster"
}
        
Elapsed time: 0.40410s