Skip to content

fix: use per-call sessions for embeddings to prevent timeout on large collections#420

Open
debugerman wants to merge 1 commit intotobi:mainfrom
debugerman:main
Open

fix: use per-call sessions for embeddings to prevent timeout on large collections#420
debugerman wants to merge 1 commit intotobi:mainfrom
debugerman:main

Conversation

@debugerman
Copy link
Copy Markdown
Contributor

The old design wrapped the entire embedding loop in a single LLM session with a 30-minute maxDuration cap. For collections exceeding ~39k chunks, the session timer would fire mid-loop and all remaining embeddings would fail with SessionReleasedError.

Each embed/embedBatch call now gets its own short-lived session with the default 10-minute timeout, which is more than sufficient for a single batch of ≤32 texts.

Closes #410

… collections

  The old design wrapped the entire embedding loop in a single LLM session
  with a 30-minute maxDuration cap. For collections exceeding ~39k chunks,
  the session timer would fire mid-loop and all remaining embeddings would
  fail with SessionReleasedError.

  Each embed/embedBatch call now gets its own short-lived session with the
  default 10-minute timeout, which is more than sufficient for a single
  batch of ≤32 texts.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Embedding fails after ~39,000 chunks on large documents

1 participant