ABOUT TOKENS.MD
TOKENS.md is a working idea: a plain markdown file for routing and managing the tokens an AI agent reads and writes. The file names the models an agent may call and what each one is for. Easy work goes to a small, fast model, hard work to a large one, and private work to a model on your own hardware. It says what context to load, trim, summarize or reuse, which prompts to cache, which jobs can go in a batch, and where to fall back when a model or provider is down. It means language-model tokens, never crypto tokens.
WHAT IT COULD COVER
- routes: which model takes which request, by difficulty, speed, cost and privacy
- escalation: try the small model first, move up when a check fails
- context: what to load, what to trim, when to summarize, what never to send
- reuse: stable instructions first, so a cached prefix can be read again
- batching: work that can wait hours goes through a batch queue
- fallbacks: the next model or provider after an error, a timeout or a rate limit
- budgets: per task and per day, and what to do at the cap
- the log: model, tokens in, tokens out and cache hits for each call
HOW IT COULD WORK
- a gateway: every call goes through one proxy, such as the open-source LiteLLM, so routes and fallbacks live in one place
- a local tier: Ollama or vLLM serves a small open-weight model for routine and private work
- a first pass: a cheap model labels each request easy, hard or private, and the route follows the label
- caching: the long system prompt and tool definitions go first and stay unchanged during a run
TERMS AND TOOLS IT COULD NAME
- tokens: the pieces of text a model reads and writes; each model family has its own tokenizer, so the same text counts differently
- prompt caching: Anthropic, OpenAI and Google each offer a form of it for repeated prefixes, each with its own rules
- batch interfaces: several providers accept large sets of requests to run later, often within a day, at a lower rate than live calls
- LiteLLM: an open-source proxy and Python library that puts many providers behind one interface, with fallbacks and spend tracking
- Ollama: a tool for running open-weight models on your own machine
- Model Context Protocol: an open protocol for connecting agents to tools; every tool an agent loads takes up context
WHO IT COULD HELP
- solo developers: run a coding agent all day without sending every small fix to the largest model
- support teams: routine replies on a small model, hard cases on a large one, a person reviewing both
- startups on hosted models: one fallback list for an outage or a rate limit
- clinics and law offices: notes and client files on a local model, only scrubbed text sent out
- platform teams: one routing file that every internal agent reads, instead of settings scattered in code
An agent makes many model calls for each task a person sees, and most are routine. Which model answers each one, and with how much context, decides much of the cost and the wait, yet it is often set once in code and forgotten.
A SKETCH
---
tokens: draft
---
# TOKENS.md
- default: small model, then medium if the check fails
- hard: large model for plans, migrations and code review
- private: client files go to the local model only
- context: files named in the task, summarize past 50k tokens
- cache: system prompt and tool list first, unchanged mid-run
- batch: evals and backfills, results within 24 hours
- fallback: second provider on errors, then stop and ask
- output: up to 1,000 tokens unless the task asks for more
- budget: under 300k tokens a task alone, 300k or more needs a yes
- log: model, tokens in, tokens out, cache hits per call
- never: send secrets, or raise its own budget
DISCLAIMER
TOKENS.md does not route, count, meter, bill or sell tokens, and it calls no model. It is a file that states routes and limits; your gateway, keys and provider settings are what apply them. A smaller model can give worse answers, so check the output before you rely on it. Caching, batch and pricing rules differ by provider and change often. Products named here are described for reference only, with no affiliation or endorsement. The numbers in the sketch are made up, not advice. TOKENS.md is about language-model tokens and has nothing to do with crypto tokens or digital assets.
TOKENS.md is an informational page. It is provided as is, without warranty of any kind, and may be incomplete, inaccurate or out of date. Nothing here is financial, investment, legal, tax, insurance, medical, engineering, safety or other professional advice, or an offer or solicitation of any kind. The sketch is an illustration, not a standard or a recommendation. Names of third-party products or companies, if any, are used only to describe them; no affiliation or endorsement is implied. Use at your own risk. This page sets no cookies and runs no scripts or analytics; like any website, its host keeps standard request logs.