Skip to content

perf: Significant litellm import bottleneck in MTP runtime #3051

@nk243547

Description

@nk243547

Feature Description

Examples

# Current (problematic):
import litellm  # - Around 2s delay at module load

def call_model(...):
    response = litellm.completion(...)  # Already loaded

# Proposed (lazy loading):
def get_litellm():
    import litellm  # - Only imported when actually needed
    return litellm

def call_model(...):
    litellm = get_litellm()  # - Import happens here
    response = litellm.completion(...)
 -->

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions