WebAI Studio
Back to Demos

Semantic Cache

Embeddings

Serve instant answers for paraphrased questions by caching LLM responses under their embeddings.

Why On-Device?

A production pattern made visible: skip re-running the language model when a semantically equivalent question was already answered — saving seconds and tokens.

Interactive Demo

Semantic Embedder: Loading...
Prompt API: Loading...
Cache Hits
0
Cache Misses
0
Hit vs Generation
N/A vs N/A
Est. Tokens Saved
≈0

Ask 1 first (generates), then 2 — the paraphrase hits the cache instantly.

Answer
Ask a question to see caching in action...
Semantic Cache
0 entries
Hit threshold0.85

Every generated answer is stored here under its question's embedding.

Implementation Code

demo.js