Skip to content

Commit 7367dc9

Browse files
committed
fix: increase chat model loading timeout to 10 min (MoE expert pre-warming)
1 parent 96aa638 commit 7367dc9

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

cake-cli/src/chat.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,10 +1154,11 @@ pub async fn run_local(ctx: &mut Context) -> Result<()> {
11541154
});
11551155
});
11561156

1157-
// Wait for the API server to be ready (model loading can take seconds)
1157+
// Wait for the API server to be ready (large MoE models with expert pre-warming can take minutes)
11581158
let client = Client::new();
11591159
let mut ready = false;
1160-
for i in 0..120 {
1160+
let max_wait_iters = 1200; // 600 seconds = 10 minutes
1161+
for i in 0..max_wait_iters {
11611162
tokio::time::sleep(std::time::Duration::from_millis(500)).await;
11621163
match client.get(format!("{server_url}/v1/models")).send().await {
11631164
Ok(resp) if resp.status().is_success() => {
@@ -1173,7 +1174,7 @@ pub async fn run_local(ctx: &mut Context) -> Result<()> {
11731174
}
11741175

11751176
if !ready {
1176-
anyhow::bail!("local server did not start within 60 seconds");
1177+
anyhow::bail!("local server did not start within {} seconds", max_wait_iters / 2);
11771178
}
11781179

11791180
// Suppress logs and take over terminal for TUI

0 commit comments

Comments
 (0)