10xAnswers
10x-answers.vercel.app- side project
- 2024 to 2025
- npm package
- Stateless proxy
- Solo
10xAnswers is a React chat component on npm and the small backend behind it. A site installs the package, passes a persona prompt and a backend URL, and gets a chat that answers questions about the person or product behind it.
I built and published both alone, and the package has 13,113 downloads across 56 releases. Every site on the default URL shares one hosted proxy, so it is stateless by design: the conversation travels with each question, the model key never leaves the server, and nothing is kept between requests.



- Type
- side project
- Role
- Solo
- When
- Dec 2024 to May 2025, maintained since
- Stack
- React, Recoil, Vite, Express, Gemini, Vercel
- Links
- 10x-answers.vercel.appnpm
What I built
The component
A draggable React chat: markdown with highlighted code, questions you can edit and ask again, a skeleton or an error for each answer on its own, themed with about 20 CSS variables.
A package that installs cleanly
ES and UMD builds behind an exports map, React left to the host app, the styles carried inside the bundle, and kept installable as npm changed under it.
How it worksOne stateless proxy
Every site shares it, so it keeps nothing: input checked, prompts capped, the model on a deadline, and a clean status code when something is wrong.
How it worksA playground that writes the code
A 15-field configurator that turns your choices into the snippet to paste.
A TypeScript port
For Plura AI as plura-chatbot, where I'm the largest contributor.
How it fits together
One proxy, every site
Every site on the default URL talks to the same function, so it can't hold a conversation without mixing them up. I settled that in the first version: the component keeps the history and sends it inside each question, and the proxy answers and forgets. Two sites never see each other's chats, and any copy of the function can answer any request, so the host can run as many as the traffic needs.
That first version still pushed every question and answer, from every site, onto a global array that nothing ever read: memory that only grew for as long as an instance stayed warm. I deleted it when I came back to harden the proxy.
It speaks Gemini's own request shape, so the component has one code path whether it talks to this proxy, to your own backend or straight to Gemini with your key. I advise against the last: the key then ships to every visitor.
10xAnswers-BE · api/index.js
app.post("/", async (req, res) => { const prompt = req.body?.contents?.[0]?.parts?.[0]?.text if (typeof prompt !== "string" || !prompt.trim()) { return res.status(400).json({ message: /* shape */ }) } if (prompt.length > MAX_PROMPT_CHARS) { return res.status(413).json({ message: /* limit */ }) } try { // History arrives inside the prompt from the client, // so this function stays stateless and conversations // from different sites never mix. const result = await model.generateContent(prompt) const text = result.response.text() res.json({ candidates: [{ content: { parts: [{ text }] } }], }) } catch (err) { const status = err?.status === 429 ? 429 : 502 res.status(status).json({ message: /* try again */ }) }})Failing like an API
In September 2026 the model it called was retired, and every request came back 404; the old proxy answered every failure with a 400 and the upstream's raw error. Now the model is an always-current alias that one environment variable can pin, and the proxy answers like an API: 400 for a malformed body, 413 past 12,000 characters, 429 when the model is rate limited, 502 when it fails. Anything over 64 KB is refused unread.
A week later the alias began thinking before it answered, which alone took short answers past the host's time limit. Thinking is now kept to the minimum, the function may run for 30 s, and the model call gives up at 25 s, so a slow answer ends in a clean error from the proxy instead of the platform's timeout page.
What the proxy costs, measured
I load-tested the proxy as it is, on my laptop, with Gemini's address pointed at a local stub, so what's left is the proxy's own work: parsing and checking the body, building the model request, reading the answer and sending it back. Each question carried the component's default prompt, 1,710 characters.
One question at a time, the proxy adds about 0.2 ms at p50 over calling the stub directly. With the stub taking 500 ms, like a quick model, an answer takes the model's time and very little else, and a prompt over the cap is refused without a model call at all. The proxy is not where this breaks; the shared model quota is, long before.
| Load | Answers a second | p50 | p95 | p99 |
|---|---|---|---|---|
| 1 connection, the stub alone | 12,269 | 0.05 ms | 0.18 ms | 0.42 ms |
| 1 connection, through the proxy | 1,673 | 0.27 ms | 2.18 ms | 5.87 ms |
| 50 connections, through the proxy | 3,101 | 12.8 ms | 32.7 ms | 65.3 ms |
| 50 connections, the stub taking 500 ms | 98 | 504 ms | 539 ms | 568 ms |
| 50 connections, every prompt over the cap | 8,584 | 5.1 ms | 10.7 ms | 19 ms |
A package other apps install
It's built in Vite's library mode as ES and UMD files behind an exports map. React is a peer dependency, the markdown renderer and the rest stay out of the bundle, the CSS is injected by the bundle itself so there is nothing else to import, and the component wraps itself in its own Recoil root, so a site needs no provider.
Each answer is an atom keyed by its own id and its question's text, loaded by an async selector. Editing a question changes the key, so only that answer is fetched again, and each shows its own skeleton or error without touching the rest of the chat.
Keeping it installable is part of the job. In September 2026 I found that a stray dependency named “-” made current npm refuse to install the package at all, and shipped 1.1.17 to fix it. It needs React 18 because Recoil 0.7 does, and the README says so, with the workaround.
0
downloads, all time
56
releases
6,292
last year
1
advisory
The advisory is mine too. Recoil 0.7.7 breaks on React 19 internals, so the readme says so, with the downgrade path.
What breaks first at 10× the traffic
The prompt. The component resends the whole conversation with every question, so a long chat grows until it crosses the prompt cap and gets a 413, and the history sits in one module-level array, so two chats on one page share it. The fix is a budget kept per chat: the last few turns as they were, older ones summarised, counted before sending.
The shared quota. Every site on the default URL draws on one model key, and CORS is open on purpose, so one busy site's 429s become everyone's. Next come a key per site, a token bucket per origin in Redis in front of the model, and answers streamed, so the first words arrive before the whole answer is written.
Next. Version 2: streaming, React 19, provider adapters and a voice mode, as the interface of an agent on this site.
