Talk to any ArXiv paper using ChatGPT
See the codeChange arxiv.org to talk2arxiv.org in any paper link to read the paper and chat with an AI that has read all of it. For example, arxiv.org/abs/1706.03762 becomes talk2arxiv.org/abs/1706.03762.
bioRxiv works the same way: biorxiv.org/content/10.1101/2021.10.04.463034v2 becomes talk2biorxiv.org/content/10.1101/2021.10.04.463034v2.

+ N more. Shared works and preprint/journal versions are merged, and the current paper is excluded.localStorage.Papers that are too long for the context window (about 800K tokens) get a clear error message. So do papers that arXiv has not rendered as HTML.
/api/* to the Worker, so the browser sees one origin, and its CDN caches papers.GET /api/paper/:id fetches the arXiv HTML or bioRxiv full-text page, makes image and link URLs absolute, and extracts plain text with LaTeX math. bioRxiv blocks most servers but allows Cloudflare's network, so bioRxiv papers may fail from a local dev server.GET /api/pdf/:id serves the paper's PDF, for the PDF fallback and for the model.GET /api/meta/:id returns a paper's title and abstract. middleware.ts uses it to give link-preview bots "Talk to {title}" tags.GET /api/citation?paperId=...&referenceId=... resolves a reference from the original bibliography using arXiv IDs, DOIs, or matching titles and authors. Metadata comes from arXiv and Crossref and is cached.POST /api/chat puts the paper text and the conversation into one prompt. It sends the prompt to GPT-6 Luna (openai/gpt-6-luna) through OpenRouter, on the OpenAI provider, and streams the answer back.Answer caching uses the Cloudflare Cache API, shared among readers at the same Cloudflare location. Entries expire after seven days (six hours for unversioned PDF URLs). Keys hash the exact model request, including model settings, system prompts, paper text, cited context, quotations, and conversation history; raw questions are not stored in cache URLs. A cache hit skips the model call. Cache failures fall back to normal chat, and responses sent to the browser remain no-store. X-Answer-Cache reports HIT, MISS, or BYPASS for verification.
Author context uses OpenAlex identities resolved from the current paper’s DOI or exact title and byline. It considers all authors, marks unresolved identities, and uses OR queries across authors before deduplicating by DOI, arXiv ID, and normalized title. Merged versions use their maximum citation count. It starts warming on paper load and caches the combined index for a day (five minutes for incomplete or unavailable results). Retrieval has a 20-second / 40-page budget; a partial lookup is identified as such in the model context, and + N more counts omitted unique works actually retrieved. Provider failures do not prevent ordinary paper chat. The index is part of the answer-cache key and is omitted if it would exceed the paper-context budget. X-Author-Index, X-Author-Index-Authors, and X-Author-Index-Papers expose retrieval status and counts on chat responses. Configure OPENALEX_API_KEY as a Worker secret (yarn wrangler secret put OPENALEX_API_KEY) and in local .dev.vars for reliable production access. Keyless development queries are supported, but shared Cloudflare egress can exhaust OpenAlex’s anonymous allowance and return HTTP 429. After a rate-limit or authentication error, the lookup stops issuing requests and caches the unavailable/partial result briefly.
Install dependencies:
yarn
Put your OpenRouter key in .dev.vars:
cp .dev.vars.example .dev.vars
Start the dev server. It runs the Worker in the real Workers runtime:
yarn dev
Run yarn test for citation matching and chat-context checks, and yarn build to type-check and build both the app and Worker. Manually verify citation previews on desktop and mobile, passage selection, chat streaming, and history after reload.
Deploy the Worker, and set its OpenRouter key:
yarn deploy:worker
npx wrangler secret put OPENROUTER_API_KEY
If the Worker's URL changes, update the /api rewrite in vercel.json.
Push to main. Vercel builds and deploys the site.
Papers come from arXiv. Thank you to arXiv for use of its open access interoperability.
Animated reader components come from Rare UI, under its MIT + Commons Clause + Attribution license. Bottom sheets use Vaul and citation cards use Radix Popover, styled with the app's theme.
962 followers · starred Jan 2024
16 followers · starred Dec 2023
21 followers · starred Dec 2023
18 followers · starred Dec 2023
Talk to any ArXiv paper using ChatGPT
See the codeChange arxiv.org to talk2arxiv.org in any paper link to read the paper and chat with an AI that has read all of it. For example, arxiv.org/abs/1706.03762 becomes talk2arxiv.org/abs/1706.03762.
bioRxiv works the same way: biorxiv.org/content/10.1101/2021.10.04.463034v2 becomes talk2biorxiv.org/content/10.1101/2021.10.04.463034v2.

+ N more. Shared works and preprint/journal versions are merged, and the current paper is excluded.localStorage.Papers that are too long for the context window (about 800K tokens) get a clear error message. So do papers that arXiv has not rendered as HTML.
/api/* to the Worker, so the browser sees one origin, and its CDN caches papers.GET /api/paper/:id fetches the arXiv HTML or bioRxiv full-text page, makes image and link URLs absolute, and extracts plain text with LaTeX math. bioRxiv blocks most servers but allows Cloudflare's network, so bioRxiv papers may fail from a local dev server.GET /api/pdf/:id serves the paper's PDF, for the PDF fallback and for the model.GET /api/meta/:id returns a paper's title and abstract. middleware.ts uses it to give link-preview bots "Talk to {title}" tags.GET /api/citation?paperId=...&referenceId=... resolves a reference from the original bibliography using arXiv IDs, DOIs, or matching titles and authors. Metadata comes from arXiv and Crossref and is cached.POST /api/chat puts the paper text and the conversation into one prompt. It sends the prompt to GPT-6 Luna (openai/gpt-6-luna) through OpenRouter, on the OpenAI provider, and streams the answer back.Answer caching uses the Cloudflare Cache API, shared among readers at the same Cloudflare location. Entries expire after seven days (six hours for unversioned PDF URLs). Keys hash the exact model request, including model settings, system prompts, paper text, cited context, quotations, and conversation history; raw questions are not stored in cache URLs. A cache hit skips the model call. Cache failures fall back to normal chat, and responses sent to the browser remain no-store. X-Answer-Cache reports HIT, MISS, or BYPASS for verification.
Author context uses OpenAlex identities resolved from the current paper’s DOI or exact title and byline. It considers all authors, marks unresolved identities, and uses OR queries across authors before deduplicating by DOI, arXiv ID, and normalized title. Merged versions use their maximum citation count. It starts warming on paper load and caches the combined index for a day (five minutes for incomplete or unavailable results). Retrieval has a 20-second / 40-page budget; a partial lookup is identified as such in the model context, and + N more counts omitted unique works actually retrieved. Provider failures do not prevent ordinary paper chat. The index is part of the answer-cache key and is omitted if it would exceed the paper-context budget. X-Author-Index, X-Author-Index-Authors, and X-Author-Index-Papers expose retrieval status and counts on chat responses. Configure OPENALEX_API_KEY as a Worker secret (yarn wrangler secret put OPENALEX_API_KEY) and in local .dev.vars for reliable production access. Keyless development queries are supported, but shared Cloudflare egress can exhaust OpenAlex’s anonymous allowance and return HTTP 429. After a rate-limit or authentication error, the lookup stops issuing requests and caches the unavailable/partial result briefly.
Install dependencies:
yarn
Put your OpenRouter key in .dev.vars:
cp .dev.vars.example .dev.vars
Start the dev server. It runs the Worker in the real Workers runtime:
yarn dev
Run yarn test for citation matching and chat-context checks, and yarn build to type-check and build both the app and Worker. Manually verify citation previews on desktop and mobile, passage selection, chat streaming, and history after reload.
Deploy the Worker, and set its OpenRouter key:
yarn deploy:worker
npx wrangler secret put OPENROUTER_API_KEY
If the Worker's URL changes, update the /api rewrite in vercel.json.
Push to main. Vercel builds and deploys the site.
Papers come from arXiv. Thank you to arXiv for use of its open access interoperability.
Animated reader components come from Rare UI, under its MIT + Commons Clause + Attribution license. Bottom sheets use Vaul and citation cards use Radix Popover, styled with the app's theme.
962 followers · starred Jan 2024
16 followers · starred Dec 2023
21 followers · starred Dec 2023
18 followers · starred Dec 2023