Skip to content

enhancement: reduce CLI cold start time #185

Closed

Description

@ajianaz

Problem

CLI single-shot mode takes ~3 seconds because it loads the ONNX model from scratch every invocation. Server mode solves this (~42ms warm recall), but CLI should also be fast for interactive use.

Current Bottleneck

uteke recall "query"
  ├── Load ONNX session (~2.5s) — main bottleneck
  ├── Tokenize + embed (~50ms)
  ├── Vector search (~5ms)
  └── SQLite lookup (~1ms)

Options

# Approach Speedup Effort
1 Daemon mode — background uteke-serve auto-start, CLI talks to it ~3s → ~50ms High
2 Shared memory mmap — keep model in shared memory between invocations ~3s → ~500ms Medium
3 Lazy model init — only load model when embedding needed (skip for list, tags, forget) Partial Low
4 Smaller model — switch from 300M to smaller embedding model Depends on model Medium

Recommendation

Start with Option 3 (lazy init) as quick win — many commands do not need embedding at all. Then explore Option 1 (daemon) for v0.1.0.

Target

  • v0.0.9: lazy init (option 3)
  • v0.1.0: daemon mode (option 1)

Activity

  1. added
    scope:cli
    type:feature
    enhancement
    v0.0.14
    priority:high
    and removed
    type:feature
    on Jun 7, 2026
  2. added this to the milestone on Jun 11, 2026
  3. added
    v0.1.0
    and removed
    v0.0.14
    on Jun 11, 2026
  4. added a commit that references this issue on Jun 11, 2026
  5. added 2 commits that reference this issue on Jun 12, 2026
  6. added 3 commits that reference this issue on Aug 13, 2026
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

    enhancementpriority:highscope:cliv0.1.0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions