compounding-test / README.md
apingali
fix(hf-space): bump Gradio to 5.x to fix HfFolder ImportError
69d1664

A newer version of the Gradio SDK is available: 6.14.0

Upgrade
metadata
title: The Compounding Test
emoji: πŸ“ˆ
colorFrom: indigo
colorTo: purple
sdk: gradio
sdk_version: 5.9.1
app_file: app.py
pinned: false
license: mit
short_description: A diagnostic for AI investments at non-tech companies.
hardware: zero-a10g

The Compounding Test

A diagnostic for AI investments at non-technology companies. Paste a description of your AI initiative (200–5000 words); receive a scored writeup in one of four quadrants β€” compounder, one-shot win, compounding the wrong thing, or Roman Candle.

Framework essay: https://www.mile-hi.ai/journal/the-berkshire-test

Backends

The Space supports three interchangeable model backends. The dropdown in the UI lets you switch per-submission to compare writeup quality.

Backend Model (default) Credentials Where it runs
anthropic claude-opus-4-7 ANTHROPIC_API_KEY (Space secret) Anthropic API
huggingface google/gemma-2-9b-it none on a Space; HF_TOKEN locally HF Inference Providers
zerogpu microsoft/Phi-4-mini-instruct none β€” Pro plan handles it On-Space ZeroGPU

Auto-detect precedence:

  1. Explicit MODEL_PROVIDER env var wins.
  2. On a Pro Space (zerogpu deps installed) β†’ zerogpu.
  3. Else if ANTHROPIC_API_KEY is set β†’ anthropic.
  4. Else if HF_TOKEN is set, or running on any Space β†’ huggingface.
  5. Else fall through to anthropic (call-time error guides the user).

Configuration

See .env.example for the full list of env vars. Common overrides:

MODEL_PROVIDER=zerogpu
ZEROGPU_MODEL_ID=google/gemma-2-9b-it     # bigger; ~30s cold start on A10
ZEROGPU_DURATION_SECONDS=120              # max GPU allocation per request
HF_MODEL_ID=meta-llama/Llama-3.3-70B-Instruct
MODEL_ID=claude-sonnet-4-6                # cheaper Anthropic fallback

Local development

python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt           # ~2GB with torch/transformers
cp .env.example .env                       # fill in whatever you have
python app.py                              # http://127.0.0.1:7860

If you only need to test the anthropic backend locally, you can skip the heavy spaces / torch / transformers / accelerate lines in requirements.txt β€” the app degrades gracefully (the zerogpu dropdown option won't appear).

Tests

pytest test_diagnose.py -v

31 tests covering the parser contract (15 β€” what JSON shapes the parser accepts and rejects) and the provider routing (16 β€” auto-detection precedence, dispatcher routing, env-driven overrides).

Repository

Source lives in apingali/effectiveness under gradio-apps/compounding-test/. The Space is deployed from that path. The published framework essay and four portrait articles live at https://www.mile-hi.ai/journal/the-berkshire-test.