Skip to content

Latest commit

 

History

History
60 lines (39 loc) · 1.5 KB

File metadata and controls

60 lines (39 loc) · 1.5 KB

vCache

Reliable and Efficient Semantic Prompt Caching


Tests

vCache includes both unit tests and integration tests to ensure correctness and reliability across its modular components.

Installation

To enable testing capabilities, install vCache with the benchmarks and dev extras from the project root:

pip install -e .[benchmarks,dev]

Unit Tests

Unit tests verify the logic of individual module strategies (e.g., caching policies, embedding engines, similarity evaluators) in isolation.
They are designed to be fast, deterministic, and independent of external services.

Running Unit Tests

python -m pytest tests/unit 

Integration Tests

Integration tests validate the end-to-end behavior of vCache by checking how components interact (e.g., LLM inference + vector database + thresholding policy).
They may involve real API calls and require a valid OpenAI key.

Running Integration Tests

  1. Export your OpenAI key:
export OPENAI_API_KEY="your_key_here"
  1. Run the tests using Poetry:
python -m pytest tests/integration