feat(pricing): refresh bundled prices and consider an explicit user update API

Open
#395 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
backend, data

Research direction

Start with chatlas/_tokens.py and the Makefile update-pricing target, then inspect .github/workflows/check-update-types.yml and ellmer commit 57e3d72d. The bundled-data portion is done when chatlas/data/prices.json matches the current ellmer source; any refresh API should have offline tests and must not make normal imports or chats access the network.

Written by the indexing model from the issue text.

Description

ai-triage:done Priority: Low

Why this matters

Chatlas packages a snapshot of ellmer pricing data for cost estimates. The current snapshot is older than ellmer's source: chatlas has 1,286 entries dated 2026-08-10, while ellmer has 1,306 entries dated 2026-08-17. This omits pricing for newer models and tiers, including Claude Mythos, Gemini 3.7, GPT-5.6 Bedrock large-context tiers, and newer Groq/Mistral models.

Ellmer added an explicit models_update_prices() cache-refresh API in tidyverse/ellmer#968 (57e3d72d) after deciding against automatic background refreshes.

Scope

  1. Refresh the bundled chatlas/data/prices.json from ellmer as a maintenance update.
  2. Evaluate whether chatlas should expose a user-invoked pricing refresh API backed by a local cache, rather than requiring a package release for new model pricing.
  3. If adding the API, define its network behavior, cache location, schema/version validation, failure behavior, and whether cached data replaces or merges with bundled data. Keep it explicit: no automatic network request during normal imports or chats.
  4. Add tests that do not require live network access.

Starting points

  • chatlas/_tokens.py: loads the packaged pricing snapshot at import time and performs lookups.
  • Makefile target update-pricing: downloads the source artifact from ellmer.
  • .github/workflows/check-update-types.yml: keeps generated pricing current in CI.
  • Ellmer reference: git -C ../ellmer show 57e3d72d.

Non-goals

  • Do not change cost calculation semantics or make pricing lookup network-dependent.
  • Do not silently alter prices during import, tests, or a normal chat request.

Open design question

The bundled-data refresh is independently actionable. The runtime API is optional and should be split into a follow-up if its design adds more than a small, well-tested cache layer.

Dominant language
Python
Stars
179
Forks
32
Avg merge
1d 3h
Merged PRs (30d)
10

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from posit-dev/chatlas

All issues in posit-dev/chatlas

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.