Skip to content

perf: the whole LLM stack is imported eagerly (~2 CPU-seconds per process, even for --version and --no-llm) #865

Open

Description

@naamanhirschfeld-armis

Environment: SkillSpector main cf5cac7 (version string 2.12.0), Python 3.12, macOS, --no-llm. Profiled on a 71-file, 431 KB skill.

Every invocation pays ~2 CPU-seconds before reading a file: skillspector --version takes 1.9 s user + 0.9 s sys; a 1.7 KB skill takes 5.4 s wall.

-X importtime cumulative: skillspector.constants 1.77 s (via model_info into anthropic), langchain_anthropic 1.78 s, langgraph.graph 2.4 s, langchain_openai 0.42 s.

Callers that scan one skill per process (e.g. a per-skill CI wrapper over 249 skills) spend ~10 CPU-minutes on imports alone. Suggest importing providers and langchain lazily and not importing model_info from constants. Related, closed: #435 (--help import cost).

Activity

  1. agentsope commented on Oct 19, 2026

    @agentsope
    Contributor

    Opened #876 for the installed CLI version-query path (--version / -v) only. Static --no-llm scan imports remain unchanged, so this issue should stay open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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