cd /news/ai-infrastructure/cacheverifier-check-if-verifying-llm… Β· home β€Ί topics β€Ί ai-infrastructure β€Ί article
[ARTICLE Β· art-152804] src=github.com β†— pub= topic=ai-infrastructure verified=true sentiment=Β· neutral

CacheVerifier, check if verifying LLM cache hits helps your traffic

CacheVerifier launched a Python client for its hosted API that approves or rejects semantic-cache hits before an application serves a cached answer, aimed at catching similarity matches that are close but wrong. The client requires Python 3.9+ and depends only on httpx at runtime, with opt-in extras for a GPTCache adapter and an offline Health Check; verify() defaults to a 1s timeout and fails closed, returning approved=False with degraded=True on timeouts, connection errors or 5xx responses, while 4xx errors raise CacheVerifierError. Self-serve verification and fine-tuning are free, and the company states there is no formal uptime SLA yet, which it cites as the reason the fallback path is a built-in default.

key takeaway

CacheVerifier's verify() defaults to a 1s timeout and fails closed, returning approved=False with degraded=True on timeouts, connection errors or 5xx so requests fall through to the LLM, while 4xx errors still raise CacheVerifierError.

read5 min views17 publishedOct 19, 2026
CacheVerifier, check if verifying LLM cache hits helps your traffic
Image: Michielbdejong (auto-discovered)

Python client for CacheVerifier β€” a hosted API that verifies semantic-cache hits. Given a query and a candidate cached answer, it approves or rejects serving that answer from cache, so a similarity match that is close but wrong doesn't become a silent error in your app.

CacheVerifier does not run your cache or do similarity search. Your cache backend does its own lookup first; you call verify() only on the candidates in the similarity "gray zone", where a plain threshold match might be wrong.

pip install cacheverifier
pip install "cacheverifier[gptcache]"
pip install "cacheverifier[healthcheck]"

Requires Python 3.9+. The only runtime dependency is httpx β€” the extras above are opt-in.

Get a free API key at https://www.cacheverifier.com (self-serve verify and fine-tuning are free forever, no card).

from cacheverifier import CacheVerifier

cv = CacheVerifier(api_key="cv_...")

query = "how do I cancel my subscription"
candidate = "Go to Settings > Billing >  subscription for a month."  # from your cache

result = cv.verify(query, candidate)
if result.approved:
    answer = candidate                       # verified hit β€” skip the LLM call
else:
    answer = call_your_llm(query)            # not trustworthy β€” fall through

cv.feedback(query, answer, was_correct=True, similarity_score=0.86)

verify() returns a VerifyResult:

field meaning
approved serve the cached answer ( True ) or fall through (False )
score /threshold approved isscore >= threshold
model_version "stock" ,"v<id>" (fine-tuned),"cold_start_fail_closed" /"cold_start_auto_pending" , or"verify_unavailable"
latency_ms server-side inference time
degraded True when the call failed and this result was synthesized client-side

verify() runs inline with your traffic, so its defaults are conservative:

  • 1s timeout (verify_timeout= ), separate from the 10stimeout= used for fine-tuning / feedback / monitoring calls. Warm verification is tens of milliseconds server-side; 1s covers the network round trip and a cold model load after a deploy without letting a stuck verifier stall your request.
  • Fails closed. On a timeout, connection error, or 5xx,verify() does not raise β€” it logs a warning on thecacheverifier logger and returns aVerifyResult withdegraded=True andapproved=False , so you fall through to your LLM exactly as you would on a cache miss. A4xx (bad key, bad request, rate limit) still raisesCacheVerifierError .
cv = CacheVerifier(api_key="cv_...", verify_timeout=1.0, fail_open=False)  # the defaults

cv = CacheVerifier(api_key="cv_...", fail_open=True)

There is no formal uptime SLA yet, which is the other reason the fallback path is a built-in default rather than left to you.

Drop the verifier into a GPTCache pipeline as its similarity evaluator β€” no fork required:

from gptcache import cache
from cacheverifier.integrations.gptcache import CacheVerifierEvaluation

evaluator = CacheVerifierEvaluation(api_key="cv_...")
cache.init(similarity_evaluation=evaluator, ...)

evaluator.report_feedback(query, answer, was_correct=False, similarity_score=0.9)

See examples/gptcache_example.py.

Once you have ~20+ feedback rows (the service found fine-tuning is often a net negative below ~1,000 on the hardest data β€” see the research), train a verifier on your own gray-zone labels:

job = cv.finetune()                       # or cv.finetune(target_risk=0.01, cost_ratio=5.0)
job = cv.get_finetune_job(job["id"])      # poll until status == "done"
print(job["auc_baseline"], job["auc_tuned"])

if job.get("result_model_version"):
    cv.activate_model_version(job["result_model_version"])

cv.dry_run([...]) reports the same baseline-vs-tuned AUC on examples you pass directly, without writing anything or deploying a model.

cv.dry_run() still uploads your examples to the API. If that's a blocker β€” a compliance review, or just not wanting production traffic to leave your network β€” run the identical stock-vs-fine-tuned evaluation entirely on your own machine:

pip install "cacheverifier[healthcheck]"

cacheverifier healthcheck traffic.jsonl
cacheverifier healthcheck traffic.jsonl --emit-summary summary.json

traffic.jsonl is a JSON array or JSONL of {"query", "candidate_answer", "was_correct"} rows in arrival order (the train/calibrate/test split is chronological, matching the hosted service so the numbers are comparable). Optional per row: "stale": true.

Nothing is sent anywhere β€” the base model downloads once from Hugging Face, then it's fully offline. --emit-summary writes an aggregate-only JSON file (AUCs, counts, rates β€” no query or answer text) that's safe to share for a human read.

Choosing the base model. --base-model takes the same values as the hosted service's base_model fine-tune parameter, so local and hosted numbers stay comparable:

--base-model model use for
ms_marco (default) cross-encoder/ms-marco-MiniLM-L6-v2 English traffic
nli cross-encoder/nli-MiniLM2-L6-H768 English; entailment pretraining, stronger on negation / entity swaps
multilingual BAAI/bge-reranker-base Chinese and other non-English traffic (~6 GB RAM to fine-tune)
multilingual_small cross-encoder/mmarco-mMiniLMv2-L12-H384-v1 same, smaller (~3 GB RAM)

The English bases read most Chinese characters as unknown tokens, so on Chinese traffic their result doesn't mean anything β€” the CLI warns when it sees mostly CJK text on an English base. You can also pass any Hugging Face model id or a local model directory. If Hugging Face is unreachable from your network, set HF_ENDPOINT to a mirror, or download the model elsewhere and pass its directory:

cacheverifier healthcheck traffic.jsonl --base-model multilingual
HF_ENDPOINT=https://hf-mirror.com cacheverifier healthcheck traffic.jsonl --base-model multilingual_small
cacheverifier healthcheck traffic.jsonl --base-model ./models/bge-reranker-base
results
------------------------------------------------------------------
  train / calibrate / test:         3349 / 419 / 419
  stock verifier   held-out AUC:    0.6120
  fine-tuned       held-out AUC:    0.7080   (delta +0.0960)
  label-noise proxy (disagreement): 11.4%
  ceiling status:                   still_improvable

verdict
------------------------------------------------------------------
  IMPROVED   -- fine-tuning on your own data helps this traffic
method endpoint
verify(query, candidate_answer) POST /v1/verify
verify_batch(pairs) POST /v1/verify/batch
feedback(...) /feedback_batch(items) POST /v1/feedback //batch
finetune(...) /dry_run(examples, ...) POST /v1/finetune/jobs //dry-run
get_finetune_job(id) /list_finetune_jobs() GET /v1/finetune/jobs[/id]
activate_model_version(id) POST /v1/finetune/model-versions/{id}/activate
drift_status() GET /v1/monitor/drift-status
gray_zone_threshold() GET /v1/monitor/gray-zone-threshold
usage() /savings() GET /v1/usage/status //savings

Non-2xx responses raise CacheVerifierError (.status_code, .detail).

MIT β€” see LICENSE. (The research repository is separately licensed; this client is not.)

── more in #ai-infrastructure 4 stories Β· sorted by recency
── more on @cacheverifier 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/cacheverifier-check-…] indexed:0 read:5min 2026-10-19 Β· β€”