LG

    llm gpu fit

    by Postlethwaite Labs

    2

    Stop OOM crashes with architecture-aware VRAM estimation and 3-way agent compatibility checks for local LLMs.

    Free

    7 uses5.0 (1 review)

    Works with the AI Agents you already use

    LG

    llm gpu fit

    Example session with this skill installed

    I have an 11GB RTX 2080 Ti. Can I run Llama 3.1 8B or Qwen2.5 7B if I need a 128K context window for my agent? Show me the math for the KV cache.

    • Read your context and instructions
    • Compiled the llm gpu fit

    I have analyzed the resource requirements for Llama 3.1 8B and Qwen2.5 7B against an 11GB VRAM budget with a 128K context requirement. ## GPU Fit Analysis (11GB VRAM) | Model | Arch | Weights (Q4) | KV Cache (128K) | Total Est. | Status | | :--- | :--- | :--- | :--- | :--- | :--- | | **Qwen2.5 7B** | GQA | 4.7 GB | ~2.1 GB | 7.8 GB | ✅ **FIT** | | **Llama 3.1 8B** | MHA | 4.9 GB | ~16.0 GB | 21.9 GB | ❌ **OOM** | ### Technical Breakdown * **Architecture Impact:** Llama 3.1 uses Multi-Head Attention (MHA), where KV cache grows linearly and heavily (1x). At 128K context, the cache alone exceeds your total VRAM. * **GQA Advantage:** Qwen2.5 uses Grouped-Query Attention (GQA), reducing the KV cache footprint by approximately 8x. This allows the model + full context + 1GB system headroom to fit comfortably within 11GB. * **Agent Compatibility:** Both models use standard `content` fields for responses, making them suitable for agentic workflows, unlike newer "thinking" models (e.g., Llama 3.2 3B-Instruct or Qwen2.5-7B-Reasoning). **Next steps** 1. Pull the GQA model: `ollama run qwen2.5:7b` 2. Create a 128K context variant: `curl http://localhost:11434/api/create -d '{"name":"qwen-128k","from":"qwen2.5:7b","parameters":{"num_ctx":131072}}'` 3. Verify the agent endpoint: `curl http://localhost:11434/v1/chat/completions -d '{"model":"qwen-128k","messages":[{"role":"user","content":"test"}]}'`

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem

    Running local LLMs often leads to OOM crashes or empty agent responses because standard VRAM math ignores KV cache growth and architectural differences. You waste hours downloading 10GB models only to find they lack the context window your agent requires or hide reasoning in non-standard fields.

    What it does

    • Performs architecture-aware VRAM estimation by calculating KV cache costs for MHA, GQA, and MQA models.
    • Conducts a 3-way fit check verifying VRAM headroom, context window minimums, and agent field compatibility.
    • Identifies models that break OpenAI-compatible tools by routing output to "thinking" fields instead of the standard content field.
    • Provides precise curl commands to verify model loading and create custom context length variants without re-downloading weights.

    Frameworks & tools

    Ollama, NVIDIA SMI, CUDA, and OpenAI-compatible inference servers.

    Why this beats prompting it yourself

    Generic LLMs often use "paper math" that underestimates memory usage by ignoring the tokeniser and CUDA context overhead. This skill uses empirical data from real hardware testing to account for the specific multipliers in modern architectures like Qwen and Llama.

    Use cases

    • Pre-flighting a model selection for a local agent requiring a 64K+ context window.
    • Debugging why a model "fits" on paper but fails to return content to your application.
    • Optimizing GPU utilization by switching from MHA to GQA models for long-context tasks.
    • Automating the creation of model variants with specific num_ctx parameters.

    Known limitations

    Estimates are based on Q4_K_M quantization as the baseline. Real VRAM usage may vary slightly based on specific driver versions and system background tasks.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    5.0
    1 review
    5
    1
    4
    0
    3
    0
    2
    0
    1
    0

    This skill has been used 7 times.

    Frequently Asked Questions

    This skill prevents Out-of-Memory (OOM) crashes by providing precise VRAM estimations that account for architectural nuances like Grouped-Query Attention (GQA) and KV cache growth, which standard calculators often ignore.

    It is designed for local inference environments using Ollama, NVIDIA SMI, and OpenAI-compatible servers, ensuring your selected model is compatible with your agent's specific context window and field requirements.

    The skill performs a '3-way fit check' that verifies if a model has enough VRAM headroom, meets your minimum context window needs, and correctly maps output fields so your agent doesn't receive empty responses.

    Yes, the skill provides specific commands to help you create and verify model variants with custom context lengths (num_ctx) without the need to re-download large weight files.

    You receive the full agent skill logic, integration instructions for local MLOps workflows, and the empirical data sets used to calculate overhead for modern architectures like Llama and Qwen.

    Estimates use Q4_K_M quantization as the primary baseline; while highly accurate, actual usage may vary slightly depending on your specific GPU driver version and background system processes.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.

    Free