Repository navigation
feat: login-free Cloudflare Workers demo with free Workers AI, live citations and daily quotas - #15
Conversation
…ex evidence and D1 quotas
…x citations and quota notices - remove Supabase auth gate, share page and Pro paywall from the public build - wire /api/evidence into the main flow with graceful fallback - self-host fonts, drop Google Fonts and ipapi locale lookup, make PostHog opt-in
…imited; dedupe Cache-Control
…final stage output
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
… source tags and plan ruler
…lan ruler and ranking note
Raw API responses such as 'API 502: {"error":"upstream_error"}' no longer
reach the toast or the inline run error. Free-tier failures map to the
existing quota/unavailable notices, other API errors to a generic localized
message (en, zh). Raw details are logged to the console only.
Adds a custom_domain route to wrangler.jsonc and keeps workers.dev enabled. The Worker has no origin or host checks, so no code change is needed. Docs point to the new domain.
Summary
Rebuilds the public demo as a login-free Cloudflare Worker (preview only: https://research-thinking.ledring.workers.dev, no custom domain or routes yet).
What changed
worker/,wrangler.jsonc): serves the SPA with Workers Static Assets, plus:POST /api/llm: streams from the Workers AI binding. Only free-plan models are allowed (@cf/zai-org/glm-4.7-flashis the default,@cf/google/gemma-4-26b-a4b-itis optional). Callers can't pass a base URL. It uses JSON mode and turns GLM thinking off. Request limits: 48 KB body, 12 messages,max_tokens≤ 3072.research-thinking): 3,000 neurons/day global (30% of the shared 10k free allocation, sostrandskeeps 70%), 600 neurons/day per IP, 12 LLM requests/min per IP. Costs are reserved before each call and settled from the real neuron usage in the stream. IPs are stored only as salted hashes.POST /api/evidence: server-side OpenAlex search (polite User-Agent and mailto). An optionalOPENALEX_API_KEYsecret is supported. If OpenAlex rate-limits or fails, it falls back to Crossref. Responses are cached in the Cache API for 24 h.GET /api/status: available models and remaining quota.supabase/folder is untouched.@fontsource/fira-code). No Google Fonts, no ipapi lookup._headerssets CSP andCache-Control: … no-transformon HTML, which stops the zone from injecting Web Analytics (same fix as lakeboard-convert fix(watch): run without the now-private digest, report its status #12).pnpm eval --mode worker --limit Nruns against the deployed Worker.Verification
pnpm lint,pnpm test(89 tests),pnpm build,pnpm typecheck:server,pnpm typecheck:worker: all pass.--var IP_REQUESTS_PER_MINUTE:1(rate-limit notice shown) and--var GLOBAL_DAILY_NEURONS:100(quota-exhausted notice shown, demo still works with real evidence). Production values were then restored.Total cost: 357 neurons (about 71 per run). A UI run with a seed idea costs about 115.
Not in this PR / needs a decision
research.ledring.devis not attached yet.masterwill change what the git-connected Vercel project builds: a login-free SPA without/api/*, where only BYO key and the demo would work there.wrangler secret put OPENALEX_API_KEY) would bring OpenAlex back as the primary source.