Commit Graph
1 Commits
Author SHA1 Message Date
307953188b fix(llm): keep LiteLLM's bundled tiktoken encodings offline on Windows (#2982)
LiteLLM's win_amd64 wheels ship the bundled cl100k/o200k/p50k encoding
files with CRLF line endings. They fail tiktoken's SHA-256 check, so
tiktoken deletes them and downloads the encoding again. Where
openaipublic.blob.core.windows.net is slow or blocked, the first token
count hangs (the 30s count_tokens timeouts in LANG-392), and LiteLLM's
cost calculation on the event loop waits on the same import lock, which
froze Core during the 4.11.6 Windows release gate.

Before LiteLLM is imported, write LF copies into data/tiktoken_cache and
point CUSTOM_TIKTOKEN_CACHE_DIR at them. No-op when the variable is set
or the bundled files are already LF (Linux/macOS wheels, Docker).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-11 16:41:10 +08:00