Commit graph

2 commits

Author SHA1 Message Date
Cesar Garcia
807ba011eb
fix(main): use local tiktoken cache in lazy loading (#19774)
The lazy loading implementation for encoding in __getattr__ was calling
tiktoken.get_encoding() directly without first setting TIKTOKEN_CACHE_DIR.
This caused tiktoken to attempt downloading the encoding file from the
internet instead of using the local copy bundled with litellm.

This fix uses _get_default_encoding() from _lazy_imports which properly
sets TIKTOKEN_CACHE_DIR before loading tiktoken, ensuring the local cache
is used.
2026-01-27 18:16:58 -08:00
Alexsander Hamir
bb4c01ffa0
Add LITELLM_DISABLE_LAZY_LOADING env var to fix VCR cassette creation issue (#18725) 2026-01-06 14:49:11 -08:00