tierline
Enables LLM clients and coding agents to analyze prompts and recommend the cheapest AI model that meets the task requirements across text, voice, video, and other modalities, projecting monthly cost savings against a flagship baseline.
README
<div align="center">
tierline
Paste a prompt. Find out which model should actually run it.
</div>
$ npx tierline "summarise these 4000 support tickets into themes, we run this nightly" -n 100000
Gemini Gemini 3 Flash Lite text / minimal tier
The floor. Routing, tagging, dedupe.
$0.000162 per call
at 100,000 calls a month $16.22
everything through Claude Opus 5 $3,033
saves $3,017 a month, 99%
<div align="center"> <img src="docs/screenshot.png" alt="tierline picking a model for a bulk summarisation job" width="720"> </div>
Most teams pick one frontier model and send everything to it. That is the single most expensive habit in an AI budget, because the majority of production prompts are transforms that a model costing a hundredth as much would handle identically.
tierline reads the prompt, works out what the job actually needs, and names the cheapest model that clears that bar.
Install
npx tierline "your prompt here"
Or clone it and run the web UI:
git clone https://github.com/jayj221/tierline.git
cd tierline
npm test
node server.js
No dependencies, no build step, no API key. It never calls a model, it only decides which one you should call.
How the tier gets set
Four signals, applied in order.
| Signal | Effect | Example wording |
|---|---|---|
| Reasoning | pushes tier up | architect, derive, root cause, trade-offs, race condition |
| Transform | pulls tier down | summarise, extract, classify, translate, reformat |
| Stakes | sets a floor you cannot cut through | contract, clinical, compliance, production, liability |
| Volume | caps the ceiling | every, nightly, at scale, 90000 records |
Stakes beat volume. A prompt that reviews every patient record daily is high volume and high stakes, and the floor wins, because saving money on that is not a saving.
Modality is detected first: voice, video, image, music, transcription, repo, search or plain text. A narration job never gets offered a text model, and a repo refactor never gets offered a model without the context window to hold it.
Library
import { recommend, classify } from 'tierline';
const r = recommend('architect a multi region failover and reason through the trade-offs', {
monthlyCalls: 2000,
});
r.pick.label // 'Gemini 3 Pro'
r.pick.costPerCall // 0.012829
r.task.tierName // 'frontier'
r.economics.savedPct // 87
r.cautions // things the model cannot know about your situation
classify(prompt) returns just the read on the task if you want to plug your own catalogue in behind it.
MCP
Register it and your coding agent can check itself before burning frontier tokens on a job that did not need them.
{ "mcpServers": { "tierline": { "command": "npx", "args": ["-y", "tierline", "mcp"] } } }
tierline_pick_model takes a prompt and returns the recommendation. tierline_catalogue lists the models.
Prices
Prices live in src/models.js as a single editable table. They are list prices in USD per million tokens, or per character, second, image, minute or track where a vendor bills that way.
They are a snapshot, not a live feed. Vendors change them without notice and negotiated enterprise rates differ, sometimes by a lot. Edit that file before anyone makes a budget decision on the output, and treat the percentages as a shape rather than a quote.
What this is not
It is not a proxy. It does not sit in your request path, hold your keys or forward anything. It answers a question and gets out of the way.
It does not model data residency, retention terms, vendor approval or rate limits. Those rule models out regardless of price, and tierline says so in the cautions rather than pretending otherwise.
The classifier is rules over wording, not a trained model. That is a deliberate trade: you can read every rule in src/classify.js and argue with it, which matters more than a few points of accuracy when the output is a budget decision. If you want a learned router in the request path, RouteLLM and OpenRouter Auto do that well and tierline is not competing with them.
Where it sits
Model routing is a busy space, but it splits into three groups that do not overlap much.
Inference proxies like OpenRouter Auto, RouteLLM and LiteLLM sit in the request path and switch between text LLMs at call time. Cost calculators like AICost.ai and WeCompareAI price a stack you have already chosen. Aggregators like Oakgen put many modalities behind one credit pool.
tierline is none of those. It runs before the call, spans modalities rather than just text LLMs, picks the tool as well as the tier, and projects the monthly bill against a flagship-for-everything baseline. The pieces exist separately. The combination did not.
Tests
npm test
24 assertions over classification, tier floors and ceilings, seat priced tools staying out of the per call ranking, monotonic scaling, and the catalogue being well formed.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。