No description
- TypeScript 100%
| .gitignore | ||
| bun.lock | ||
| CLAUDE.md | ||
| models-dev-cli.ts | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
models.dev cli
Multi-column sorting CLI for models using the @opencode-ai/models package.
Why This Exists
The models.dev website only allows single-column sorting and combines input/output token costs into one column. This CLI lets you:
- Sort by multiple columns in priority order
- Separate input and output token costs for comparison
- Filter for reasoning models and compare their pricing
- Export data as JSON for further analysis
Installation
cd models-dev-cli
bun install
Requires Bun (v1.0+)
Usage
bun run models-dev-cli.ts [options]
Options
| Flag | Description |
|---|---|
--sort <field>[,asc|desc] |
Sort by field (can specify multiple, applied left-to-right) |
--limit <n> |
Limit output to n rows (default: 50) |
--show-reasoning |
Show reasoning model details |
--json |
Output as JSON instead of formatted table |
--help |
Show help |
Sortable Fields
output_cost- Output token cost (USD per 1M tokens)input_cost- Input token cost (USD per 1M tokens)context- Context window sizeoutput_limit- Max output tokensreasoning- Reasoning support (true/false)tool_call- Tool/function calling supportstructured_output- Structured output (JSON schema) supportrelease_date- Release datename,id- Model name/ID
Examples
Cheapest output cost (cheapest first):
bun run models-dev-cli.ts --sort output_cost,asc --limit 10
Most expensive models:
bun run models-dev-cli.ts --sort output_cost,desc --limit 10
Multi-column: Reasoning models first, then by price:
bun run models-dev-cli.ts --sort reasoning,desc --sort output_cost,asc --show-reasoning
Best context windows, sorted by price:
bun run models-dev-cli.ts --sort context,desc --sort output_cost --limit 20
Export JSON for analysis:
bun run models-dev-cli.ts --json --sort output_cost | jq '.[0:5]'
All reasoning models with pricing sorted:
bun run models-dev-cli.ts --sort reasoning,desc --sort output_cost --show-reasoning
Output Columns
| Column | Meaning |
|---|---|
| Name | Human-readable model name |
| Output $ | Cost per 1M output tokens (USD) |
| Input $ | Cost per 1M input tokens (USD) |
| Context | Context window size |
| Max Out | Maximum output tokens |
| Rsn | Reasoning enabled (Yes/-) |
| Tool | Tool/function calling supported |
| Struct | Structured output (JSON schema) supported |
Sample Output
Models (sorted by: output_cost↑, context↓)
Total: 20
Name Output $ Input $ Context Max Out Rsn Tool Struct
------------------------------------------------------------------------------------------------------------
Voxtral Mini 3B 2507 $0.04 $0.04 128.0K 4.1K - ✓ ✓
Gemma 3 4B IT $0.08 $0.04 128.0K 4.1K - ✓ -
Nova Micro $0.14 $0.04 128.0K 8.2K - ✓ -
...
Data Source
Uses the bundled snapshot from @opencode-ai/models/snapshot - no API key required. Data is updated periodically in the npm package.
License
MIT