Maths, science, code, history, grammar and more — solved step-by-step. Free forever. No API key needed.
A free, key-less, browser-native AI solver for any subject. Drop one <script> tag on your page and you have a full reasoning engine.
View on GitHub ↗
Vortex Solver is a lightweight JavaScript library that connects to Pollinations AI — a completely free, no-key-required AI API — to solve problems across 10 subject domains. It also bundles Tesseract.js OCR so it can read problems from images.
It runs 100% in the browser. No server, no account, no payment ever needed.
Download vortex-core.js from GitHub and place it next to your HTML file.
<!-- Step 1: Add the script tag --> <script src="vortex-core.js"></script> <!-- Step 2: Use it --> <script> const vortex = new VortexSolver(); </script>
Or clone the full repo which includes the solver + this frontend:
git clone https://github.com/StuffzEZ/Vortex-Solver.git
cd Vortex-Solver
# Open index.html in a browser — no build step needed
const vortex = new VortexSolver(); // Optional: track progress vortex.onProgress = (msg, pct) => { console.log(`${pct}% — ${msg}`); }; // Solve from text (auto-detects subject) const result = await vortex.solve("Solve 3x² − 5x + 2 = 0"); console.log(result.answer); // "x = 1 or x = 2/3" // Solve with explicit template const r2 = await vortex.solve("What caused WWI?", "history"); // Solve from image const file = document.getElementById("upload").files[0]; const r3 = await vortex.solveFromImage(file, "math"); // Render result into a container vortex.renderInto(document.getElementById("output"), result);
| Method | Arguments | Returns | Description |
|---|---|---|---|
solve(text, templateId?) |
string, string? |
Promise<Result> |
Solve a text problem. templateId defaults to "auto". |
solveFromImage(blob, templateId?) |
File|Blob, string? |
Promise<Result> |
Runs Tesseract OCR on the image then solves. |
renderInto(el, result) |
HTMLElement, Result |
void |
Injects a styled solution card into el. |
getTemplates() |
— | Object |
Returns the full template registry object. |
Properties: Set vortex.onProgress to a (msg: string, pct: number) => void callback before calling solve. vortex.version returns the semver string.
Every solve method returns a Promise resolving to this shape:
result.error contains the message and result.answer will be an empty string. Always check result.error !== null.
Each template provides an optimised system prompt tuned for that subject. Pass the template id as the second argument to solve() or solveFromImage().
Use "auto" to let the library classify the subject automatically via a fast pre-solve AI call. This adds ~1–2 seconds but works across mixed-subject inputs.
// List all available template ids at runtime const tpls = vortex.getTemplates(); Object.keys(tpls); // ["auto","math","science","code",...] // Access template metadata tpls.math.label; // "Mathematics" tpls.math.icon; // "∑" tpls.math.color; // "#34d399" tpls.math.exampleProblems; // string[]
Set vortex.onProgress before calling solve to receive live stage updates.
const vortex = new VortexSolver(); vortex.onProgress = (message, percent) => { // message: human-readable stage description // percent: 0–100 number myProgressBar.style.width = percent + "%"; myStatusLabel.textContent = message; }; await vortex.solve("What is integration by parts?", "math");
| Stage | Approx % | Message |
|---|---|---|
| Init | 2–5% | Starting… / Starting OCR… |
| OCR | 5–40% | Reading image… N% |
| Template detect | ~42% | Detecting subject… |
| AI reasoning | 55–88% | Solving with <subject> tutor… |
| Answer extract | 90% | Extracting answer… |
| Done | 100% | Done ✓ |
vortex.renderInto(container, result) injects a self-contained, styled solution card into any DOM element. It injects its own CSS once via a <style> tag with id __vortex_styles__ so it won't conflict with your page styles.
<div id="output"></div> <script> const vortex = new VortexSolver(); const result = await vortex.solve("Explain Newton's 2nd law", "science"); vortex.renderInto(document.getElementById("output"), result); </script>
The card displays: template badge, final answer prominently, and the full reasoning in a scrollable mono box.
Minimal page with a text input:
<!DOCTYPE html> <html> <head><script src="vortex-core.js"></script></head> <body> <textarea id="q" placeholder="Ask anything…"></textarea> <button id="go">Solve</button> <div id="out"></div> <script> const v = new VortexSolver(); const out = document.getElementById("out"); document.getElementById("go").addEventListener("click", async () => { const q = document.getElementById("q").value; const result = await v.solve(q); v.renderInto(out, result); }); </script> </body> </html>
Image upload with template selection:
const v = new VortexSolver(); v.onProgress = (msg, pct) => updateUI(msg, pct); const file = document.getElementById("photo").files[0]; const result = await v.solveFromImage(file, "science"); if (result.error) { console.error("Solve failed:", result.error); } else { console.log("Answer:", result.answer); console.log("Steps:", result.reasoning); }
Follow these steps to embed Vortex Solver into any existing website or web app in under 5 minutes.
Step 1 — Download the library
# Option A: clone the repo git clone https://github.com/StuffzEZ/Vortex-Solver.git # Option B: download just the core library curl -O https://raw.githubusercontent.com/StuffzEZ/Vortex-Solver/main/vortex-core.js
Step 2 — Add to your HTML
Add the script before your closing </body> tag (or in <head> with defer):
<script src="vortex-core.js" defer></script>
Step 3 — Instantiate and wire up your UI
const vortex = new VortexSolver(); // Show a spinner or progress bar as it works vortex.onProgress = (msg, pct) => { progressBar.style.width = pct + "%"; statusEl.textContent = msg; }; // Call solve() and use the result however you like async function onSubmit() { const question = myInput.value; const template = mySelect.value; // e.g. "math", "science" const result = await vortex.solve(question, template); if (result.error) { errorEl.textContent = result.error; return; } // Option A: render the built-in card vortex.renderInto(outputDiv, result); // Option B: use the data yourself answerEl.textContent = result.answer; reasoningEl.textContent = result.reasoning; }
Step 4 — (Optional) Build a template picker
const templates = vortex.getTemplates(); const select = document.getElementById("tplSelect"); Object.values(templates).forEach(tpl => { const opt = document.createElement("option"); opt.value = tpl.id; opt.textContent = tpl.icon + " " + tpl.label; select.appendChild(opt); });
solve() calls are async. You can safely call new VortexSolver() at page load.
OCR accuracy: Tesseract works best with clear, high-contrast, typed text. Handwriting and complex diagrams (graphs, geometric figures) may not extract correctly. For handwritten maths, consider prompting the user to type the problem instead.
AI hallucination: Pollinations AI (and all LLMs) can make reasoning errors on complex or ambiguous problems. The "Retry" feature re-runs the solve with an explicit "double-check" instruction which often improves accuracy.
Rate limits: Pollinations AI has no hard rate limits for typical use but may slow on high traffic. The library automatically retries 3 times per model and falls back across 3 models.
Network: Requires internet access to reach Pollinations AI. An offline mode is not currently supported.