diegosouzapw/OmniRoute · error · Error

Failed to download ${url}: HTTP ${resp.status}

Error message

Failed to download ${url}: HTTP ${resp.status}

What it means

Error "Failed to download ${url}: HTTP ${resp.status}" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/memory/embedding/staticPotion.ts:48

  dim: number;
  vocabSize: number;
  unkIdx: number;
}

// Singleton state
let _model: PotionModel | null = null;
let _loading: Promise<PotionModel> | null = null;

/** For testing: inject a mock model, bypassing download. */
export function _injectModel(model: PotionModel | null): void {
  _model = model;
  _loading = null;
}

async function downloadFile(url: string, dest: string): Promise<void> {
  const resp = await fetch(url);
  if (!resp.ok) {
    throw new Error(`Failed to download ${url}: HTTP ${resp.status}`);
  }
  const buf = await resp.arrayBuffer();
  await fs.writeFile(dest, Buffer.from(buf));
}

async function ensureFile(filePath: string, url: string): Promise<void> {
  try {
    await fs.access(filePath);
  } catch {
    await downloadFile(url, filePath);
  }
}

/**
 * Parse safetensors format to extract the first float32 tensor.
 * Header format: 8-byte little-endian uint64 = header_len, then JSON header,
 * then raw tensor bytes.
 */

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/memory/embedding/staticPotion.ts:48 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/cc2e9c868519d92b. Report an issue: GitHub.