Allerion stack: AI gateway, platform + CRM, agent market, and skills store - #2
allerion-systems wants to merge 15 commits into
Conversation
Self-contained docker-compose stack that fronts NVIDIA's hosted OpenAI-compatible API under api.allerion.io. LiteLLM handles virtual keys, rate limits, and budgets; Caddy terminates TLS; Postgres stores keys and spend. Includes config, env template, and a setup/hardening README with an upgrade path to self-hosted GPU nodes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
Streams LiteLLM per-key usage into Stripe Billing Meters so gateway usage becomes invoices automatically. Markup is encoded in the Stripe price, so customers are billed underlying_cost x markup correctly across all models. - billing/billing_sync.py: idempotent usage->meter-event worker with a (startTime, request_id) watermark and a billing_unmapped audit table so no usage is silently dropped. - billing/setup_stripe.py: one-time meter + metered-price creation. - Opt-in compose profile 'billing'; base stack still runs without Stripe. - Docs for onboarding paying customers and reconciling unmapped usage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
Default 'f' formatting kept only 6 decimals, rounding tiny per-request costs to 0.000000 and silently dropping that usage. Use 12 decimals so cheap requests still meter. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
A functional A2A commerce simulation: AI merchant agents sell services to AI buyer agents via capability discovery and alternating-offer negotiation, settled through a ledger that takes a platform commission (the revenue model). Runs on the standard library with no API key (deterministic fulfilment) and upgrades to live fulfilment against any OpenAI-compatible endpoint (Allerion gateway, OpenRouter, NVIDIA, OpenAI) via env vars. Includes pytest suite (money conservation, settlement/fee, negotiation overlap, full-run invariants) — 7 passing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
Zero-dependency stdlib app (http.server + sqlite3) serving the Allerion marketing landing page and an embedded CRM over one SQLite store. Access- request form captures leads; CRM dashboard tracks them through a new->contacted->qualified->won/lost pipeline with a JSON API. Verified end-to-end: landing render, lead capture (form + JSON), status updates, pipeline KPIs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
Add agentmarket.connector.Connector (per-agent handle to the Allerion gateway, live-or-stub) and an optional connector field on both agent types. run_fleet.py spins up 80 agents (30 merchants + 50 buyers), embeds a connector into each, runs the A2A market, and fulfils every deal through the selling merchant's connector. Verified: 80/80 wired, 197 deals, money conserved; existing 7 tests still pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
Signal-green (#76B900) on near-black, blueprint grid backdrop, industrial corner-bracket spec cards, monospace technical labels, live telemetry band with animated EQ bars, pulsing status indicators, glow/lift interactions, and a console-style CRM. Pure CSS, no dependencies. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
Add billing.py (stdlib urllib -> Stripe REST) and a /buy/<tier> route that creates a Stripe Checkout Session and redirects the buyer to it. Pricing cards now carry Subscribe CTAs. Key-configurable via STRIPE_API_KEY (+ optional STRIPE_PRICE_TEAM, PLATFORM_BASE_URL); degrades to a friendly 'configuring' page until the key is set. Verified: routing, graceful no-key path, 404 on unknown tier. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
A zero-dependency storefront that sells productized developer tools as
one-time Stripe purchases with instant, license-gated download delivery.
Products (real, shippable, under apps/store/products/):
- PR Review Pro Claude Skill — severity-ranked diff review + risk-profiler
- Changelog Craft Claude Skill — commits → release notes + semver bump
- Test Forge Claude Skill — testable-surface mapper + test guidance
- Allerion DevKit Codex plugin — MCP server (review_diff/draft_changelog/
scaffold_tests), pure stdlib, local-only, --selftest verified
- DevKit Bundle all four, one license
Store (apps/store/, stdlib only):
- Stripe one-time Checkout (mode=payment); payment verified server-side via
session retrieval before any download is handed over
- HMAC-signed license tokens tied to buyer email; forged tokens get 403
- Delivery zips built on the fly with a personalized LICENSE.txt + README-FIRST
- SQLite order ledger; /api/products, /healthz; storefront in the house theme
- setup_stripe.py to mint stable Price ids; STORE_DEV_FULFILLMENT for local tests
- tests cover catalog, license signing/tamper, and zip delivery (7 passing)
Platform: link the marketing site + CRM to the store (STORE_URL); harden
apps/platform/.gitignore against __pycache__ and drop a stray committed .pyc.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
A new storefront product ($129): a complete, brandable AI assistant the buyer runs themselves — "your own AI" packaged for sale. The product (apps/store/products/allerion-assistant/): - assistant.py — streaming chat web UI + backend on the official Anthropic SDK. claude-opus-4-8, adaptive thinking with summarized display, effort control; streams thinking + text tokens to the browser over SSE. - Multi-turn memory per session with correct Opus replay (full assistant content blocks, incl. thinking, preserved across turns). - Configurable by env: model, effort, system/persona, max tokens, UI name, and ANTHROPIC_BASE_URL to run against a gateway (e.g. api.allerion.io) instead of the Anthropic API. - Graceful API-error and refusal handling surfaced to the UI. - README, requirements.txt (one dep: anthropic), .env.example. Store wiring: - catalog.py: new product "allerion-assistant" (kind "Self-hosted AI App", $129, STRIPE_PRICE_ALLERION_ASSISTANT). Sells + delivers through the existing Stripe one-time checkout + license-gated zip flow unchanged. - tests: assert the assistant zip ships assistant.py + requirements + license, and that the app compiles (9 passing). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
Make the stack deployable to a VPS with `docker compose up`: the marketing site + CRM on allerion.io and the skills store on skills.allerion.io, behind a single Caddy that auto-provisions Let's Encrypt TLS. - apps/platform/Dockerfile, apps/store/Dockerfile (+ .dockerignore) — stdlib apps, no pip; SQLite persisted to /data volumes. - deploy/docker-compose.yml — caddy + platform + store, env-driven, named volumes; requires STORE_SIGNING_SECRET, optional STRIPE_* keys. - deploy/Caddyfile — allerion.io/www → platform, skills.allerion.io → store; commented api.allerion.io block to fold in the gateway under one Caddy. - deploy/.env.example (+ .gitignore for the real .env), deploy/DEPLOY.md — a full runbook: DNS, build, Stripe test→live, gateway port-80/443 coordination, backups. Validated `docker compose config`; booted both apps with container-style env (host 0.0.0.0, /data DB paths). Also drops a stale committed .pyc. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
…moke Run in parallel by three agents, then integrated: Store — durable fulfillment (apps/store): - POST /webhook with stdlib Stripe signature verification (t=,v1= scheme, HMAC-SHA256, 5-min tolerance, multi-v1). On checkout.session.completed (paid) it records the order idempotently and stores a minted license token so a sale survives the buyer closing the success page. 503 if STRIPE_WEBHOOK_SECRET unset; 400 on bad/stale signature. - orders table gains license_token (guarded ALTER migration); set_license_token helper. 4 new tests (signature good/bad/multi/stale + end-to-end record). 13 passing. Deploy ergonomics (deploy/, .github/): - deploy/Makefile — up/down/restart/logs/ps/pull/backup/help. - .github/workflows/deploy.yml — optional SSH auto-deploy on push (inert until VPS_HOST/VPS_USER/VPS_SSH_KEY secrets are set). - deploy/preflight.sh — pre-up checks (docker, .env secrets, DNS, ports 80/443), graceful degradation when tools are absent. - deploy/smoke.sh — post-up /healthz checks for both sites. Integration: wired STRIPE_WEBHOOK_SECRET into compose + .env.example; DEPLOY.md now documents preflight/smoke, the webhook setup, make shortcuts, and the auto-deploy Action secrets. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
xhigh is only accepted by some models (e.g. Sonnet 5); the default claude-opus-4-8 supports low/medium/high/max. Note this in the docstring, README, and .env.example so buyers don't hit a 400. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
Products + one-time Prices for all 6 catalog items now exist in the sandbox Stripe account (created via the Stripe connector). Price ids are not secrets; stored in deploy/stripe-prices.test.env for rehearsal, with a pointer from DEPLOY.md step 5. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FCybcJmhDsAqMFJsBEL4aj
|
CI status: the failing What's failing: the "Deploy to VPS" workflow job on Why it's not this PR: the workflow file is unchanged since runs #1 and #2 of this same workflow on this same branch, which both passed (as designed, the job no-ops while the Likely cause: GitHub couldn't start the hosted This check is optional for the PR anyway — it's the auto-deploy hook, inert until VPS secrets exist. Once billing/policy is resolved, re-running the job from the run page should go green. Generated by Claude Code |
What
This branch builds out the Allerion Systems stack end to end. It started as the AI gateway and now spans the customer-facing platform, the agent marketplace, metered billing, and a self-serve skills store that sells real digital products through Stripe.
On this branch
infra/ai-gateway/api.allerion.iogateway — Caddy + LiteLLM + Postgres fronting NVIDIA's OpenAI-compatible API; virtual keys, budgets, Stripe metered billing syncapps/platform/apps/agent-market/apps/store/Latest addition — Allerion Skills Store (
apps/store/)Sells productized developer tools as one-time purchases with instant, signed-license delivery. Zero dependencies (stdlib only).
Products (real, shippable, under
apps/store/products/):review_diff/draft_changelog/scaffold_teststo OpenAI Codex; pure stdlib, local-only,--selftestverifiedStore mechanics:
mode=payment); payment verified server-side by retrieving the session (payment_status == "paid") before any download is handed over — the redirect is never trusted403LICENSE.txt+README-FIRST.txt/api/products,/healthz; storefront in the house NVIDIA-green themesetup_stripe.pyto mint stable Price ids;STORE_DEV_FULFILLMENT=1for local fulfillment testing without Stripe--selftestPlatform marketing site + CRM now link to the store (
STORE_URL); both checkout flows run through the same Stripe account.Going live
The store runs as a preview without Stripe. To take payments, set
STRIPE_API_KEY(sk_test_…to rehearse with test cards,sk_live_…for real),STORE_BASE_URL, and a productionSTORE_SIGNING_SECRET. Seeapps/store/README.md.Notes / caveats
🤖 Generated with Claude Code
Generated by Claude Code