Back to directory

BARGAIN

A framework that lowers the cost of processing a dataset with large language models by deciding per record whether a cheap or an expensive model is used, guaranteeing a target accuracy.

BARGAIN

BARGAIN reduces the cost of running a large language model over a dataset by following a model-cascade approach: for each record, it first runs a cheap model and checks the model's own output probability against a threshold to decide whether that answer can be trusted. When it cannot, it falls back to a more expensive, more accurate model, maximizing how often the cheap model is used while meeting a user-specified accuracy target.

The cascade threshold is estimated in a preprocessing step by sampling and labeling a small number of records, which the project says gives BARGAIN a guarantee that holds for any sample size, unlike related systems such as FrugalGPT, which give no guarantee, or SUPG, whose guarantee only holds asymptotically. The method is described in a SIGMOD 2026 paper, and the repository includes example tasks such as classification and extraction over real-world datasets.

More in Inference

See all 770
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • Lifeboat

    iterate.ai

    A local inference server that puts an OpenAI- and Anthropic-compatible API in front of open-weight language models running on hardware you control, from a laptop to a GPU cluster.

  • Claude S40

    github.com

    An unofficial Claude chat client for 2007-era Nokia Series 40 phones, built as a Java ME app plus a small Go relay server, with web search, reading mode and saved chats.