Skip to content

fix(core): robust embedding model download (#740)#744

Merged
ajianaz merged 2 commits into
developfrom
fix/issue-740-download-timeout
Jul 19, 2026
Merged

fix(core): robust embedding model download (#740)#744
ajianaz merged 2 commits into
developfrom
fix/issue-740-download-timeout

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #740 — embedding model download fails on first run.

Problem

had several issues:

  1. No timeout — with infinite timeout. Slow HF connections → hang
  2. Full RAM buffer — loaded entire 187MB model_q4.onnx_data into memory at once
  3. No retry — any transient network error → permanent failure
  4. No progress — user sees nothing, assumes crash

Changes

  • Timeout: 30s connect, 300s read (generous for 187MB over slow connections)
  • Retry: Up to 3 attempts with cleanup of partial downloads between retries
  • Streaming: 64KB chunked write to disk — avoids buffering 187MB in RAM
  • Progress: Shows file name, total size, percentage milestones (every 10%)
  • Integrity: Verifies downloaded bytes match Content-Length when available
  • Cleanup: Removes partial .tmp files on retry/failure

Testing

  • cargo fmt
  • cora review
  • Full clippy/test will run in CI (Woodpecker)

Closes #740

…ming (#740)

- Add connect timeout (30s) and read timeout (300s) to prevent
  infinite hangs on slow/unstable connections
- Retry up to 3 attempts on transient failures with cleanup
- Stream download to disk via 64KB chunks instead of buffering
  entire 187MB model_data file in RAM
- Add progress indicator (file size + percentage milestones)
- Add human-readable byte formatting (KB/MB/GB)
- Verify content-length matches downloaded bytes
@ajianaz ajianaz self-assigned this Jul 19, 2026
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

No issues found. Code looks good!


Review powered by cora-cli · BYOK · MIT

@ajianaz
ajianaz merged commit 682235b into develop Jul 19, 2026
8 checks passed
@ajianaz
ajianaz deleted the fix/issue-740-download-timeout branch July 19, 2026 14:25
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.

[BUG] issues downloading embedding model on first run

1 participant