MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / extractBlockCount

Function extractBlockCount

src/setup/offload-detect.ts:32–38  ·  view source on GitHub ↗
(modelInfo: Record<string, unknown> | undefined | null)

Source from the content-addressed store, hash-verified

30/** Pull the transformer block count out of an Ollama /api/show `model_info` map. The key is
31 * arch-prefixed (e.g. `qwen3.block_count`, `llama.block_count`), so match on the suffix. PURE. */
32export function extractBlockCount(modelInfo: Record<string, unknown> | undefined | null): number | null {
33 if (!modelInfo) return null;
34 for (const [k, v] of Object.entries(modelInfo)) {
35 if (/\.block_count$/.test(k) && typeof v === 'number' && v > 0) return v;
36 }
37 return null;
38}
39
40// ── best-effort detectors (impure) ───────────────────────────────────────────────
41

Callers 2

fetchOllamaModelFactsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected