Skip to content

vivian254338489/litellm-pricing-metadata-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiteLLM Pricing Metadata Diff

diff model prices/context windows/capability metadata before gateway bills surprise you

litellm-pricing-metadata-diff is a tiny offline Node.js CLI for comparing two LiteLLM-style model_prices_and_context_window.json snapshots. It helps AI gateway teams review model pricing metadata, context windows, and capability flags before a routing or cost-tracking change reaches production.

Use it for searches and workflows around LiteLLM pricing, model_prices_and_context_window.json, LLM cost tracking, model metadata diff, and AI gateway pricing diff.

Important: this project does not call provider APIs and does not treat sample values as current third-party prices. All sample metadata is illustrative only. Verify current provider docs before making billing, routing, quoting, or procurement decisions.

Quick Start

npm install
npm run demo

Or run the CLI directly:

node ./bin/diff.js samples/baseline.metadata.json samples/current.metadata.json --format markdown
node ./bin/diff.js samples/baseline.metadata.json samples/current.metadata.json --format table
node ./bin/diff.js samples/baseline.metadata.json samples/current.metadata.json --format json

What It Catches

  • Pricing metadata changes such as input_cost_per_token and output_cost_per_token.
  • Context window changes such as max_input_tokens and max_output_tokens.
  • Capability changes such as supports_function_calling, supports_vision, and response-schema support.
  • Added or removed model records between two local JSON snapshots.

Example Output

| model | field | status | before | after |
| --- | --- | --- | --- | --- |
| sample-claude-haiku | output_cost_per_token | pricing_changed | 0.00000125 | 0.0000014 |
| sample-claude-haiku | supports_vision | capability_changed | false | true |

The example above is illustrative only. Verify current provider docs before making billing or routing decisions.

TKEN Gateway CTA

Testing LiteLLM-compatible routing or cost tracking? Try the disclosed TKEN OpenAI-compatible endpoint:

Input Shape

The CLI accepts either a plain LiteLLM-style object:

{
  "sample-model": {
    "litellm_provider": "example",
    "input_cost_per_token": 0.000001,
    "output_cost_per_token": 0.000004,
    "max_input_tokens": 64000,
    "supports_function_calling": true
  }
}

Or a wrapped object with models:

{
  "models": {
    "sample-model": {
      "litellm_provider": "example",
      "input_cost_per_token": 0.000001
    }
  }
}

These values are illustrative only. Verify current provider docs.

CLI Options

litellm-pricing-metadata-diff <baseline.json> <current.json> [--format markdown|table|json] [--keys a,b,c]
  • --format markdown writes a Markdown report for pull requests and release notes.
  • --format table writes a terminal-friendly table.
  • --format json writes machine-readable diff rows for CI or dashboards.
  • --keys narrows comparison to selected metadata fields.

Docs

Why Offline?

Pricing pages, gateway metadata files, and model capability docs can change independently. This tool compares two files you already trust enough to inspect, such as a pinned model_prices_and_context_window.json snapshot and a proposed update. It intentionally avoids live provider calls so a CI check is reproducible.

License

MIT

About

Offline LiteLLM pricing and model metadata diff CLI for AI gateway cost reviews

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors