FAILURE MODES

LiteLLM Dropped 46% of Its Ollama Requests From the Spend Log

A LiteLLM operator says 46 percent of its Ollama requests never reached the spend log, with no error. Ollama's reply IDs come from about a thousand values, and LiteLLM keyed the log table on that ID and skipped duplicates.

2026-10-19

A LiteLLM operator says 46 percent of its Ollama requests never reached the spend log, with no error. Ollama’s reply IDs come from about a thousand values; LiteLLM keyed the log table on that ID and skipped duplicates.

From GitHub issue 46403, opened Oct 14, UTC: successful requests to an Ollama backend “leave no row in LiteLLM_SpendLogs, with no error logged”, and “the loss grew from ~10 % to 46 % of all Ollama-backed requests over ten days”. With 464 of the 1000 possible IDs already in the table, 30 days of rows kept, 46 % of new Ollama requests vanished, so the share rises as rows accumulate.

The 39-second reel: LiteLLM dropped 46% of its Ollama requests from the spend log.

Why the rows vanished

The requests succeeded, HTTP 200. Daily totals were right and only per-request rows were lost. It is about Ollama’s OpenAI-compatible /v1 route. One other user reproduced it with a local Ollama.

The mechanism is a collision, not a crash. Ollama hands out reply IDs drawn from about a thousand values. LiteLLM used that provider ID as the key for its spend log table and skipped rows whose key was already there. Every time a new request reused an ID already in the table, its row was dropped silently. The more rows accumulate, the worse it gets: 464 of 1000 IDs in the table meant 46 % of new requests collided.

The fix

PR 39227, merged Oct 16, 00:17 UTC, detects Ollama’s system_fingerprint and gives each reply a unique ID before logging. LiteLLM’s log still keys on the provider ID. The fix is in v1.107.0-rc.1, a prerelease from Oct 18, and not listed in the stable v1.106.0 release notes as of Oct 19.

The PR’s own caveats: a changed or stripped fingerprint leaves collisions unfixed, other providers that reuse IDs are not covered, dropped rows cannot be recovered, and its proof used a scripted upstream, not a real Ollama. Ollama itself is unchanged as of Oct 19.

Our reading, untested: skip-duplicates plus a key you do not control can be silent loss. A check we would try: count rows against requests. Who makes the ID your pipeline treats as unique?

What we did not verify

We did not run LiteLLM or Ollama. The numbers are the operator’s, from one proxy, reported in issue 46403. One other user reproduced the loss with a local Ollama. The fix’s proof used a scripted upstream, not a real Ollama, so the fix itself is unproven against a live Ollama backend as of Oct 19. The script was written with an AI model made by Anthropic, and the voiceover in the reel is AI-generated. Watch the reel on Threads.

This post started as an Instagram post →

Discussion

Talk it through

Argue with us on Instagram.