Skip to main content

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

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
pyenv install 3.11.0
pyenv virtualenv 3.11.0 apropos-dev
pyenv activate apropos-dev

2. Poetry

/bash
curl -sSL https://install.python-poetry.org | python3 -
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:

@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

@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}, 
}

Metadata

Release files for apropos-ai 0.4.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apropos-ai 0.4.5
File Size Uploaded Provenance
apropos_ai-0.4.5.tar.gz 245.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for apropos-ai 0.4.5
File Interpreter ABI Platform
apropos_ai-0.4.5-py3-none-any.whl Python 3 none any Details

Total release size: 343.0 kB

Release files / apropos_ai-0.4.5.tar.gz

Download URL apropos_ai-0.4.5.tar.gz
Size 245.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0ef7aa150cfb3e623ebbcdacf448e70104152849543c2dff7059f6ddab91ee91
BLAKE2b-256 checksum
How to use checksums
ffcd6e25479df4416c27dc6da51bfa94ac27e809324b5a40d344b0cfc9ddbcc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.8

Release files / apropos_ai-0.4.5-py3-none-any.whl

Download URL apropos_ai-0.4.5-py3-none-any.whl
Size 97.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ed6b5460821466eab560e5e117efd57b0f573648ff9d387eb7340f3ee835310
BLAKE2b-256 checksum
How to use checksums
38e5708005b017b4e3a6f00748bb04a35ebd864073608d45149761cbf7dc013d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.8

Security for apropos-ai 0.4.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.4.5 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page