Downshift

Case studies

Two real repos Downshift had never seen

Static analysis finds where LLM calls live. Bob finds what they are and what they cost. Both repos are public, permissively licensed and pinned to a commit.

Case study · OrchestrAI

OrchestrAI: one helper, five features

OrchestrAI builds software with a pipeline of LLM modules: plan, write code, debug, modify, write a README. Downshift had never seen it before.

Every module goes through one shared helper. The model comes from YAML and each prompt is loaded from a text file at runtime, so static analysis sees one call with nothing resolved.

Repository
samshapley/OrchestrAI
License
MIT
Commit
866deaa
Scope
engineering_pipeline, the pipeline set in config.yml
Audited
Sep 26, 2026
Metricast scanBob audit
Call sites15
Models resolved05
Prompts resolved05
Enriched for evals05

OrchestrAI · Bob audit

What Bob found, for 0.46 Bobcoins

  • Split the helper into 5 features, one per module that calls the LLM. code_planner has no function of its own and is dispatched through a generic fallback.
  • Resolved every model: gpt-4-0613 from config.yml for four modules, and a per-module override to gpt-3.5-turbo-16k for debugger in the pipeline YAML.
  • Rebuilt every prompt the way the app assembles it at runtime, including the two modules that build their own user message.
  • Found the volume multipliers: debugger retries up to 3 times per run, and modify_codebase loops until the user stops.

OrchestrAI · Cost projection

The bill static analysis cannot see

Static-only view

$540.00 / month

1 call site, model assumed

With the Bob audit

$2,408.99 / month

5 features, real models and prompts

FeatureModelCalls/dayMonthly
engineergpt-4-0613200$587.70
modify_codebasegpt-4-0613200$575.64
code_plannergpt-4-0613200$566.10
create_readmegpt-4-0613200$560.16
debuggergpt-3.5-turbo-16k600$119.39
Total$2,408.99
downshift estimate docs/case-study/orchestrai/downshift.audit.json \
  --base docs/case-study/orchestrai/downshift.scan.json \
  -c docs/case-study/orchestrai/downshift.yaml --completion-tokens 1500

OrchestrAI · Findings

What this shows

  1. 01Static analysis alone underestimates this bill about 4.5x. It sees one call where the app makes five, seven with debugger retries.
  2. 0295% of projected spend is four features on gpt-4-0613, one of OpenAI's most expensive legacy models.
  3. 03The author already downshifted once, by hand: debugger runs on gpt-3.5-turbo-16k. On gpt-4-0613 it would cost about $1,734 a month instead of $119. Downshift makes that call per feature, backed by evals.
  4. 04A third-party pricing tracker lists gpt-4-0613 for deprecation on Oct 23, 2026. Downshift's eval step is how you would pick each replacement.

OrchestrAI · Limitations

Assumptions, stated plainly

  • Projection, not a bill: OpenAI list prices (checked Sep 26, 2026) x assumed volume of 200 pipeline runs a day.
  • Output assumed at 1,500 tokens per call because no module sets max_tokens. Input counts only the static system prompts, so it is a floor.
  • No evals were run on this repo (paid API calls, $0 budget), so there are no downgrade recommendations here. The SupportDesk demo shows the full loop.
  • Only engineering_pipeline was audited. The four other pipelines use the same helper and pattern.

Full write-up, scan, audit and config on GitHub

Case study · mem0

mem0: 14 call sites, 4 real features

mem0 is a widely used memory layer for AI apps: it extracts facts from conversations, stores them and retrieves them later.

It supports many LLM providers through adapter classes. Static analysis finds the adapters; the features that actually spend money are one level up. Running on it also exposed two scanner bugs, now fixed with tests.

Repository
mem0ai/mem0
License
Apache-2.0
Commit
94c3fe9
Scope
default setup: OpenAI provider, library code in mem0/
Audited
Sep 26, 2026
Metricast scanBob audit
LLM call sites1417
Models resolved15
Prompts resolved15
Product features identified04

mem0 · Bob audit

What Bob found, for 3.32 Bobcoins

  • Split the OpenAI adapter into the 4 features that use it: fact extraction on add(), procedural memory, image description (vision only) and search reranking.
  • Resolved every model and setting: gpt-5-mini by default, and a separate reranker config with its own temperature and token limit.
  • Rebuilt the prompts, and noted that the async add and procedural paths send the same prompts as the sync ones.
  • Two fix-ups by script, no Bob loop: the 13 untouched scan entries were merged back, and two long prompt constants Bob left as placeholders were copied from source.

mem0 · Cost projection

The bill static analysis cannot see

Static-only view

$307.20 / month

1 OpenAI helper, model and output assumed

With the Bob audit

$2,329.62 / month

4 features, real models, prompts and limits

FeatureModelCalls/dayMonthly
fact extraction (add)gpt-5-mini10,000$1,581.98
search rerankinggpt-5-mini100,000$675.00
image descriptiongpt-5-mini500$60.12
procedural memorygpt-5-mini100$12.53
Total$2,329.62
downshift estimate docs/case-study/mem0/downshift.audit.json \
  --base docs/case-study/mem0/downshift.scan.json \
  -c docs/case-study/mem0/downshift.yaml

mem0 · Findings

What this shows

  1. 01Static analysis sees plumbing, not features: 14 call sites, 13 of them provider adapters or examples. The default setup runs 4 features, and cost belongs to features.
  2. 02Static-only pricing underestimates this bill about 7.6x.
  3. 03The reranker calls the LLM once per candidate document. At 10 candidates, 10,000 searches become 100,000 LLM calls: $675 a month, 29% of the bill, from one for loop.
  4. 04Fact extraction re-sends a 33,653-character prompt on every add(). Input alone is about $382 of that feature's $1,582, a strong candidate for prompt caching or a cheaper model.

mem0 · Limitations

Assumptions, stated plainly

  • Projection, not a bill: OpenAI list prices (checked Sep 26, 2026) x assumed volume of 10,000 adds and 10,000 reranked searches a day.
  • Output is priced at max_tokens, a ceiling, so feature costs are an upper bound. Tokens are estimated from words; runtime text is not counted.
  • No evals were run on this repo (paid API calls, $0 budget), so there are no downgrade recommendations here.
  • Default setup only: the other provider adapters, the integration and the example were not audited or priced.

Full write-up, scan, audit and config on GitHub