(modelInfo: Record<string, unknown> | undefined | null)
| 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. */ |
| 32 | export 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 |
no outgoing calls
no test coverage detected