Skip to content

feat(v1.5): contribution CTA + auto-gen tables + MCP server + agent docs + charts#13

Merged
howardpen9 merged 3 commits into
mainfrom
chore/v1.5-redo
Jun 7, 2026
Merged

feat(v1.5): contribution CTA + auto-gen tables + MCP server + agent docs + charts#13
howardpen9 merged 3 commits into
mainfrom
chore/v1.5-redo

Conversation

@howardpen9

Copy link
Copy Markdown
Owner

Re-do of PR #12 — that one was auto-marked MERGED by GitHub when its parent PR #11 landed, but the actual v1.5 commits never made it to main. This branch is rebased onto current main and adds two new things on top of v1.5: auto-generated provider tables and bilingual notes schema.

Three feature groups + Notes-column squeeze fix

A) Lower contribution friction

  • README "Want your relay listed?" section (en/zh-TW/zh-CN) above price snapshot — surfaces the issue template + PR path; sets expectation that status: unverified is normal until canary
  • Enhanced .github/PULL_REQUEST_TEMPLATE.md with schema CI mention + operator-disclosure field
  • New .github/workflows/pr-validate.yml runs scripts.validate on every PR touching data/, fetchers/, scripts/, pyproject.toml

B) Agent integration layer

  • mcp/awesome-ai-api-proxy-mcp (separate PyPI package): 6 tools (list_providers, list_canonical_models, get_price, find_cheapest, compare, tier_overview) + data://prices/latest resource. FastMCP, stdio. Branch override via AWESOME_AI_API_PROXY_REF env var.
  • docs/agent-integration.md — MCP / OpenAI function calling / LangChain / direct HTTP / pandas+DuckDB / n8n examples, same example question across all six paths
  • CSV + Parquet exports in build_prices.py — gated on [charts] extra

C) Visualization

  • scripts/build_charts.py — matplotlib SVG: tier-ladder bar chart (input + output) + cost-spread heatmap (rows × cols × log color)
  • README embeds tier-ladder-input.svg inside prices markers
  • docs/index.html — GitHub Pages dashboard (vanilla HTML + Plotly CDN, no build step). Reads raw prices.latest.json, renders interactive grouped bars + heatmap + filterable record table. docs/.nojekyll keeps it served raw.

D) Auto-generated provider tables (NEW vs PR #12)

Fixes the Notes-column squeeze (China relays table was 7 cols, now 5: Station / Type / Payment / Trust / Notes). Last-verified date and entity-registered info fold into the new Trust column as active · 2026-05-26 · registered.

Solves the contribution friction root cause: every prior provider PR (#1, #2, #5, #6, #8, #9) had to hand-edit three READMEs alongside providers.yaml. Now PRs only touch providers.yaml; tables auto-regenerate via the new scripts/build_provider_tables.py.

  • providers.yaml notes can now be string OR bilingual dict {en, zh-TW, zh-CN}. All 19 existing entries migrated to bilingual; new entries can be English-only.
  • schema.md and validate.py updated to enforce the new shape.

Pipeline

Weekly price-refresh.yml now installs [charts] extra and runs in order:
scrape → build_prices → build_charts → build_provider_tables → validate

Test plan

  • Three fetchers pass (3/3, 1024 records, 47 canonical matches)
  • CSV (185KB) + Parquet (24KB) generated alongside JSON
  • 4 SVGs in assets/charts/, README embeds input ladder
  • MCP server smoke-tested: find_cheapest("grok-4.3") → Relaydance $1.125
  • build_provider_tables renders 12 section blocks (4 sections × 3 langs)
  • scripts.validate exits 0
  • Open a test PR mutating providers.yaml with a bad typepr-validate.yml red-lights
  • Enable GH Pages (Settings → Pages → main /docs already set) → dashboard at https://howardpen9.github.io/awesome-ai-api-proxy/
  • Add MCP server to Claude Desktop → ask relay-pricing question → confirm tool call

Out of scope (v2)

  • Historical trend charts (need ≥4 weeks of snapshots)
  • Canary automation
  • More fetchers (UiUiAPI / Yunwu / bltcy)
  • Triaging the 5 remaining open backlog PRs (after this merges)

🤖 Generated with Claude Code

tactfunc and others added 3 commits June 7, 2026 14:58
…Pages dashboard

Three additive feature groups on top of v1 price observatory:

A) Lower contribution friction
- README "Want your relay listed?" section (en/zh-TW/zh-CN) above price snapshot
  Surfaces issue template + PR path; sets expectation that status=unverified is normal
- Enhanced .github/PULL_REQUEST_TEMPLATE.md with schema CI mention + operator
  disclosure field
- New .github/workflows/pr-validate.yml runs scripts.validate on every PR
  touching data/, fetchers/, scripts/, or pyproject.toml — catches typos before
  human review

B) Agent integration layer
- New mcp/ package: awesome-ai-api-proxy-mcp (separate PyPI dist)
  Six tools: list_providers, list_canonical_models, get_price, find_cheapest,
  compare, tier_overview + data://prices/latest resource. FastMCP, stdio.
  Branch override via AWESOME_AI_API_PROXY_REF env var for dev/staging.
- docs/agent-integration.md: one-page reference for MCP / OpenAI function
  calling / LangChain / direct HTTP / pandas+DuckDB / n8n. Same question
  ("cheapest claude-sonnet-4.6") across all six examples for friction comparison.
- scripts/build_prices.py now also writes prices.latest.csv + prices.latest.parquet
  for analyst-friendly access (gated on [charts] extra)

C) Visualization
- scripts/build_charts.py generates SVG via matplotlib:
  - tier-ladder bar chart (input + output) with log y-axis and per-bar labels
  - cost-spread heatmap (rows=canonical, cols=providers, log color scale)
- README embeds tier-ladder-input.svg inside the prices markers
- docs/index.html: GitHub Pages dashboard (vanilla HTML + Plotly CDN, no build
  step) reads raw prices.latest.json, renders interactive grouped bars +
  heatmap + filterable record table. docs/.nojekyll keeps it served raw.
- Weekly workflow now installs [charts] extra and runs build_charts after
  build_prices, before validate.

All v1 fetchers still pass (3/3 fetchers, 1024 records, 47 canonical matches).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Re-ran scrape → build_prices → build_charts to produce:
- Refreshed data/snapshots/2026-06-07/ (new captured_at, same prices)
- data/prices.latest.{json,csv,parquet} (tabular exports added)
- assets/charts/tier-ladder-{input,output}.svg
- assets/charts/spread-heatmap-{input,output}.svg

The CSV/Parquet are committed (not gitignored) so the agent-integration.md
examples work via raw URL without running the pipeline locally.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…table)

Fixes the Notes-column squeeze in the China relays table (was 7 cols, now 5)
and the contribution-friction root cause: every prior provider PR had to edit
three READMEs alongside providers.yaml. Now PRs only touch providers.yaml;
tables regenerate via scripts/build_provider_tables.py.

Changes:
- New scripts/build_provider_tables.py renders 4 sections × 3 languages
  between <!-- providers:<section>:start/end --> markers. Sections supported:
  china_relays, global_gateways, self_hosted_alternatives, comparison_tools.
- China table reduced from 7 → 5 columns: Station / Type / Payment / Trust / Notes
  Trust combines status + last_verified + (· registered when entity is visible).
  Last-verified date and entity-registered info still live in providers.yaml
  for completeness; just no longer take dedicated columns.
- providers.yaml notes can now be a string OR a bilingual {en, zh-TW, zh-CN}
  dict. All 19 existing entries migrated to bilingual; new entries can be
  English-only.
- data/schema.md documents the new notes shape.
- scripts/validate.py accepts both string and dict notes; rejects dicts
  missing 'en' key.
- price-refresh.yml workflow runs build_provider_tables after build_charts so
  the weekly PR includes regenerated provider tables alongside prices/charts.
- CONTRIBUTING.md updated to say "edit providers.yaml only" (was technically
  wrong before — tables WERE hand-maintained).

Side effect: re-render after merging this means future Atlas Cloud / Relaydance
edits to providers.yaml auto-propagate to all three READMEs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@howardpen9 howardpen9 merged commit bae2a65 into main Jun 7, 2026
2 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.

2 participants