mirror of
https://github.com/lukaszraczylo/traefik-llmgateway.git
synced 2026-10-12 04:54:45 +00:00
Add tools/pricing-sync: a standalone, compiled Go tool that fetches
LiteLLM's model_prices_and_context_window.json at build time and
regenerates pricing_data_gen.go, a plain map[string]builtinModelMeta
literal keyed by bare model id (context window, input/output cost in
micro-USD per million tokens).
Pruning rule (documented on the tool's own package doc comment): keep
only entries whose litellm_provider matches this gateway's own provider
types (openai, anthropic, deepseek, xai, minimax, cerebras, dashscope
for qwen/alibaba, and moonshot for Kimi models) and whose mode is chat
or embedding, dropping everything else — a 3111-entry table is a real
startup cost under Yaegi interpretation, so the generated table stays at
236 entries. Bare-id collisions across LiteLLM keys resolve
deterministically: a bare key beats a provider-prefixed one, then
provider priority, then lexicographic order.
Naming bridges: a small, data-driven table (namingBridges) duplicates an
entry under a second bare id when a provider's own live API disagrees
with LiteLLM's naming for the identical model — seeded with MiniMax's
lightning/highspeed dual naming, verified against a live deployment.
Coverage-audit follow-up (verified against a live fetch of the same
source, 2026-08): moonshot's own "litellm_provider" tag carries 23
real Kimi entries (kimi-k2.5, kimi-k3, ...), added to the allowlist as a
first-class provider rather than a per-id bridge, since the table is
already keyed by bare id regardless of provider. Two claims from a
coverage-audit request could NOT be verified against this same fetched
file and were deliberately NOT implemented: no key anywhere in the
3111-entry source ends in ":free" (an openrouter free-tier naming
convention the request assumed exists in this file), and no
"qwen/"-prefixed key exists at all — see the report for the full
grounding note. Also confirmed already-correct by design, no change
needed: audio/responses-mode OpenAI entries ("codex-mini-latest" and
friends) are excluded by the existing mode allowlist, not by any
provider special-case; image/video media models are excluded the same
way.
builtinModelMeta itself lives in its own file (builtin_model_meta.go),
separate from modelmeta.go's resolution logic, so this commit's table
and generator compile standalone.
make pricing-sync regenerates the table; add its gitignore entry for the
tool's own compiled binary.
28 lines
1.3 KiB
Plaintext
28 lines
1.3 KiB
Plaintext
.superpowers/
|
|
# Working specs/plans for the agentic workflow — kept local alongside
|
|
# .superpowers/ above (operator decision, 2026-08-21; the directory was also
|
|
# removed from git history at the same time).
|
|
docs/superpowers/
|
|
*.wasm
|
|
tools/yaegi-check/llmgw-yaegi-check
|
|
tools/pricing-sync/llmgw-pricing-sync
|
|
dist/
|
|
|
|
# webui/'s build output (dist/, matched above) and npm dependency tree —
|
|
# neither is source: dist/ is regenerated by `vite build`, node_modules/ by
|
|
# `npm ci`. admin_assets_gen.go (repo root, `make admin-ui`'s other output)
|
|
# is the only artifact from webui/ that is actually committed.
|
|
webui/node_modules/
|
|
|
|
# Rendered from integration/traefik/dynamic.yml.tmpl by `make integration-up`
|
|
# (INTEGRATION_REAL_BASEURL substitution) — generated, not source. A whole
|
|
# directory (not a single file): Traefik's directory-based file provider
|
|
# watches integration/traefik/dynamic/, matching the k8s-ConfigMap-mount
|
|
# pattern (see traefik.yml's own comment).
|
|
integration/traefik/dynamic/
|
|
# Stale-checkout hygiene: this used to be the single rendered file, before
|
|
# the switch to the directory above. Keeping it ignored means a leftover
|
|
# copy from an older checkout (or a stash/worktree predating the switch)
|
|
# never gets accidentally `git add`-ed back in.
|
|
integration/traefik/dynamic.yml
|