linshenkx/prompt-optimizer · warning · RequestConfigError

Chrome built-in AI model is still downloading. Please wait f

Error message

Chrome built-in AI model is still downloading. Please wait for the download to finish.

What it means

The Chrome built-in AI model availability check returned 'downloading': Gemini Nano weights are currently being fetched but are not ready, so createReadySession refuses to create a session until the download completes.

Source

Thrown at packages/core/src/services/llm/adapters/chrome-built-in-adapter.ts:115

      session.destroy?.()
    }
  }

  protected getParameterDefinitions(_modelId: string): readonly ParameterDefinition[] {
    return []
  }

  protected getDefaultParameterValues(_modelId: string): Record<string, unknown> {
    return {}
  }

  private async createReadySession(initialPrompts?: ChromeLanguageModelPrompt[]) {
    const status = await checkChromeBuiltInAvailability()
    if (status.availability === 'downloadable') {
      throw new RequestConfigError('Chrome built-in AI model is not downloaded. Open the model manager and click download to prepare it.')
    }
    if (status.availability === 'downloading') {
      throw new RequestConfigError('Chrome built-in AI model is still downloading. Please wait for the download to finish.')
    }
    if (status.availability !== 'available') {
      throw new RequestConfigError(status.error || 'Chrome built-in AI is not available in this browser.')
    }

    return await createChromeBuiltInSession(initialPrompts?.length ? { initialPrompts } : {})
  }

  private buildPrompt(messages: Message[]): {
    initialPrompts?: ChromeLanguageModelPrompt[]
    prompt: ChromeLanguageModelPromptInput
  } {
    const normalizedMessages = messages
      .map((message) => ({
        role: message.role,
        content: message.content.trim()
      }))
      .filter((message) => message.content)

View on GitHub (pinned to 3e677b1d9f)

Solutions

  1. Wait for the download to complete (check chrome://components) and retry after it finishes
  2. Poll availability on an interval instead of retrying immediately
  3. Show download progress in the UI so users don't retry in a tight loop
  4. Once complete, call session() again — no config change needed

Example fix

// before
const s = await adapter.session()

// after
async function waitForReady(adapter, tries = 30) {
  for (let i = 0; i < tries; i++) {
    try { return await adapter.session() }
    catch (e: any) {
      if (e instanceof RequestConfigError && /still downloading/.test(e.message)) {
        await new Promise(r => setTimeout(r, 5000)); continue
      }
      throw e
    }
  }
  throw new Error('Model download did not finish in time')
}
Defensive patterns

Strategy: retry

Validate before calling

import { checkChromeBuiltInAvailability } from '...'
const status = await checkChromeBuiltInAvailability()
if (status.availability === 'downloading') showSpinnerUntilAvailable()

Type guard

null

Try / catch

try { return await adapter.session() }
catch (e) {
  if (e instanceof RequestConfigError && /still downloading/.test(e.message)) {
    await sleep(5000); return adapter.session() // bounded retries
  }
  throw e
}

Prevention

When it happens

Trigger: Calling session() while the on-device model component is mid-download; retrying immediately after triggering the download in the model manager.

Common situations: Impatient retry loops right after first enabling the feature; slow connections downloading the ~multi-GB component; multiple tabs racing the download.

Related errors


AI-assisted analysis of linshenkx/prompt-optimizer@3e677b1d9f (2026-08-27). Data as JSON: /api/errors/1bb719aeb6737080. Report an issue: GitHub.