gptcache
GPTCache, a powerful caching library that can be used to speed up and lower the cost of chat applications that rely on the LLM service. GPTCache works as a memcache for AIGC applications, similar to how Redis works for traditional applications.
Decision gist · record as of 2026-08-14
Yes, with conditions. GPTCache is worth installing if you run high-volume LLM applications and want to reduce API costs and latency through caching. However, be aware that the project is aging (last release August 2024, no commits since July 2025), two security vulnerabilities are known, and the API is explicitly subject to change. Verify the current status of those vulnerabilities and test thoroughly in a staging environment before production use.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8.1 or higher and an OpenAI API key set via OPENAI_API_KEY environment variable.
- Low install friction with three common runtime dependencies (numpy, cachetools, requests).
- Maintenance status is aging—last release was 2024-08-01 and the repository has not been updated since 2025-07-11, though the project remains active with 8138 stars.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive) allows unrestricted use, modification, and distribution in both open-source and commercial projects.
last release 2024-08-01 (743 days) · last repo commit 2025-07-11 · 8,138 stars
2 known vulnerabilities (OSV.dev, 2026-08-14) · 450,827 downloads/mo, #6,589 on PyPI
Alternatives
Verify before relying
pip install gptcache
from gptcache import cache
from gptcache.adapter import openai
cache.init()
cache.set_openai_key()
response = openai.ChatCompletion.create(
model='gpt-3.5-turbo',
messages=[{'role': 'user', 'content': 'your question'}]
)- Current status of the two known vulnerabilities (GHSA-xfqj-4cr9-9gr5, PYSEC-2026-3468) and whether patches are available.
- Whether the API remains stable given the note that it 'may be subject to change at any time'.
- Support status for models and API shapes beyond OpenAI, given the stated policy to no longer add new model support.
What it is and what it does
GPTCache is a caching layer for large language model (LLM) API calls that intercepts queries and returns cached responses when an exact or semantically similar question has been asked before. It works by embedding queries into a vector space and comparing them against stored responses, allowing you to skip expensive API calls for repeated or similar questions.
The library integrates with OpenAI's API (and supports a generic get/set adapter for other LLM providers) and can be configured with different embedding models, vector databases (e.g., FAISS), and similarity evaluation strategies. It depends on numpy, cachetools, and requests for its core functionality, though additional optional dependencies are installed on demand for features like semantic embedding and vector storage.
Use it for
- Cache exact-match queries to OpenAI's ChatCompletion API to avoid redundant API calls and reduce monthly costs.
- Implement semantic similarity matching so that paraphrased or slightly different versions of the same question return cached answers.
- Reduce latency for high-traffic chatbot applications by serving cached responses instead of waiting for LLM API responses.
- Store embeddings and responses in a persistent vector database (e.g., SQLite + FAISS) to maintain cache across application restarts.
- Control cache behavior with temperature parameters to balance between cache hits and fresh LLM responses.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
GPTCache is worth installing if you run high-volume LLM applications and want to reduce API costs and latency through caching. However, be aware that the project is aging (last release August 2024, no commits since July 2025), two security vulnerabilities are known, and the API is explicitly subject to change. Verify the current status of those vulnerabilities and test thoroughly in a staging environment before production use.
Install
gptcache on PyPI
Before you install
Low install friction with three common runtime dependencies (numpy, cachetools, requests). Maintenance status is aging—last release was 2024-08-01 and the repository has not been updated since 2025-07-11, though the project remains active with 8138 stars.
Requires Python 3.8.1 or higher and an OpenAI API key set via OPENAI_API_KEY environment variable.
License in practice
MIT license (permissive) allows unrestricted use, modification, and distribution in both open-source and commercial projects.
Quickstart
pip install gptcache
from gptcache import cache
from gptcache.adapter import openai
cache.init()
cache.set_openai_key()
response = openai.ChatCompletion.create(
model='gpt-3.5-turbo',
messages=[{'role': 'user', 'content': 'your question'}]
)
Verify before relying
- Current status of the two known vulnerabilities (GHSA-xfqj-4cr9-9gr5, PYSEC-2026-3468) and whether patches are available.
- Whether the API remains stable given the note that it 'may be subject to change at any time'.
- Support status for models and API shapes beyond OpenAI, given the stated policy to no longer add new model support.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.8.1 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesnumpycachetoolsrequests |
| Maintenance | Aging 743 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 450,827 / month, #6,589 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | 2 GHSA-xfqj-4cr9-9gr5, PYSEC-2026-3468 |
Evidence: gptcache-0.1.44-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “llm response caching”
- gptcacheGPTCache provides semantic caching for LLM API calls, storing and…
- langchain-redisIntegrates Redis with LangChain to provide vector storage, semantic…
- vllm-srRoutes LLM requests to appropriate models in a mixture-of-models…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also mem0ai · memsearch · lmcache · tokencost · llama-index-legacy · mooncake-transfer-engine · cachey · langchain-oci · openai-chatkit