apropos-ai


Nameapropos-ai JSON
Version 0.4.5 PyPI version JSON
download
home_pageNone
SummaryLearning algorithms for production language model programs
upload_time2024-10-03 17:54:21
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Apropos

Learning algorithms for production language model programs.

## Spinning Up - Usage
Get started by running
```pip install apropos-ai```

### Hello World
To get started with simple bootstrapped fewshot random search on the Hendryks Math benchmark, run:
```
python examples/hello_world.py
```

### Custom Dataset + Prompt
To get started with a custom dataset and/or language model program, if your program happens to be a single-prompt program, we have a simple demo [here](examples/quick_start.py)

Simply replace
```
messages_examples, gold_outputs, custom_math_metric = (
      get_hendryks_messages_and_gold_outputs()
)
```
with your own data (in the form of system/user prompt pairs and possibly gold outputs) and a metric of your choosing. Then, run away!

Nota Bene: the logic involved in converting this data to the appropriate DAG / benchmark is very new and experimental, please file an issue if you run into any trouble.

## Spinning Up - Dev
#### 1. UV
uv venv apropos-dev
source apropos-dev/bin/activate

#### 1. Pyenv
   /bash<br>
   `pyenv install 3.11.0`<br>
   `pyenv virtualenv 3.11.0 apropos-dev`<br>
   `pyenv activate apropos-dev`

#### 2. Poetry
   /bash<br>
   `curl -sSL https://install.python-poetry.org | python3 -`<br>
   `poetry install`


## Usage
If you use the following idea(s):
- Optimizing over variations of specific substrings within a prompt

please cite this repo and forthcoming paper when released

If you use the MIPROv2 optimizer in your academic work, please cite the following [paper](https://arxiv.org/abs/2406.11695):

```
@misc{opsahlong2024optimizinginstructionsdemonstrationsmultistage,
      title={Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programs}, 
      author={Krista Opsahl-Ong and Michael J Ryan and Josh Purtell and David Broman and Christopher Potts and Matei Zaharia and Omar Khattab},
      year={2024},
      eprint={2406.11695},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2406.11695}, 
}
```

Moreover, if you find the notion of learning from bootstrapped demonstrations useful, or have used algorithms such as the breadth-first random search optimizer, consider citing the following [paper](https://arxiv.org/abs/2310.03714)

```
@misc{khattab2023dspycompilingdeclarativelanguage,
      title={DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines}, 
      author={Omar Khattab and Arnav Singhvi and Paridhi Maheshwari and Zhiyuan Zhang and Keshav Santhanam and Sri Vardhamanan and Saiful Haq and Ashutosh Sharma and Thomas T. Joshi and Hanna Moazam and Heather Miller and Matei Zaharia and Christopher Potts},
      year={2023},
      eprint={2310.03714},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2310.03714}, 
}
```
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "apropos-ai",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/ff/cd/6e25479df4416c27dc6da51bfa94ac27e809324b5a40d344b0cfc9ddbcc1/apropos_ai-0.4.5.tar.gz",
    "platform": null,
    "description": "# Apropos\n\nLearning algorithms for production language model programs.\n\n## Spinning Up - Usage\nGet started by running\n```pip install apropos-ai```\n\n### Hello World\nTo get started with simple bootstrapped fewshot random search on the Hendryks Math benchmark, run:\n```\npython examples/hello_world.py\n```\n\n### Custom Dataset + Prompt\nTo get started with a custom dataset and/or language model program, if your program happens to be a single-prompt program, we have a simple demo [here](examples/quick_start.py)\n\nSimply replace\n```\nmessages_examples, gold_outputs, custom_math_metric = (\n      get_hendryks_messages_and_gold_outputs()\n)\n```\nwith your own data (in the form of system/user prompt pairs and possibly gold outputs) and a metric of your choosing. Then, run away!\n\nNota Bene: the logic involved in converting this data to the appropriate DAG / benchmark is very new and experimental, please file an issue if you run into any trouble.\n\n## Spinning Up - Dev\n#### 1. UV\nuv venv apropos-dev\nsource apropos-dev/bin/activate\n\n#### 1. Pyenv\n   /bash<br>\n   `pyenv install 3.11.0`<br>\n   `pyenv virtualenv 3.11.0 apropos-dev`<br>\n   `pyenv activate apropos-dev`\n\n#### 2. Poetry\n   /bash<br>\n   `curl -sSL https://install.python-poetry.org | python3 -`<br>\n   `poetry install`\n\n\n## Usage\nIf you use the following idea(s):\n- Optimizing over variations of specific substrings within a prompt\n\nplease cite this repo and forthcoming paper when released\n\nIf you use the MIPROv2 optimizer in your academic work, please cite the following [paper](https://arxiv.org/abs/2406.11695):\n\n```\n@misc{opsahlong2024optimizinginstructionsdemonstrationsmultistage,\n      title={Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programs}, \n      author={Krista Opsahl-Ong and Michael J Ryan and Josh Purtell and David Broman and Christopher Potts and Matei Zaharia and Omar Khattab},\n      year={2024},\n      eprint={2406.11695},\n      archivePrefix={arXiv},\n      primaryClass={cs.CL},\n      url={https://arxiv.org/abs/2406.11695}, \n}\n```\n\nMoreover, if you find the notion of learning from bootstrapped demonstrations useful, or have used algorithms such as the breadth-first random search optimizer, consider citing the following [paper](https://arxiv.org/abs/2310.03714)\n\n```\n@misc{khattab2023dspycompilingdeclarativelanguage,\n      title={DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelines}, \n      author={Omar Khattab and Arnav Singhvi and Paridhi Maheshwari and Zhiyuan Zhang and Keshav Santhanam and Sri Vardhamanan and Saiful Haq and Ashutosh Sharma and Thomas T. Joshi and Hanna Moazam and Heather Miller and Matei Zaharia and Christopher Potts},\n      year={2023},\n      eprint={2310.03714},\n      archivePrefix={arXiv},\n      primaryClass={cs.CL},\n      url={https://arxiv.org/abs/2310.03714}, \n}\n```",
    "bugtrack_url": null,
    "license": null,
    "summary": "Learning algorithms for production language model programs",
    "version": "0.4.5",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "38e5708005b017b4e3a6f00748bb04a35ebd864073608d45149761cbf7dc013d",
                "md5": "39dc7f9cc09d8517169d08cc322eb095",
                "sha256": "4ed6b5460821466eab560e5e117efd57b0f573648ff9d387eb7340f3ee835310"
            },
            "downloads": -1,
            "filename": "apropos_ai-0.4.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "39dc7f9cc09d8517169d08cc322eb095",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 97369,
            "upload_time": "2024-10-03T17:54:19",
            "upload_time_iso_8601": "2024-10-03T17:54:19.313812Z",
            "url": "https://files.pythonhosted.org/packages/38/e5/708005b017b4e3a6f00748bb04a35ebd864073608d45149761cbf7dc013d/apropos_ai-0.4.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ffcd6e25479df4416c27dc6da51bfa94ac27e809324b5a40d344b0cfc9ddbcc1",
                "md5": "ef202a56de4e12b01d358c8e487d896a",
                "sha256": "0ef7aa150cfb3e623ebbcdacf448e70104152849543c2dff7059f6ddab91ee91"
            },
            "downloads": -1,
            "filename": "apropos_ai-0.4.5.tar.gz",
            "has_sig": false,
            "md5_digest": "ef202a56de4e12b01d358c8e487d896a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 245678,
            "upload_time": "2024-10-03T17:54:21",
            "upload_time_iso_8601": "2024-10-03T17:54:21.483045Z",
            "url": "https://files.pythonhosted.org/packages/ff/cd/6e25479df4416c27dc6da51bfa94ac27e809324b5a40d344b0cfc9ddbcc1/apropos_ai-0.4.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-03 17:54:21",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "apropos-ai"
}
        
Elapsed time: 0.39123s