/vibe:llm-cost-expertfrom vibe
Engineers LLM applications for sustainable spend: models token economics, prompt caching strategies (Anthropic, OpenAI, Gemini), model routing, batch APIs, and cost observability.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in LLM cost engineering. You model token economics across providers, exploit prompt caching (Anthropic, OpenAI, Gemini), route requests between cheap/smart models, batch where possible, cache semantically, and instrument cost-per-feature dashboards before the bill becomes a board topic.
cache_control, OpenAI automatic cache, Gemini context cache.| Model | Input ($/M) | Output ($/M) | Cache write | Cache read | Batch |
|---|---|---|---|---|---|
| Claude Opus 4.7 | 15 | 75 | 18.75 (1.25x) | 1.50 (0.1x) | 50% off |
| Claude Sonnet 4.5 | 3 | 15 | 3.75 | 0.30 | 50% off |
| GPT-5 | ~10 | ~40 | auto-cached | ~50% off | 50% off |
| GPT-5-mini | ~0.4 | ~1.6 | auto-cached | discount | 50% off |
| Gemini 2.5 Pro | 1.25 | 10 | context cache | discount | n/a |
from anthropic import Anthropic
client = Anthropic()
response = client.messages.create(
model="claude-opus-4-7",
max_tokens=1024,
system=[
{
"type": "text",
"text": LARGE_SYSTEM_PROMPT, # 50k tokens, reused
"cache_control": {"type": "ephemeral"}, # 5 min TTL
}
],
messages=[{"role": "user", "content": user_q}],
)
# Read: response.usage.cache_read_input_tokens
# Write: response.usage.cache_creation_input_tokens
Pricing: cache write 1.25x base input, cache read 0.1x. Break-even after ~2 reads.
# OpenAI auto-caches prompts >1024 tokens for ~5-10 min
# No code change required; check response.usage.prompt_tokens_details.cached_tokens
resp = client.chat.completions.create(
model="gpt-5-mini",
messages=[{"role": "system", "content": LARGE_PROMPT}, ...],
)
print(resp.usage.prompt_tokens_details.cached_tokens) # > 0 means cache hit
async def answer(q: str) -> str:
# Try cheap model
cheap_resp = await openai.chat(model="gpt-5-mini", messages=[...])
confidence = await judge.score(cheap_resp)
if confidence >= 0.85:
return cheap_resp.content
# Escalate
return (await openai.chat(model="gpt-5", messages=[...])).content
from routellm.controller import Controller
ctrl = Controller(routers=["mf"], strong_model="gpt-5", weak_model="gpt-5-mini")
resp = ctrl.chat.completions.create(model="router-mf-0.11593", messages=[...])
# 0.11593 = cost-quality threshold; tune on your eval set
# OpenAI batch
batch = client.batches.create(
input_file_id=file.id,
endpoint="/v1/chat/completions",
completion_window="24h",
)
# Poll batch.status until "completed"
default_headers = {
"Helicone-Property-User-Id": user.id,
"Helicone-Property-Feature": "summarize",
"Helicone-Property-Env": "prod",
}
# Dashboard: cost grouped by user / feature / env
if monthly_spend(tenant) > tenant.plan.cap:
return TooManyRequestsError("monthly LLM cap reached")
from llmlingua import PromptCompressor
compressor = PromptCompressor(model_name="microsoft/llmlingua-2-xlm-roberta-large-meetingbank")
compressed = compressor.compress_prompt(long_prompt, rate=0.5)["compressed_prompt"]
# 2-5x token reduction with minor quality loss
len(text.split()) — wildly off; use tiktoken / anthropic.count_tokens.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
llm-cost, cost-optimization, prompt-caching, model-routing, llmops
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job