fix(providers): increase model probe timeout for local LLM servers#515
fix(providers): increase model probe timeout for local LLM servers#515
Conversation
Local LLM servers (llama.cpp, Ollama, etc.) often need 10-20+ seconds to load a model into memory before streaming the first token. The previous 10-second timeout caused most models to fail selection during provider setup. - Increase models.test and validation probe timeouts from 10s to 30s - Treat timeout as non-blocking in the single-model save flow (save the model with a warning instead of rejecting it) - Show "Slow" badge instead of "Unsupported" for timed-out probes in the multi-model selector - Add regression tests with SlowStartProvider mock Closes #514 Entire-Checkpoint: 1b5ed6ad8d52
Merging this PR will improve performance by 19.39%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ⚡ | env_substitution |
12.1 µs | 10.1 µs | +19.39% |
Comparing time-fabrosaurus (636eccd) with main (e77c74d)
Footnotes
-
5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Greptile SummaryThis PR fixes #514 by raising model-probe timeouts from 10 s to 30 s throughout the stack (Rust backend, provider-validation flow, per-probe constant) to support local LLM servers (llama.cpp, Ollama, etc.) that require extra time for a cold-start. On the frontend, timed-out probes are demoted from blocking errors to soft warnings — the model is saved anyway in the single-model flow, and the multi-model selector replaces the alarming red "Unsupported" badge with a neutral "Slow" badge. Two regression tests (one with paused time, so no CI wall-clock cost) guard the 30 s boundary. Key changes:
Issue found:
Confidence Score: 4/5Safe to merge for the Settings → Providers flow; however the onboarding wizard retains the blocking-error behavior for slow local LLMs that the PR explicitly aimed to fix. The Rust backend changes, new tests, and providers.js fixes are all correct. The one remaining P1 is that onboarding-view.js — which shares the same probeModelAsync / testModel pattern — was not updated: timeout still aborts the onboarding save and still renders "Unsupported". This directly contradicts the PR's stated goals for new users setting up a local LLM during onboarding, so a 4 is appropriate until that path is patched. crates/web/src/assets/js/onboarding-view.js — both Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant providers.js
participant onboarding-view.js
participant provider-validation.js
participant Rust
Note over providers.js,Rust: Single-model save (providers.js — UPDATED)
User->>providers.js: Select model, click Save
providers.js->>Rust: testModel(modelId)
Rust-->>providers.js: timeout after 30s
providers.js->>provider-validation.js: isTimeoutError(error)
provider-validation.js-->>providers.js: true
providers.js->>providers.js: Save model + show Slow hint ✅
Note over onboarding-view.js,Rust: Single-model save (onboarding-view.js — NOT UPDATED)
User->>onboarding-view.js: Select model, complete onboarding
onboarding-view.js->>Rust: testModel(modelVal)
Rust-->>onboarding-view.js: timeout after 30s
onboarding-view.js->>onboarding-view.js: setError, return — blocks save ❌
Note over providers.js,Rust: Probe badge (providers.js — UPDATED)
providers.js->>Rust: testModel(modelId)
Rust-->>providers.js: timeout
providers.js->>provider-validation.js: isTimeoutError(error)
provider-validation.js-->>providers.js: true
providers.js->>providers.js: badge = tier-badge Slow ✅
Note over onboarding-view.js,Rust: Probe badge (onboarding-view.js — NOT UPDATED)
onboarding-view.js->>Rust: testModel(modelId)
Rust-->>onboarding-view.js: timeout
onboarding-view.js->>onboarding-view.js: badge = provider-item-badge warning Unsupported ❌
Reviews (2): Last reviewed commit: "fix(providers): address PR review feedba..." | Re-trigger Greptile |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
- Use tokio start_paused=true in timeout test to avoid 30s CI wait - Reduce VALIDATION_MAX_TIMEOUTS from 3 to 1 (worst-case stays ~30s) - Show user-visible hint when model save succeeds despite timeout - Extend modal auto-close to 3.5s when slow hint is shown Entire-Checkpoint: 79aa5c9d511d
Summary
models.testand provider validation probe timeouts from 10s to 30s to accommodate local LLM servers that need time to load models into memory before respondingisTimeoutError()helper to distinguish timeout from other probe failuresCloses #514
Validation
Completed
cargo +nightly-2025-11-30 fmt --all -- --checkpassescargo clippy -p moltis-chat -p moltis-provider-setup --all-targets -- -D warningspassesbiome check --writeon changed JS filesmodel_probe_succeeds_with_slow_start_provider— SlowStartProvider with 2s delay succeeds within 30s timeoutmodel_probe_times_out_for_unresponsive_provider— 120s delay provider correctly times out at ~30sRemaining
./scripts/local-validate.sh 515(full validation suite)Manual QA
🤖 Generated with Claude Code