Skip to main content

Semantic caching framework for LLMs

Project description

CacheMind is a lightweight semantic caching layer for LLM applications.
It helps reduce redundant LLM calls to improve response time and save LLM token costs.

📦Installation

pip install cachemind

⚡Quick Start

from cachemind import CacheMind
cache = CacheMind()

response = cache.query("What is artificial intelligence?")
print(response)

🧩Customization

CacheMind is designed to be flexible. You can plug in your own components for LLM, embedding, vector store, and policy.

Custom Embedding
class MyEmbedding:
def encode(self, text):
return [0.1] * 384
cache = CacheMind(embedding=MyEmbedding())

📊 Metrics

CacheMind also supports metrics tracking, allowing you to monitor cache performance and effectiveness over time.

stats = cache.metrics.get_stats()
print(stats)

Sample output:
{
"total_queries": 10,
"cache_hits": 6,
"cache_misses": 4,
"hit_rate": 0.6,
"tokens_saved": 120,
"tokens_used": 80
}

License: MIT

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

cachemind-0.1.2.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

cachemind-0.1.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file cachemind-0.1.2.tar.gz.

File metadata

  • Download URL: cachemind-0.1.2.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for cachemind-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e43850bfca8d050d5c6b78c7f83029bc3bda80b907eb6c1dfd9940993b00a37f
MD5 d2bd9597b2f4f8a189d9ae7c7be1c649
BLAKE2b-256 23968a0ccc9dfa29b81b1f06603d051dc7d6a749a552ae53b65a8daddaf0a680

See more details on using hashes here.

File details

Details for the file cachemind-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cachemind-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for cachemind-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 886ea212fb30ac110e3d0a8215ecd3a6fc44b3974ebcc2565d78270ecaee0dcd
MD5 ad6cfd040a8d5f9a3b5abf6d77871e89
BLAKE2b-256 aab0213acfaf087db748c624b18ee36c7f13ed9881f0cb5e33561d28895d5f28

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