litellm/tests
ryan-crabbe-berri d7bde6c4bb feat(proxy): add token_count_local_fallback to count locally when a provider count fails
Since #46121 the proxy answers the provider's error when a count-tokens call fails,
so a Bedrock Nova or Llama deployment answers 400 on /v1/messages/count_tokens where
1.92.0 answered a local estimate. litellm_settings.token_count_local_fallback: true
brings that fallback back as an opt-in. The provider is still asked first, any failure
falls back to the local estimate when local counting is allowed, the response says
litellm_count_source: local_estimate, and one warning names the provider status.
disable_token_counter still wins. Default off, so fail-closed stays the default

Refs LIT-9763
2026-10-20 15:34:53 -07:00
..
_support fix(proxy)!: end a chat completions stream with an error event when a guardrail blocks mid-stream (#46953) 2026-10-17 18:00:12 -07:00
base_sdk_tests fix(sdk): decide MCP gateway routing without importing the proxy handler (#45961) 2026-10-20 01:44:54 +00:00
benchmarks fix(anthropic): keep trailing user messages with None or empty list content (#41397) 2026-10-16 07:41:05 +00:00
code_coverage_tests fix(harness): set PWD to the working directory of local sandbox commands (#47530) 2026-10-20 20:06:11 +00:00
documentation_tests
e2e test(perf): tag a UI journey sample with its API response, not a Next.js prefetch under /ui/ (#47650) 2026-10-20 14:59:34 -07:00
e2e_harness test(perf): emit a top-contributors breakdown property per perf metric (#47632) 2026-10-20 13:48:10 -07:00
fixtures test: migrate tests/llm_translation into unit, integration and e2e tiers (#45759) 2026-10-11 07:58:53 +00:00
harness_e2e fix(harness): set PWD to the working directory of local sandbox commands (#47530) 2026-10-20 20:06:11 +00:00
integration feat(proxy): add token_count_local_fallback to count locally when a provider count fails 2026-10-20 15:34:53 -07:00
rust-python-harness feat(rust): encode LiteLLM response ids on native responses (#46572) 2026-10-18 20:52:34 -07:00
test_litellm_rust refactor(rust-bridge): detect Python-only features in the catalog instead of Rust declines (#46714) 2026-10-20 15:06:25 -07:00
typing
unit feat(proxy): add token_count_local_fallback to count locally when a provider count fails 2026-10-20 15:34:53 -07:00
windows_tests
__init__.py
_fake_openai_endpoint_server.py
_flush_vcr_cache.py
_live_test_helpers.py
_master_key.py
_openai_record_replay_proxy.py
_process_helpers.py
_vcr_conftest_common.py test: migrate tests/llm_translation into unit, integration and e2e tiers (#45759) 2026-10-11 07:58:53 +00:00
_vcr_redis_persister.py
_wait_helpers.py
_ws_vcr.py
AGENTS.md
capturing_transport.py
eval_swe_bench.py
fake_openai_endpoint.py
gettysburg.wav
large_text.py
openai_batch_completions.jsonl
pyrightconfig.json
README.MD
test_logging.conf
test_rust_python_harness.py
VCR_TESTING.md test: migrate tests/llm_translation into unit, integration and e2e tiers (#45759) 2026-10-11 07:58:53 +00:00
white_100x100.png

In total litellm runs 1000+ tests

[02/20/2025] Update:

To make it easier to contribute and map what behavior is tested,

we've started mapping the litellm directory in tests/unit

This folder can only run mock tests.