litellm/tests/unit/llms/ollama
izzybn 603b30f556
fix(ollama): send model-info lookups to the call's api_base with its key and retry failed ones (#53830)
* fix(ollama): send model-info lookups to the call's api_base with its key

* fix(decisions): read only the cost map for a model's catalog mode

* test(ollama): wait for each call's success logging before counting lookups

* fix(ollama): retry failed model-info lookups and send every lookup to the call's api_base with its key

* fix(ollama): send the request's Authorization bearer token on model-info lookups before api_key

* fix(ollama): retry failed lookups once a minute, strip Lemonade's chat path, and key the cache on api_base only where the lookup reads it

* fix(ollama): withhold keys behind non-Bearer auth headers and keep get_model_info returning dicts

Lookups send no key when the call carries a non-Bearer Authorization header. Public get_model_info on the Ollama and Lemonade configs returns a dict again, with failures kept for the per-call path through look_up_model_info. A direct keyed litellm.get_model_info call stays uncached as before, and Ollama embeddings record the call target without firing pre-call callbacks

* fix(ollama): keep slow lookup failures, look up max tokens and cache hits at the call target

* test(ocr): register test prices instead of stubbing the model info lookup

* fix(ollama): send the caller key only with the call's own api_base and keep keyed get_model_info uncached

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-24 08:51:25 -08:00
..
__init__.py test: move tests/test_litellm/llms into tests/unit/llms (#43191) 2026-09-25 12:43:23 -07:00
test_ollama_chat_transformation.py refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
test_ollama_completion_transformation.py fix(mcp)!: answer 400 for a hosted MCP tool a translated route cannot run, drop it under drop_params (#48931) 2026-11-02 13:13:03 -08:00
test_ollama_embedding.py fix(ollama): send model-info lookups to the call's api_base with its key and retry failed ones (#53830) 2026-11-24 08:51:25 -08:00
test_ollama_model_info.py fix(ollama): send model-info lookups to the call's api_base with its key and retry failed ones (#53830) 2026-11-24 08:51:25 -08:00
test_ollama_text_completion.py test: migrate local_testing SDK and provider tests out of build_and_test (#45760) 2026-10-10 23:14:25 +00:00