发布

  • fix(packaging): resolve tiktoken plugin discovery in frozen builds (#3959)

    frostbyte_neo 发布于 2026-07-12 09:48:56 +00:00

    litellm imports tiktoken at module load and calls get_encoding("cl100k_base")
    immediately. tiktoken finds that encoding by walking the tiktoken_ext
    namespace package with pkgutil.iter_modules, which only sees loose files on
    disk and comes back empty inside a PyInstaller frozen binary -- crashing
    opensre investigate with ValueError: Unknown encoding cl100k_base and
    Plugins found: [] for anyone using the curl installer with LiteLLM/Azure
    OpenAI (issue #3631).

    Bootstrap tiktoken's registry to import tiktoken_ext.openai_public directly
    before litellm is imported, bypassing the broken directory walk, and hidden-
    import that module in the release PyInstaller build so it is actually bundled.

    下载附件