Skip to main content

A caching library built with LLM experiments in mind

Project description

Cachesaver

Cachesaver is a high-efficiency caching library for experiments with large language models (LLMs), designed to minimize costs, improve reproducibility, and streamline debugging. The library enables caching of multiple responses per query, tracks usage for unique sampling across runs, and ensures statistical integrity. Built on Python’s asyncio, Cachesaver supports asynchronous execution, request batching, prompt deduplication, and race-condition prevention.

from cachesaver.models.openai import AsyncOpenAI

client = AsyncOpenAI(batch_size=2)

resp = await client.chat.completions.create(
    model="gpt-4.1-nano",
    messages=[
        {"role": "user", "content": "What's the capital of France?"}
    ]
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cachesaver-0.0.3.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cachesaver-0.0.3-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file cachesaver-0.0.3.tar.gz.

File metadata

  • Download URL: cachesaver-0.0.3.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for cachesaver-0.0.3.tar.gz
Algorithm Hash digest
SHA256 c04107488144c4612a1a8740c9fd978964085d2580170f808fcfc16271e65ec9
MD5 d6cfb89b7a345733903bf44552e881c8
BLAKE2b-256 0045f507a983e232fe901eed4cb244452c7b2a02a4bb3c58bc1e5afc3047e2c8

See more details on using hashes here.

File details

Details for the file cachesaver-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: cachesaver-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.16

File hashes

Hashes for cachesaver-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1c1f9fc120d629f3c30e595cdba07d9b845102c903357dc61d93e7cc0470878b
MD5 ffc4b0d1fd506806fe62bf3ae5ec77b2
BLAKE2b-256 572a5e43aedadbf11160c97bd21965d0b1c15bae6de98fd9581859dc34666fa2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page