hypster


Namehypster JSON
Version 0.2.24 PyPI version JSON
download
home_pagehttps://github.com/gilad-rubin/hypster
SummaryA flexible configuration system for Python projects
upload_time2024-10-11 15:28:37
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">
  <img src="assets/hypster_with_text.png" alt="Hypster Logo" width="600"/>
</p>

</p>
<p align="center">
  <span style="font-size: 18px;">
    <a href="https://gilad-rubin.github.io/hypster/">[Documentation]</a> |
    <a href="#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_input(0),
                  'max_tokens': hp.number_input(64)}

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

Now we can instantiate the configs with our selections and overrides:

```python
results = my_config(final_vars=["chunking_strategy", "llm_config", "llm_model"],
                    selections={"llm_model" : "haiku"},
                    overrides={"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": "gilad.rubin@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/74/44/eebdc18beee0b10edcdf9f314964bfadc5cd14c1c8b00e6c3c48ce2c17df/hypster-0.2.24.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n  <img src=\"assets/hypster_with_text.png\" alt=\"Hypster Logo\" width=\"600\"/>\n</p>\n\n</p>\n<p align=\"center\">\n  <span style=\"font-size: 18px;\">\n    <a href=\"https://gilad-rubin.github.io/hypster/\">[Documentation]</a> |\n    <a href=\"#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_input(0),\n                  'max_tokens': hp.number_input(64)}\n\n    system_prompt = hp.text_input('You are a helpful assistant. Answer with one word only')\n```\n\nNow we can instantiate the configs with our selections and overrides:\n\n```python\nresults = my_config(final_vars=[\"chunking_strategy\", \"llm_config\", \"llm_model\"],\n                    selections={\"llm_model\" : \"haiku\"},\n                    overrides={\"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.24",
    "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": "9febd76feffb74201d64b82543f46d79dbc0e0292e1a3d89cf6bd25b0698e60e",
                "md5": "54323a3aeabf84e1ce8b5402ff6ec7a3",
                "sha256": "862c6cd595bae3b8770bd2e99a5688636801d32cf0dc08a5f7ca3f73d8115866"
            },
            "downloads": -1,
            "filename": "hypster-0.2.24-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "54323a3aeabf84e1ce8b5402ff6ec7a3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 23582,
            "upload_time": "2024-10-11T15:28:35",
            "upload_time_iso_8601": "2024-10-11T15:28:35.985919Z",
            "url": "https://files.pythonhosted.org/packages/9f/eb/d76feffb74201d64b82543f46d79dbc0e0292e1a3d89cf6bd25b0698e60e/hypster-0.2.24-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7444eebdc18beee0b10edcdf9f314964bfadc5cd14c1c8b00e6c3c48ce2c17df",
                "md5": "9e5bd024d04994f3249f3326388ec3b7",
                "sha256": "99cbea824fa7287d3b90bc91a5a3cd118015f72251eaebd58ebe49186a813e4d"
            },
            "downloads": -1,
            "filename": "hypster-0.2.24.tar.gz",
            "has_sig": false,
            "md5_digest": "9e5bd024d04994f3249f3326388ec3b7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 21129,
            "upload_time": "2024-10-11T15:28:37",
            "upload_time_iso_8601": "2024-10-11T15:28:37.599542Z",
            "url": "https://files.pythonhosted.org/packages/74/44/eebdc18beee0b10edcdf9f314964bfadc5cd14c1c8b00e6c3c48ce2c17df/hypster-0.2.24.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-11 15:28:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gilad-rubin",
    "github_project": "hypster",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "hypster"
}
        
Elapsed time: 0.38622s