Files
letta-server/letta
Kian Jones abb13ef352 fix: Remove nltk blocking download and make azure model listing non-blocking (#6214)
* Fix event loop blocking in NLTK downloads and Azure model listing

Found via watchdog detecting 61.6s hang during file upload.

**Root causes:**
1. NLTK punkt_tab downloads blocking during file processing
2. Azure model listing using sync requests.get() in async context

**Fixes:**
1. Pre-download NLTK data at Docker build time
2. Async fallback download at startup if build failed
3. Move Azure model fetch to thread pool with asyncio.to_thread()

**Impact:**
- Eliminates 60+ second event loop hangs
- Startup: instant if data baked in, ~60s async if needs download
- Requests: never block, all I/O offloaded to threads

* Fix Docker build: ensure /root/nltk_data exists even if download fails

- Create directory before download attempt
- Add verification step to confirm download success
- Directory always exists so COPY won't fail in runtime stage

* Fix: use venv python for NLTK download in Docker build

The builder stage installs NLTK in /app/.venv but we were using
system python which doesn't have NLTK. Now using venv python so
download actually works.

* Use uv run for NLTK download (more idiomatic)

uv run automatically uses the synced venv, cleaner than hardcoding
the venv path.
2025-11-24 19:09:33 -08:00
..
2025-10-07 17:50:45 -07:00
2025-10-07 17:50:45 -07:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00
2025-11-13 15:40:38 -08:00
2025-10-07 17:50:45 -07:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00
2025-10-07 17:50:49 -07:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00
2025-09-17 15:47:40 -07:00