explaingit

ajay6601/embedcache

Analysis updated 2026-05-18

1GoAudience · ops devopsComplexity · 3/5Setup · moderate

TLDR

A single Go binary that sits in front of embedding APIs like Ollama or OpenAI and stops duplicate requests from being recomputed, cutting cost and load.

Mindmap

mindmap
  root((repo))
    What it does
      Cache duplicate embeddings
      Combine identical requests
      Skip re-embedding unchanged chunks
      Enforce spend budgets
    Tech stack
      Go
      No external dependencies
      Single binary
    Use cases
      Cut embedding API costs
      Speed up RAG re-ingest
      Cap runaway agent spend
    Audience
      ML infra teams
      RAG and agent builders
    Providers
      Ollama
      vLLM
      OpenAI
      Gemini

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Deduplicate repeated embedding requests to cut API and compute costs

USE CASE 2

Speed up nightly re-ingest jobs by skipping unchanged document chunks

USE CASE 3

Cap per-key token spend so a runaway agent cannot exhaust the backend

USE CASE 4

Get a report showing how much of current embedding spend is duplicate work

What is it built with?

GoOllamavLLMOpenAI APIGeminiPrometheus

How does it compare?

ajay6601/embedcacheadvayc/wrappedaegrail/aegrail-engine
Stars111
LanguageGoGoGo
Setup difficultymoderateeasyhard
Complexity3/52/55/5
Audienceops devopsgeneralops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Runs as a standalone proxy service you point your app's base_url at, no Redis or Python runtime needed.

License details are not stated in the README excerpt.

In plain English

embedcache is a small standalone program that sits between your application and any service that turns text into embeddings, the numeric vectors used by AI search and retrieval systems. Services like vLLM, Ollama, text embeddings inference, or OpenAI's own API charge for every embedding they compute, and in practice a large share of those requests are duplicates: the same document re-processed on a nightly job, the same question asked over and over, or several parts of a system embedding the same text without knowing it. embedcache sits in front of those backends and catches the repeat work before it reaches them. It works in a few ways at once. It keeps an exact match cache so identical requests are answered instantly from memory instead of being recomputed. If many identical requests arrive at the same moment, it combines them into a single call to the backend instead of sending them all. When a big batch of text comes in, it only sends the pieces it has not seen before. It can also break a document into chunks and only re embed the parts that actually changed after an edit, rather than the whole document. On top of this it enforces per user token budgets so a runaway process cannot burn through the backend's capacity, and it reports, in plain numbers, how much duplicate spend it caught. It is written in Go with no external dependencies, compiles to one binary, and needs no Python runtime or separate cache server like Redis to operate. You run it once, point your applications at it the way you would point them at a proxy, and it works the same regardless of what language those applications are written in. It supports several embedding providers out of the box, including Ollama, vLLM, OpenAI, Gemini, and others. The project is aimed at teams running their own embedding infrastructure at meaningful scale, or teams building retrieval and AI agent systems that repeatedly re embed the same content. The README documents real measured results from its own test suite rather than only projected numbers.

Copy-paste prompts

Prompt 1
Help me set up embedcache in front of my Ollama embedding server to cut duplicate requests
Prompt 2
Explain how embedcache's chunk-diff engine avoids re-embedding a whole document after a small edit
Prompt 3
Show me how to run embedcache analyze against my existing request logs to see duplicate spend
Prompt 4
Walk me through configuring per-key token budgets in embedcache for multiple agents sharing one cache

Frequently asked questions

What is embedcache?

A single Go binary that sits in front of embedding APIs like Ollama or OpenAI and stops duplicate requests from being recomputed, cutting cost and load.

What language is embedcache written in?

Mainly Go. The stack also includes Go, Ollama, vLLM.

What license does embedcache use?

License details are not stated in the README excerpt.

How hard is embedcache to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is embedcache for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.