Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

11.0 KB
Raw Blame

Automated Audit Mode

Use this reference when a scheduled or CI agent audits worker/src/constants/default-model-prices.json.

Goal

Produce either no diff or a surgical pricing/model-coverage diff backed by official provider evidence. The audit must look for newly released major models, not only validate rows already present in the pricing file, and must keep the selectable model arrays free of models the provider no longer serves. Prefer a small report over an uncertain code change.

The workflow opens a pull request only when default-model-prices.json or the selectable model arrays in types.ts change. It discards edits to skill references, the audit memory, or the workflow file when neither of those two files changed, so report findings in the final output instead of writing them to a reference file.

Required Inputs

  • Current pricing JSON: worker/src/constants/default-model-prices.json
  • Selectable model lists: packages/shared/src/server/llm/types.ts
  • Optional prior per-model context from references/model-audit-memory.md; treat it as orientation, not evidence
  • Official provider pricing pages from references/provider-sources-and-price-keys.md
  • Provider capability and alias requirements from references/provider-usage-key-matrix.md
  • Deterministic reports from:
    • node .agents/skills/add-model-price/scripts/validate-pricing-file.mjs

Audit Steps

  1. Run the deterministic validator.
  2. Inspect selectable models and official provider model/pricing pages for recent major text, chat, reasoning, or multimodal LLM launches, renames, pricing changes, and gaps in Langfuse coverage. Do not limit the audit to model names already present in default-model-prices.json.
  3. Fetch official provider pricing and usage-shape pages before changing prices or adding a model. Compare the provider usage object, Langfuse ingestion normalization, and a mature sibling entry. Do not copy a sibling key set mechanically.
  4. Apply only changes with clear official evidence:
    • corrected input, output, cache write, or cache read prices;
    • missing default pricing entries for selectable models;
    • missing default pricing entries for newly released major provider models when the official docs confirm the model ID, price unit, and usage shape;
    • narrow matchPattern additions for documented provider model IDs;
    • required packages/shared/src/server/llm/types.ts additions when a newly priced model should be selectable;
    • removal of selectable model array entries that meet the criteria in "Selectable Model Availability".
  5. Check every entry in openAIModels, anthropicModels, vertexAIModels, and googleAIStudioModels against the provider's official model, deprecation, and lifecycle pages, as described in "Selectable Model Availability".
  6. Add one complete report-table row for every distinct model price entry checked, including confirmed and unchanged entries. Do not collapse multiple checked models into a family-level row.
  7. In a run that changes prices or selectable models, keep the reference files current: edit or delete the existing bullet when a durable fact changes (source URLs, model-ID variants, pricing-page quirks, audit rules), add a row to "Scheduled Changes" in provider-sources-and-price-keys.md for a newly announced dated retirement or price change, and delete rows that this run acted on. Never add dated per-audit entries, re-confirmations of unchanged prices, or lists of pages fetched.
  8. Optionally replace the snapshot in references/model-audit-memory.md in the same kind of run, when retaining the complete current per-model result would materially help a future audit. Do not persist a partial table, append run history, or update it only to refresh the audit date.
  9. Re-run the validator, including changed-entry usage-key validation against the pre-audit pricing file.

Edit Rules

  • Do not guess prices from blogs, changelogs, SDK names, screenshots, issue comments, or third-party aggregators.
  • Do not add broad wildcard regexes to cover unknown future models.
  • Do not reformat the full pricing file unless the content change requires it.
  • Do not rewrite unrelated model entries.
  • Preserve existing IDs when updating an entry.
  • Generate a new lowercase UUID for a new model entry.
  • Refresh updatedAt only for entries that changed.
  • Write every per-token price in a changed entry as <USD per MTok>e-6 (0.1e-6, not 1e-7; 25e-6, not 2.5e-5). See "Price Conversion" in provider-sources-and-price-keys.md.
  • Add newly released major models when they are officially documented, priced, and representable with Langfuse's existing usage keys. Prioritize flagship text/chat/reasoning models and models named by manual audit instructions.
  • Do not add every provider catalog item. Skip or report models whose pricing is for embeddings, images, audio, batch-only, fine-tuned derivatives, or modality-specific endpoints unless the current task explicitly covers them and Langfuse can represent their usage keys safely.
  • Update only pricing skill reference docs for skill learnings; do not edit SKILL.md, scripts, generated shim files, or unrelated skills during an automated audit.
  • Never remove a pricing entry. Retired models keep their pricing entries so historical traces keep their costs; only selectable model array entries may be removed.
  • Do not reorder selectable model arrays, and keep the first entry of each array unchanged. See "Selectable Model Availability" for the one exception.
  • If provider pricing has dimensions Langfuse cannot currently represent safely, leave the code unchanged and report the limitation.

Selectable Model Availability

openAIModels, anthropicModels, vertexAIModels, and googleAIStudioModels in packages/shared/src/server/llm/types.ts populate the model picker in the playground, evaluator setup, and default model settings. The first entry of each array is also the model the LLM connection Test button calls. An entry the provider no longer serves shows users a model that fails with a 404.

Remove an entry from an array only when an official source fetched during the current run shows one of the following:

  • the model is shut down, retired, or past its published retirement or discontinuation date;
  • the ID is a preview, experimental, or dated snapshot that the provider's model pages no longer list, and its successor (usually the GA model) is already in the same array;
  • the model is not callable through the text-generation endpoint that array feeds, for example a Live API-only, realtime-only, or audio-only model.

Keep the entry when:

  • the model is deprecated but its retirement date has not passed yet;
  • the evidence is a blog post, changelog, third-party page, SDK change, or the audit memory alone;
  • the official pages are ambiguous or could not be fetched; report it as unresolved instead.

Apply each array on its own evidence. Vertex AI and Google AI Studio share model IDs but retire them on different schedules, so confirm the lifecycle page for the platform that array targets.

If the first entry of an array is removed, the next remaining entry becomes the default; do not move another model to the front. If that next entry is itself deprecated with an announced retirement date, report it as unresolved so a human can choose a new default.

The output guardrails enforce this: removals need a removed row with an official source, the array cannot become empty, and pricing entries cannot be removed.

Evidence Required In The Agent Summary

Always include a valid Markdown table with one row per checked model price entry and these columns:

Column Required content
Provider Provider whose official source was checked
Model / pricing entry Exact model or pricing-entry name reviewed
Pricing checked Every relevant input, output, cache-read, and cache-write price with the provider unit and converted per-token value
Usage keys checked Every applicable semantic bucket and exact raw/normalized alias expected from provider usage plus Langfuse ingestion
Usage-key coverage Yes only when every supported bucket is represented by all applicable aliases; otherwise No with the gap in comments
Price confirmed Yes only when official evidence fetched in the current run confirms every current price; otherwise No
Tiering checked Every applicable tier name, threshold, and condition, or a statement that no provider tiering applies
Tiering correct Yes when every applicable threshold and tier price is confirmed, No when it is not, or N/A only when no provider tiering dimension applies
Change None, Updated, Added, Removed, or Unresolved
Official source(s) Every official URL used for the row
Comments Units, conversions, tier thresholds, corrections, uncertainty, or why no change was made; use an em dash only when there is genuinely nothing to add

The table is required even when every checked price is confirmed and unchanged. Do not mark prices or tiering confirmed based only on the optional audit memory. The final report must use valid Markdown syntax and be checked for malformed tables, links, lists, backticks, or code fences.

For every changed model, include:

  • model name;
  • whether the change updates an existing entry or adds a newly discovered model;
  • changed JSON keys or matchPattern behavior;
  • supported usage buckets and exact aliases checked;
  • official source URL;
  • provider price unit and converted per-token value;
  • validation commands run.

For every model removed from a selectable model array, include one Removed row with:

  • the arrays it was removed from;
  • its retirement status or date, and its successor if one exists;
  • the official model, deprecation, or lifecycle URL that confirms the status.

Price, usage-key, and tiering confirmations may be No on a removed row. The pricing entry stays unchanged.

For every unresolved finding, include why no code change was made.

For every skill reference update, include the changed reference file and the durable fact that was added, changed, or removed.