# Tokenminning

> Tokenminning is a community wiki for understanding, measuring, and optimizing LLM token usage in production. Built by [Narev](https://narev.ai).

Tokenminning is the deliberate counter-move to **tokenmaxxing**—maximizing raw AI usage without tying spend to outcomes. This site publishes the movement's engineering standards, conceptual guides, and practical techniques for controlling LLM costs: model routing, context hygiene, prompt caching, fiscal ceilings, and cost attribution.

The [homepage](https://tokenminning.ai/) introduces tokenminning, points to the [Manifesto](https://tokenminning.ai/manifesto) and [Constitution](https://tokenminning.ai/constitution), and links into [Practice](https://tokenminning.ai/practice) for optimization playbooks. Start with [Concepts](https://tokenminning.ai/concepts) for token economics.

## Core documents

- [Constitution](https://tokenminning.ai/constitution): Engineering law for production AI cost control — deployment gates, spending caps, and immutable metering ledgers
- [Manifesto](https://tokenminning.ai/manifesto): Overview of the philosophical case for treating inference tokens as a scarce resource
- [About](https://tokenminning.ai/about): Project purpose, what we publish, and how to contribute

## Constitution

- [Article I: immutable metering](https://tokenminning.ai/constitution/article-i): Permanent, tamper-evident records of token usage
- [Article II: the routing mandate](https://tokenminning.ai/constitution/article-ii): Match model tier to task complexity
- [Article III: context window sovereignty](https://tokenminning.ai/constitution/article-iii): Control what enters the context window on every turn
- [Article IV: the fiscal ceilings](https://tokenminning.ai/constitution/article-iv): Hard budget limits enforced in CI/CD and runtime
- [Article V: prompt schema standards](https://tokenminning.ai/constitution/article-v): Structured, versioned prompt templates
- [Article VI: the shadow stack prohibition](https://tokenminning.ai/constitution/article-vi): No unmonitored or unbudgeted model calls

## Manifesto

- [Chapter I: the production gap](https://tokenminning.ai/manifesto/chapter-i): Why inference spend drifts before anyone notices
- [Chapter II: tokenmaxxing](https://tokenminning.ai/manifesto/chapter-ii): The unnamed default of expanding token use
- [Chapter III: tokenminning](https://tokenminning.ai/manifesto/chapter-iii): What the movement advocates
- [Chapter IV: scale and unit economics](https://tokenminning.ai/manifesto/chapter-iv): Energy, finance, and measurement
- [Chapter V: commitments](https://tokenminning.ai/manifesto/chapter-v): Closing pledges for practitioners

## Concepts

- [Tokenminning](https://tokenminning.ai/concepts/tokenminning): Deliberately reducing LLM token consumption while preserving useful output
- [Input and output tokens](https://tokenminning.ai/concepts/input-output-tokens): How providers bill for prompt and completion tokens
- [Context inflation](https://tokenminning.ai/concepts/context-inflation): Why token counts grow faster than per-token prices
- [Model selection](https://tokenminning.ai/concepts/model-selection): Routing and evaluation strategies for cost-quality tradeoffs

## Alternatives

- [Alternatives](https://tokenminning.ai/alternatives): Tool and stack swaps compared by token economics — SEO/GEO hub for "alternative to X" queries
- [Alternatives to Cursor](https://tokenminning.ai/alternatives/cursor): Windsurf, Copilot, Cline, Claude Code, Zed, and BYOK agents vs Cursor subscription and cache metering
- [Alternatives to GitHub Copilot](https://tokenminning.ai/alternatives/github-copilot): Cursor, Cline, Windsurf, and terminal agents vs Copilot premium requests — per-tool breakdowns and token economics
- [Alternatives to Ollama](https://tokenminning.ai/alternatives/ollama): vLLM, llama.cpp, TGI, and LocalAI vs Ollama dev pull-and-chat — GPU economics, hybrid patterns, per-stack breakdowns
- [Alternatives to vLLM](https://tokenminning.ai/alternatives/vllm): Ollama, TGI, llama.cpp, and LocalAI vs vLLM production batching — when throughput ops are overkill

## Practice

- [Where to start](https://tokenminning.ai/practice/where-to-start): Prioritized entry points for token optimization
- [Prompt hygiene](https://tokenminning.ai/practice/prompt-hygiene): Trim system prompts and instructions without losing signal
- [Prompt caching](https://tokenminning.ai/practice/prompt-caching): Reuse identical input to avoid re-billing
- [Context hygiene](https://tokenminning.ai/practice/context-hygiene): Summarize, truncate, and bound agent history
- [Model routing](https://tokenminning.ai/practice/model-routing): Route tasks to the cheapest model that meets quality bars
- [Output and RAG](https://tokenminning.ai/practice/output-and-rag): Control completion length and retrieval payload size
- [Semantic caching](https://tokenminning.ai/practice/semantic-caching): Cache responses for semantically similar queries
- [Local inference](https://tokenminning.ai/practice/local-inference): Run Ollama, vLLM, or OpenAI-compatible servers instead of per-token APIs

## Self-hosting

- [Self-hosting](https://tokenminning.ai/self-hosting): When on-prem inference beats cloud APIs — GPU metering, workload fit, and stack comparison
- [Text generation inference](https://tokenminning.ai/self-hosting/text-generation-inference): Runtime comparison — Ollama, vLLM, llama.cpp, TGI, and LocalAI by workload profile
- [Ollama](https://tokenminning.ai/self-hosting/ollama): Local dev inference, IDE integration, hybrid routing, and GPU time metering
- [vLLM](https://tokenminning.ai/self-hosting/vllm): Production serving with continuous batching, GPU sizing, and observability
- [llama.cpp](https://tokenminning.ai/self-hosting/llama-cpp): GGUF edge inference on CPU, Apple Silicon, and modest GPUs
- [Text Generation Inference](https://tokenminning.ai/self-hosting/tgi): TGI inference engine — Hugging Face production serving for Kubernetes
- [TGI server](https://tokenminning.ai/self-hosting/tgi/server): Run the Text Generation Inference server with Docker
- [TGI API](https://tokenminning.ai/self-hosting/tgi/api): OpenAI-compatible API for Text Generation Inference
- [TGI on Kubernetes](https://tokenminning.ai/self-hosting/tgi/kubernetes): Production K8s deploys for TGI
- [TGI observability](https://tokenminning.ai/self-hosting/tgi/observability): Prometheus metrics and span tags for TGI
- [TGI guardrails](https://tokenminning.ai/self-hosting/tgi/guardrails): Progressive enforcement for Text Generation Inference
- [TGI support](https://tokenminning.ai/self-hosting/tgi/support): Enterprise support, Inference Endpoints, HF token management
- [LocalAI](https://tokenminning.ai/self-hosting/localai): OpenAI-compatible gateway over multiple inference backends

## IDEs

- [IDEs](https://tokenminning.ai/ides): Tokenminning guides for AI coding environments — tool comparison and per-editor optimization
- [Cursor](https://tokenminning.ai/ides/cursor): Measure and reduce token burn in Cursor
- [Windsurf](https://tokenminning.ai/ides/windsurf): Quota metering, SWE models, Cascade rules, and context pinning
- [Devin](https://tokenminning.ai/ides/devin): ACUs, Adaptive routing, cloud sessions, and local agents
- [OpenCode](https://tokenminning.ai/ides/opencode): `opencode stats`, Plan/Build routing, compaction, and MCP
- [Claude Code](https://tokenminning.ai/ides/claude-code): Anthropic usage, CLAUDE.md, bash output, and CI caps
- [Cline](https://tokenminning.ai/ides/cline): VS Code agent tasks, MCP, and auto-approve gates
- [Aider](https://tokenminning.ai/ides/aider): Repo map tokens, architect mode, and git-scoped edits
- [GitHub Copilot](https://tokenminning.ai/ides/github-copilot): Premium requests, chat vs inline vs agent mode
- [Zed](https://tokenminning.ai/ides/zed): Assistant threads, model routing, and context attachment
- [Trae](https://tokenminning.ai/ides/trae): Builder sessions, adaptive context, and quota guardrails
- [OpenRouter](https://tokenminning.ai/ides/openrouter): BYOK gateway caps, model fallbacks, and Activity exports

## Optional

- [AI Catalog](https://tokenminning.ai/.well-known/ai-catalog.json): Agentic Resource Discovery manifest
- [Press](https://tokenminning.ai/press): Media coverage of the tokenminning movement
- [GitHub repository](https://github.com/narevai/tokenminning-wiki): Issues and community feedback
- [Sitemap](https://tokenminning.ai/sitemap.xml): Full list of indexable pages
