regen-builtin-pricing

command
v2.7.0-dev.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Generator for internal/pricing/builtin.go.

Reads BerriAI/litellm's model_prices_and_context_window.json (from the URL by default, or a local file via --source), filters to the curated allowlist below, and emits a fresh builtin.go with a generation-time UpdatedAt on every entry.

Motivation: issue #259 showed that hand-authored builtin rates drift silently — the demo's gemini-3.5-flash entry was 20× too low on input, 30× too low on output. Regenerating from LiteLLM removes that class of drift; the UpdatedAt field lets operators see how old the current builtin snapshot is.

Usage:

# Regenerate from LiteLLM's live master:
go run ./dev/regen-builtin-pricing

# From a pinned local snapshot (e.g. reviewing what would change
# without hitting the network):
go run ./dev/regen-builtin-pricing --source=/tmp/litellm.json

# Preview to stdout without writing:
go run ./dev/regen-builtin-pricing --stdout

Ownership: regenerate before every release. Review the diff — the allowlist is stable but LiteLLM occasionally shifts rates. Commit both the regenerated builtin.go and any allowlist changes together.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL