llamacpp

llamacpp is a skill for Claude Code from datathings/marketplace. It costs 110 tokens per session (3,934 once invoked), scanned A, original, Apache-2.0.

A reference guide for llama.cpp, a C and C++ library for running large language models locally. It covers the library's programming interface and common workflows.

In plain words
What is it for?
Use it to load models, generate text or chat responses, create embeddings, split text into tokens, control sampling and batching, use LoRA adapters, and manage model state.
Why use it?
It helps when you need to connect a C or C++ application to a local language model and are unsure which functions or steps to use.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the llamacpp plugin — 1 skill shipped together

Good fit Use it to load models, generate text or chat responses, create embeddings, split text into tokens, control sampling and batching, use LoRA adapters, and manage model state.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/datathings/marketplace/llamacpp
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 datathings/marketplace --skill llamacpp
Clone the repo
git clone --depth 1 https://github.com/datathings/marketplace

Made for: Claude Code.

Or install llamacpp, the plugin that ships this one along with the rest of its 1 skill.

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 llamacpp

README.md
[![agentmods](https://agentmods.dev/badge/skills/datathings/marketplace/llamacpp.svg)](https://agentmods.dev/skills/datathings/marketplace/llamacpp)
Your own site
<a href="https://agentmods.dev/skills/datathings/marketplace/llamacpp"><img src="https://agentmods.dev/badge/skills/datathings/marketplace/llamacpp.svg" alt="Measured on agentmods" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,934 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.
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.00110 $0.03934
Opus 5 $0.00055 $0.01967
Sonnet 5 $0.00022 $0.00787
Haiku 4.5 $0.00011 $0.00393

Measured 8d ago against content hash d8246875c0a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

llamacpp 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 8d 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.

plugins/llamacpp/skills/llamacpp/SKILL.md · 252 lines

How it starts

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

llama.cpp C API Guide

Comprehensive reference for the llama.cpp C API, documenting all non-deprecated functions and common usage patterns.

Overview

llama.cpp is a C/C++ implementation for LLM inference with minimal dependencies and state-of-the-art performance. This skill provides:

  • Complete API Reference: All non-deprecated functions organized by category
  • Common Workflows: Working examples for typical use cases
  • Best Practices: Patterns for efficient and correct API usage

Quick Start

See references/workflows.md for complete working examples. Basic workflow:

  1. llama_backend_init() - Initialize backend
  2. llama_model_load_from_file() - Load model
  3. llama_init_from_model() - Create context
  4. llama_tokenize() - Convert text to tokens
  5. llama_decode() - Process tokens
  6. llama_sampler_sample() - Sample next token
  7. Cleanup in reverse order

When to Use This Skill

Use this skill when:

  1. API Lookup: You need to find a specific function (e.g., "How do I load a model?", "What function creates a context?")
  2. Code Generation: You're writing C code that uses llama.cpp
  3. Workflow Guidance: You need to understand the steps for a task (e.g., text generation, embeddings, chat)
  4. Advanced Features: You're working with batches, sequences, LoRA adapters, state management, or custom sampling
  5. Migration: You're updating code from deprecated functions to current API

Core Concepts

Key Objects

  • llama_model: Loaded model weights and architecture
  • llama_context: Inference state (KV cache, compute buffers)
  • llama_batch: Input tokens and positions for processing
  • llama_sampler: Token sampling configuration
  • llama_vocab: Vocabulary and tokenizer
  • llama_memory_t: KV cache memory handle

Typical Flow

  1. Initialize: llama_backend_init()
  2. Load Model: llama_model_load_from_file()
  3. Create Context: llama_init_from_model()
  4. Tokenize: llama_tokenize()
  5. Process: llama_encode() or llama_decode()
  6. Sample: llama_sampler_sample()
  7. Generate: Repeat steps 5-6
  8. Cleanup: Free in reverse order

Read the full file on GitHub · 252 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 252 lines · 110 tokens per session scan A d8246875c0a0

Subscribe to this mod's changes

llamacpp is a skill published in the GitHub repository datathings/marketplace (11 stars, last pushed 11d ago), licensed Apache-2.0. It adds 110 tokens to every session and 3,934 once invoked, about $0.0006 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.