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)

Example 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.1.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.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cachemind-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 65df4dd480004689b29e181d459fca9a2ef5e49bdf3e1968c066f60c62bf43ba
MD5 dad3ff1156cbe30d47b008f1055dd10f
BLAKE2b-256 d0722162cd6ce3a45b4b43ecc59d55fc0e58751d6772e9c271b7a1a4d138336e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cachemind-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5de4d98561f536adab1aa41df6704e18ad1f36078ed032aeac2cd7fb64b15611
MD5 4b0b7ea46fea1ef99c527b0867655445
BLAKE2b-256 46e373d3aa95c4fe25c8767848c2bd6388e11a7416bfe41a4a8fcd8e9488c78f

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