litellm/tests/test_litellm/llms/ollama
mateo-berri a64febb3e7 fix(streaming): keep an explicit provider prompt_tokens=0 or completion_tokens=0 in streamed usage
The stream chunk builder started its per-chunk accumulators at 0 and adopted only nonzero counts, then fell back to litellm's tokenizer whenever the accumulated value was falsy, so a provider that reported an explicit 0 for prompt or completion tokens was billed the estimate instead. The accumulators now start at None, a usage chunk that reports a count marks it reported (a later chunk's 0 never replaces a reported nonzero), and the estimate only runs when no chunk reported the count. The Anthropic message_start cursor reset now yields None so the estimate still covers a cancelled stream, and Ollama chat streaming only attaches usage on the done chunk when both counts are present instead of inventing 0/0 on every chunk
2026-09-21 14:01:08 -07:00
..
test_ollama_chat_transformation.py fix(streaming): keep an explicit provider prompt_tokens=0 or completion_tokens=0 in streamed usage 2026-09-21 14:01:08 -07:00
test_ollama_completion_transformation.py perf: move Anthropic, Vertex Anthropic, Ollama and HF template fetches off the event loop (#40311) 2026-09-08 15:53:43 -07:00
test_ollama_embedding.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_ollama_model_info.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00