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 $0.00020 $0.00575
Sonnet 5 $0.00008 $0.00230
Haiku 4.5 $0.00004 $0.00115

Measured 10d ago against content hash f5cf8eb84879, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, 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 10d 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. 10d 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 (309 stars, last pushed 22d ago), licensed MIT. It adds 40 tokens to every session and 1,151 once invoked, about $0.0002 per session on Opus 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

Other skills, from other repositories

fine-tuning-os

Use this skill when conducting a professional LLM fine-tuning engagement in Zero-Data mode via the MCP server fine-tuning-os. Triggers on: prestation de fine-tuning LLM, livraison de modèle affiné, pipeline Zero-Data, orchestration des 64 outils fine-tuning-os, cycle de vie entraînement (préparation / données…

Casius999/fine-tuning-os · 125 tokens

ai-engineering-toolkit

6 production-ready AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.

sickn33/agentic-awesome-skills · 47 tokens

llm-ops

LLM Operations -- RAG, embeddings, vector databases, fine-tuning, prompt engineering avancado, custos de LLM, evals de qualidade e arquiteturas de IA para producao.

davila7/claude-code-templates · 44 tokens

llama-factory

Expert guidance for fine-tuning LLMs with LLaMA-Factory - WebUI no-code, 100+ models, 2/3/4/5/6/8-bit QLoRA, multimodal support.

davila7/claude-code-templates · 51 tokens

running-openmed-ondevice

Run OpenMed models fully on-device with the MLX (Apple Silicon), CoreML (iOS/macOS), or ONNX/WebGPU (cross-platform/browser) backends, including convert-quantize-run workflows. Use when the user wants to deploy OpenMed at the edge, run NER/de-id on Apple Silicon, target iPhone/iPad/Mac, export to ONNX or WebGPU…

maziyarpanahi/openmed · 175 tokens

tinker-training-cost

Calculates training costs for Tinker fine-tuning jobs. Use when estimating costs for Tinker LLM training, counting tokens in datasets, or comparing Tinker model training prices. Tokenizes datasets using the correct model tokenizer and provides accurate cost estimates.

synthetic-sciences/openscience · 55 tokens