Cappr

Latest version: v0.9.6

Safety actively analyzes 701595 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 7

0.8.3

Breaking changes

None

New features

None

Bug fixes

* Now works for `openai>=1.2.0`, and backwards compatibility fix for `openai<1.0.0`

0.8.2

Breaking changes

None

New features

None

Bug fixes

* For older versions of numpy, `_examples` functions now work

0.8.1

Breaking changes

* `end_of_prompt` must be a whitespace or empty string. (This was intended since [v0.4.7](https://github.com/kddubey/cappr/releases/tag/v0.4.7), but I forgot to add a check for it)

New features

* `cappr.openai` is now compatible with [OpenAI v1.0.0](https://github.com/openai/openai-python/discussions/631) (and is backwards compatible with previous versions). You can input a `client` object

Bug fixes

* `cappr.huggingface.classify.token_logprobs` now has an option to add a BOS token or not. Previously, it always added it if applicable, which is wrong for the (still highly experimental) discount feature

0.8.0

Breaking changes

None

New features

* `cappr.llama_cpp.classify` now takes an `end_of_prompt=" "` kwarg, which makes it compatible with models which use BPE tokenizers. (This change is backward compatible with SentencePiece tokenizers because they always separate the prompt and completion with a whitespace.)

Bug fixes

None

0.7.0

Breaking changes

* `cappr.huggingface.classify_no_batch` and `cappr.huggingface.classify_no_cache_no_batch` have been deprecated. Instead, set `batch_size_completions=1` in `cappr.huggingface.classify` and `cappr.huggingface.classify_no_cache`, respectively. Apologies for releasing these half measures

New features

* `cappr.huggingface.classify*` can batch over completions to save memory. Set the keyword argument `batch_size_completions`
* `cappr.huggingface.classify` now allows for sub-prompt caching to reduce runtime. Cache shared instructions or exemplars for prompts using the new [context manager](https://cappr.readthedocs.io/en/latest/cappr.huggingface.classify.html#cappr.huggingface.classify.cache). See this functionality in action in the [Banking 77 demo](https://github.com/kddubey/cappr/blob/main/demos/huggingface/banking_77_classes.ipynb)

Bug fixes

None

0.6.6

Breaking changes

None

New features

* The `prior` can now be any sort of sequence, not just a `Sequence` or numpy array. So you can supply something like the following (from a pandas DataFrame):

python
prior = (
df_tr["correct_completion"]
.value_counts(normalize=True)
[completions]
)

* `token_logprobs` functions now allow a `str` input for `texts`

Bug fixes

None

Page 3 of 7

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.