local-model-fit

local-model-fit is a skill for Claude Code, Codex from zorost/AI-Engineering-Lab. It costs 40 tokens per session (1,151 once invoked), scanned A, original, MIT.

A calculator and planning method for checking whether a local AI model will fit in available GPU memory or computer memory before downloading it. It considers model size, compression settings, context length, and runtime overhead.

In plain words
What is it for?
Use it when choosing a local model and its quantization, planning GPU hardware, or diagnosing CUDA and Apple Metal memory failures.
Why use it?
It prevents trial-and-error downloads and helps explain out-of-memory errors or hardware requirements.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when choosing a local model and its quantization, planning GPU hardware, or diagnosing CUDA and Apple Metal memory failures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zorost/ai-engineering-lab/local-model-fit
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zorost/AI-Engineering-Lab --skill local-model-fit
Clone the repo
git clone --depth 1 https://github.com/zorost/AI-Engineering-Lab

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for local-model-fit

README.md
[![agentmods](https://agentmods.dev/badge/skills/zorost/ai-engineering-lab/local-model-fit/github.svg)](https://agentmods.dev/skills/zorost/ai-engineering-lab/local-model-fit)
Your own site
<a href="https://agentmods.dev/skills/zorost/ai-engineering-lab/local-model-fit"><img src="https://agentmods.dev/badge/skills/zorost/ai-engineering-lab/local-model-fit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for local-model-fit

Your own site · 80×15
<a href="https://agentmods.dev/skills/zorost/ai-engineering-lab/local-model-fit"><img src="https://agentmods.dev/badge/skills/zorost/ai-engineering-lab/local-model-fit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,151 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00040 $0.01151
Opus 5.5 $0.00016 $0.00460
Sonnet 5.5 $0.00008 $0.00230
Haiku 4.5 $0.00004 $0.00115

Measured 3mo ago against content hash f5cf8eb84879, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

local-model-fit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

reference/skills/agent-skills/local-model-fit/SKILL.md · 90 lines

How it starts

The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Local Model Fit

1 · Purpose

Turn "will this model run on my machine?" from a download-and-pray experiment into arithmetic you do before touching the network.

2 · When to use

  • Choosing any local model + quantization for a laptop, workstation, or server.
  • Planning GPU purchases or cloud GPU instances.
  • Debugging CUDA out of memory / Metal allocation failures.

3 · Inputs

  • Your usable GPU VRAM (or unified memory on Apple Silicon, budget ~70% of total RAM for the GPU).
  • The model's parameter count (from its card) and the context length you need.
  • The quantization you are considering (FP16, Q8, Q6_K, Q5_K_M, Q4_K_M…).

4 · Procedure

  1. Compute the weights budget: params (B) × bytes-per-param. FP16 ≈ 2 bytes, Q8 ≈ 1, Q6_K ≈ 0.80, Q5_K_M ≈ 0.68, Q4_K_M ≈ 0.60. A 14B at Q4_K_M ≈ 8.4 GB.
  2. Compute the KV-cache budget: roughly 1 to 2 GB per 8k context for a 7 to 14B model, scaling with layers and heads, when precision matters, serve once and read the actual allocation from the engine's log.
  3. Add runtime overhead: ~1 to 2 GB for the engine, compute buffers, and the OS sharing the GPU.
  4. Total = weights + KV cache + overhead. Require total ≤ 90% of usable VRAM. If over, drop one lever: smaller quant, shorter context, or smaller model, in that preference order for quality preservation.
  5. Pick the model class by task before picking the quant: tool-calling agents need tool-tuned models (e.g. Hermes-class); embeddings need embedding models; chat quality tracks size within a family.
  6. Then pick the quant: Q4_K_M is the default sweet spot; Q5_K_M/Q6_K when quality measurably matters and VRAM allows; Q8 near-lossless; below Q4 only when nothing else fits.
  7. Download, load, and read the engine's actual memory report. Compare against your arithmetic. Investigate any gap over 15%, it means you miscounted the cache.
  8. Benchmark tokens/sec on a representative prompt. A model that fits but crawls below your interactivity floor (often ~10 tok/s for chat) does not "fit".

Read the full file on GitHub · 90 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 90 lines · 40 tokens per session scan A f5cf8eb84879

Subscribe to this mod's changes

local-model-fit is a skill published in the GitHub repository zorost/AI-Engineering-Lab (315 stars, last pushed 3mo ago), licensed MIT. It adds 40 tokens to every session and 1,151 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

local-model-fit compared with skills from other repositories

local-model-fit next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
local-model-fitzorost/AI-Engineering-LabSkill3153mo agoMITA40Claude Code, Codex
fine-tuning-osCasius999/fine-tuning-osSkill03mo agoApache-2.0A125Claude Code, Codex
ai-engineering-toolkitsickn33/agentic-awesome-skillsSkill51kyesterdayMITA47Claude Code
running-openmed-ondevicemaziyarpanahi/openmedSkill5.9ktodayApache-2.0A175Claude Code
tinker-training-costsynthetic-sciences/openscienceSkill4.5kyesterdayApache-2.0A55Claude Code, Codex
transformerssynthetic-sciences/openscienceSkill4.5kyesterdayApache-2.0A63Claude Code, Codex
actual-setupNousResearch/hermes-agentSkill267ktodayMITC16Claude Code, Codex