Prompt Caching and Prefix Caching in Local LLMs: How They Reduce Memory and Latency
Prompt caching and prefix caching both reuse the key-value (KV) state a model already computed for an unchanged prompt prefix, so a new request can skip that…
EXPLORE THE TOPIC
Developer patterns for API integration, embeddings, retrieval, and debugging.
35 published articlesPrompt caching and prefix caching both reuse the key-value (KV) state a model already computed for an unchanged prompt prefix, so a new request can skip that…
Secrets leak into RAG when ingestion pipelines index everything without classification, scanning, or access metadata. The fix is layered: keep credentials out of source documents, scan and…
Setting stream: true on an AI API request is only half the work. This guide explains how to enable streaming, parse server-sent events without corrupting split chunks,…
A trace ID strategy is a small contract: one trace ID per unit of autonomous work, one span ID per step, a parent link for every child,…
A RAG pipeline can fail in two different places, and one end-to-end score will not tell you which. Test retrieval and generation separately: score Precision@k and Recall@k…
Ollama supports two distinct capabilities that are easy to confuse: tool calling, where a model requests a named function that your app executes, and structured outputs, where…
A RAG assistant avoids repeating your WordPress posts by indexing every published article into a vector store and querying it before the model writes a word. The…
A retrieval-augmented generation pipeline can run entirely on your own machine, including the embedding step that turns documents into vectors. This guide maps the local-only component stack,…
A local RAG pipeline uses Ollama to serve both the chat model and the embedding model, and ChromaDB to store and search document vectors, so answers are…
Local embedding models compute document and query vectors on your own hardware, so text never leaves your machine before retrieval. LlamaIndex supports a fully local stack using…
A LangChain RAG pipeline has three stages: index documents, retrieve the passages relevant to a query, and pass those passages to a chat model. This guide walks…
Metadata filtering is the retrieval-layer control that turns user identity, permissions, and dates into vector query constraints. In multi-tenant RAG, the orchestrator should apply tenant, ACL, and…