Skip to content

throttle scan: a 30-second, no-key first run (0.8.0) - #94

Merged
KushagraKanaujia merged 5 commits into
mainfrom
feat/scan-30s
Nov 12, 2026
Merged

KushagraKanaujia merged 5 commits into
mainfrom
feat/scan-30s

Conversation

@KushagraKanaujia

Copy link
Copy Markdown
Owner

Today the first useful run needs a proxy, a candidate model, a judge key and traffic. throttle scan . needs none of them.

  • Finds the direct OpenAI/Anthropic SDK calls in a repo (Python, JS, TS), prices each at list price, names up to two cheaper models. Every dollar is labelled ESTIMATE, every candidate UNTESTED.
  • Offline, no keys, writes nothing. 1 to 6 seconds on six real open-source AI apps (anthropic-quickstarts, chatbot-ui, gpt-researcher, khoj, LibreChat, mem0).
  • Leaves tests/examples/evals out of totals (--all restores), --model prices runtime-set models, --calls-per-day gives $/month, --json (schema throttle.own.scan/1).
  • Ends with the exact capture → shadow → eval → report commands to prove it.
  • Scanner also finds messages.create(**params) and with_raw_response calls now (noted in CHANGELOG: such jobs get a new approval key).
  • Version 0.8.0; README starts with pip install "throttle-pro==0.8.0" then throttle scan ..

Built by an agent, adversarially reviewed against six real repos, fixed. Tests: 1392 passed locally.

🤖 Generated with Claude Code

Kushagra Kanaujia and others added 5 commits November 12, 2026 12:37
CallSite gains max_tokens (literal max_tokens, max_completion_tokens,
max_output_tokens, maxTokens or maxOutputTokens). It is not part of the
job id, approval key or saved JSON. scan_dir now uses os.walk and never
enters node_modules, virtualenvs or the other SKIP_DIRS, so large repos
scan in seconds. Results are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
throttle scan [PATH] finds every OpenAI and Anthropic call in the code,
prices each at list price per 1,000 calls (or per month with
--calls-per-day), and names up to two cheaper models to test: one tier
down from the same provider, then the other provider's model at a
similar price. No API key, no network, no traffic, no writes.

Every dollar figure is labelled ESTIMATE (list price x an ASSUMED 1,000
tokens in and 300 out per call, or --tokens-in/--tokens-out; a literal
max_tokens caps the output). Every cheaper model is UNTESTED. Runtime
models and models missing from the price table are listed, not priced.
It ends with the capture/shadow/eval/report commands that test the first
pick on real traffic. --json prints schema throttle.own.scan/1.

Listed first in throttle --help, the welcome screen, the README and the
console docs (new page getting-started/scan).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- README and docs no longer run `throttle scan` after pinning 0.7.0, which
  does not have it. The README says it ships in 0.8.0 (FIRST_RELEASE); a test
  makes the release put it in the pinned block.
- Tests, specs, examples, evals and benchmarks are left out of the totals
  (--all puts them back). The headline cut says it weights every call site
  the same.
- Finds client.messages.create(**params) in files that import anthropic,
  with_raw_response / with_streaming_response calls, and reads model and
  prompt from a **params dict literal (4 calls missed in
  anthropic-quickstarts). A local streamText(part.text) is no longer a call.
- Prices a runtime model from a literal default in the code (getenv,
  environ.get, .get, `or`, `??`, `||`, parameter defaults), labelled
  "(default)", and from a new --model NAME flag, labelled "(--model)".
  When calls set the model at runtime, says how to price them.
- Older and other-provider models say so instead of the generic message.
  No legacy prices added: the current OpenAI and Anthropic price pages no
  longer list gpt-4-turbo, gpt-3.5-turbo or Claude 3 models.
- Table: priced calls only, most expensive first, up to 15; locations cut
  from the left so file:line stays; the cap * survives long names; legend
  only with candidates; expressions on one line; "Not priced" folded by file
  and reason; no CHANGE column under 50 columns.
- Skips files without an AI call word before parsing (LibreChat 20s -> 5s).
- Next steps for a Claude pick use Anthropic's OpenAI-compatible endpoint
  and ANTHROPIC_API_KEY; repos with no OpenAI calls get a Claude judge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KushagraKanaujia
KushagraKanaujia merged commit 8ab50c0 into main Nov 12, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant