mooncake-api

Development guidance for Mooncake’s Python APIs, which support shared storage and high-speed data transfer for machine-learning systems. It covers a distributed key-value cache, tensor storage, network transfers, service setup, replication, and integrations with model-serving tools.

In plain words
What is it for?
Use it to configure Mooncake services, store PyTorch tensors, transfer data over RDMA or TCP, manage buffers and batches, and connect Mooncake with vLLM or SGLang.
Why use it?
It helps choose the right Mooncake setup and avoids mixing low-level storage or transfer instructions with framework-specific configuration.

Skill for Claude CodeCodex

Part of the mooncake-api plugin — 1 skill shipped together

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.

agentmods
npx agentmods add skills/kvcache-ai/mooncake/mooncake-api
Any agent
npx skills add kvcache-ai/Mooncake --skill mooncake-api
Clone the repo
git clone --depth 1 https://github.com/kvcache-ai/Mooncake

Made for: Claude Code, Codex.

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

Per session 122 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,106 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
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 $0.00122 $0.04106
Opus 5 $0.00061 $0.02053
Sonnet 5 $0.00024 $0.00821
Haiku 4.5 $0.00012 $0.00411

Measured 3d ago against content hash 67a219d00ba9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mooncake-api scanned grade A with 1 finding 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 3d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl http://localhost:50051
.claude/skills/mooncake-api/SKILL.md · 538 lines

How it starts

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

Mooncake Python API Skill

Use this skill to help users work with Mooncake Python APIs for distributed storage and high-performance data transfer.

When to Use This Skill

Use this skill when users ask about:

  • Using Mooncake Store for distributed KV cache storage
  • Using Transfer Engine for RDMA/TCP data transfers
  • Setting up Mooncake services (master, metadata server)
  • Working with PyTorch tensors in Mooncake Store
  • Zero-copy operations and buffer management
  • Batch operations and replication configuration
  • Mooncake EP (Expert Parallelism) and Mooncake Backend
  • Troubleshooting Mooncake Python API issues

Routing Guidance

  • For most vLLM and SGLang users, start from docs/source/getting_started/quick-start.md.
  • For PD disaggregation, direct users to the SGLang/vLLM integration guides listed in Quick Start. Those guides own the serving-framework configuration.
  • For Mooncake Store integrations, direct users to the SGLang/vLLM Store setup guides listed in Quick Start. Do not duplicate mooncake_master startup commands in general API answers unless the user is working outside those frameworks.
  • For direct low-level Transfer Engine usage, use docs/source/design/transfer-engine/index.md#using-transfer-engine-in-your-projects.
  • For API signatures and method details, use the Python API references under docs/source/python-api-reference/.

Core Components

1. Mooncake Store (Distributed KV Cache)

Import:

from mooncake.store import MooncakeDistributedStore, ReplicateConfig

Basic Setup:

store = MooncakeDistributedStore()
store.setup(
    "localhost",                          # local_hostname
    "http://localhost:8080/metadata",     # metadata_server
    512*1024*1024,                        # global_segment_size (512MB)
    128*1024*1024,                        # local_buffer_size (128MB)
    "tcp",                                # protocol ("tcp" or "rdma")
    "",                                   # rdma_devices (empty for auto-select)
    "localhost:50051"                     # master_server_address
)

Read the full file on GitHub · 538 lines

Files

What ships with it

1 file 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. 3d ago First seen · 538 lines · 122 tokens per session scan A 67a219d00ba9

Subscribe to this mod's changes

mooncake-api is a skill published in the GitHub repository kvcache-ai/Mooncake (6,472 stars, last pushed today), licensed Apache-2.0. It adds 122 tokens to every session and 4,106 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.